Skip to content

Commit

Permalink
Fix integer division error (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
gyes00205 authored Jul 29, 2022
1 parent 4fa67d2 commit 69c1034
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions torchsparse/nn/functional/downsample.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 69c1034

Please sign in to comment.