From a30adb77e3b32b7c5c8c9c2a30a95d59b010f685 Mon Sep 17 00:00:00 2001 From: jamjamjon Date: Sun, 29 Dec 2024 17:40:08 +0800 Subject: [PATCH] ###### --- src/misc/ops.rs | 3 ++- src/models/yolo/preds.rs | 14 +++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/misc/ops.rs b/src/misc/ops.rs index 2b9211d..6630631 100644 --- a/src/misc/ops.rs +++ b/src/misc/ops.rs @@ -181,7 +181,8 @@ impl Ops<'_> { } pub fn make_divisible(x: usize, divisor: usize) -> usize { - (x + divisor - 1) / divisor * divisor + // (x + divisor - 1) / divisor * divisor + x.div_ceil(divisor) } // deprecated diff --git a/src/models/yolo/preds.rs b/src/models/yolo/preds.rs index e85e762..12029bd 100644 --- a/src/models/yolo/preds.rs +++ b/src/models/yolo/preds.rs @@ -227,13 +227,13 @@ impl YOLOPredsFormat { x: ArrayBase, Dim>, nc: usize, ) -> ( - Option>, - Option>, - ArrayView, - Option>, - Option>, - Option>, - Option>, + Option>, + Option>, + ArrayView<'a, f32, IxDyn>, + Option>, + Option>, + Option>, + Option>, ) { match self.task() { Task::ImageClassification => (None, None, x, None, None, None, None),