From 1c61cbee0a3d5f7ff2b933e446fb97876c833577 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Sou=C4=8Dek?= Date: Thu, 24 Nov 2022 22:18:16 +0100 Subject: [PATCH] fix sparse_quantize to work with int coordinates do not call torch.floor on int tensors as it returns 'RuntimeError: not implemented for Int' --- MinkowskiEngine/utils/quantization.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MinkowskiEngine/utils/quantization.py b/MinkowskiEngine/utils/quantization.py index a50c3caa..9a19e8d2 100644 --- a/MinkowskiEngine/utils/quantization.py +++ b/MinkowskiEngine/utils/quantization.py @@ -130,6 +130,8 @@ def _auto_floor(array): if isinstance(array, np.ndarray): return np.floor(array) else: + if array.dtype == torch.int32 or array.dtype == torch.int64: + return array return torch.floor(array)