Skip to content

Commit

Permalink
.dense fix cuda cpu mismatch (#319)
Browse files Browse the repository at this point in the history
  • Loading branch information
ekomurcu committed May 11, 2021
1 parent c4470e2 commit a445cf6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions MinkowskiEngine/MinkowskiSparseTensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,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 @@ -527,7 +527,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

0 comments on commit a445cf6

Please sign in to comment.