From 62e94fbf322ab1ecc75b12b13571b8472d5c8833 Mon Sep 17 00:00:00 2001 From: felix Date: Fri, 20 Jun 2025 13:05:45 +0200 Subject: [PATCH] [bug] Fix viptr onnx export issue --- doctr/models/classification/vip/layers/pytorch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doctr/models/classification/vip/layers/pytorch.py b/doctr/models/classification/vip/layers/pytorch.py index 0fc6aa9ced..dd85196252 100644 --- a/doctr/models/classification/vip/layers/pytorch.py +++ b/doctr/models/classification/vip/layers/pytorch.py @@ -433,7 +433,7 @@ def windows2img(self, img_splits_hw: torch.Tensor, h_sp: int, w_sp: int, h: int, Returns: A float tensor of shape (b, h, w, c). """ - b_merged = int(img_splits_hw.shape[0] / (h * w / h_sp / w_sp)) + b_merged = img_splits_hw.shape[0] // ((h * w) // (h_sp * w_sp)) img = img_splits_hw.view(b_merged, h // h_sp, w // w_sp, h_sp, w_sp, -1) # contiguous() required to ensure the tensor has a contiguous memory layout # after permute, allowing the subsequent view operation to work correctly.