Skip to content

Commit 69c1034

Browse files
authored
Fix integer division error (#163)
1 parent 4fa67d2 commit 69c1034

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

torchsparse/nn/functional/downsample.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ def spdownsample(
2424

2525
if all(stride[k] in [1, kernel_size[k]] for k in range(3)):
2626
coords = coords.clone()
27-
coords[:, :3] = torch.div(coords[:, :3],
28-
sample_stride).trunc() * sample_stride
27+
coords[:, :3] = torch.div(
28+
coords[:, :3],
29+
sample_stride.float()).trunc() * sample_stride # type: ignore
2930
else:
3031
offsets = get_kernel_offsets(kernel_size,
3132
tensor_stride,

0 commit comments

Comments
 (0)