diff --git a/torchsparse/nn/functional/downsample.py b/torchsparse/nn/functional/downsample.py index 500f285..75347cf 100644 --- a/torchsparse/nn/functional/downsample.py +++ b/torchsparse/nn/functional/downsample.py @@ -24,8 +24,9 @@ def spdownsample( if all(stride[k] in [1, kernel_size[k]] for k in range(3)): coords = coords.clone() - coords[:, :3] = torch.div(coords[:, :3], - sample_stride).trunc() * sample_stride + coords[:, :3] = torch.div( + coords[:, :3], + sample_stride.float()).trunc() * sample_stride # type: ignore else: offsets = get_kernel_offsets(kernel_size, tensor_stride,