From d26b73baa913f699a438992d2fccab75b3494408 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Egemen=20Yi=C4=9Fit=20K=C3=B6m=C3=BCrc=C3=BC?= Date: Thu, 25 Feb 2021 19:24:47 +0100 Subject: [PATCH] fixed bug of cuda cpu mismatch --- MinkowskiEngine/MinkowskiSparseTensor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MinkowskiEngine/MinkowskiSparseTensor.py b/MinkowskiEngine/MinkowskiSparseTensor.py index d6998994..1b40c729 100644 --- a/MinkowskiEngine/MinkowskiSparseTensor.py +++ b/MinkowskiEngine/MinkowskiSparseTensor.py @@ -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] @@ -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)