From 5eb5c6c8dc40bab53522c58af907c47055f87d2b Mon Sep 17 00:00:00 2001 From: resuly Date: Mon, 4 Oct 2021 15:18:08 +1100 Subject: [PATCH] fix the div warning --- MinkowskiEngine/MinkowskiSparseTensor.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MinkowskiEngine/MinkowskiSparseTensor.py b/MinkowskiEngine/MinkowskiSparseTensor.py index b80d5f49..fe1d4695 100644 --- a/MinkowskiEngine/MinkowskiSparseTensor.py +++ b/MinkowskiEngine/MinkowskiSparseTensor.py @@ -435,10 +435,10 @@ def torch_sparse_Tensor(coords, feats, size=None): # return the contracted tensor if contract_coords: - coords = coords // tensor_stride + coords = torch.div(coords, tensor_stride, rounding_mode='trunc') if max_coords is not None: - max_coords = max_coords // tensor_stride - min_coords = min_coords // tensor_stride + max_coords = torch.div(max_coords, tensor_stride, rounding_mode='trunc') + min_coords = torch.div(min_coords, tensor_stride, rounding_mode='trunc') new_coords = torch.cat((batch_indices, coords), dim=1).long() @@ -534,7 +534,7 @@ def dense(self, shape=None, min_coordinate=None, contract_stride=True): # return the contracted tensor if contract_stride: - coords = coords // tensor_stride + coords = torch.div(coords, tensor_stride, rounding_mode='trunc') nchannels = self.F.size(1) if shape is None: