Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix the div warning issue #407

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions MinkowskiEngine/MinkowskiSparseTensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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:
Expand Down