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

fixed bug of cuda cpu mismatch #319

Merged
merged 1 commit into from
May 11, 2021
Merged
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
4 changes: 2 additions & 2 deletions MinkowskiEngine/MinkowskiSparseTensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ def dense(self, shape=None, min_coordinate=None, contract_stride=True):
shape = torch.Size([shape[0], self._F.size(1), *[s for s in shape[2:]]])

# Use int tensor for all operations
tensor_stride = torch.IntTensor(self.tensor_stride)
tensor_stride = torch.IntTensor(self.tensor_stride).to(self.device)

# New coordinates
batch_indices = self.C[:, 0]
Expand Down Expand Up @@ -512,7 +512,7 @@ def dense(self, shape=None, min_coordinate=None, contract_stride=True):
nchannels = self.F.size(1)
if shape is None:
size = coords.max(0)[0] + 1
shape = torch.Size([batch_indices.max() + 1, nchannels, *size.numpy()])
shape = torch.Size([batch_indices.max() + 1, nchannels, *size.cpu().numpy()])

dense_F = torch.zeros(shape, dtype=self.F.dtype, device=self.F.device)

Expand Down