Skip to content

Commit 99d0792

Browse files
committed
fix for pytorch 1.6.0
1 parent 8f5a1e3 commit 99d0792

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

csrc/cpu/grid_cpu.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ torch::Tensor grid_cpu(torch::Tensor pos, torch::Tensor size,
3232

3333
pos = pos - start.unsqueeze(0);
3434

35-
auto num_voxels = ((end - start) / size).toType(torch::kLong) + 1;
35+
auto num_voxels = (end - start).true_divide(size).toType(torch::kLong) + 1;
3636
num_voxels = num_voxels.cumprod(0);
3737
num_voxels =
3838
torch::cat({torch::ones(1, num_voxels.options()), num_voxels}, 0);
3939
num_voxels = num_voxels.narrow(0, 0, size.size(0));
4040

41-
auto out = (pos / size.view({1, -1})).toType(torch::kLong);
41+
auto out = pos.true_divide(size.view({1, -1})).toType(torch::kLong);
4242
out *= num_voxels.view({1, -1});
4343
out = out.sum(1);
4444

0 commit comments

Comments
 (0)