NVIDIA / MinkowskiEngine

Minkowski Engine is an auto-diff neural network library for high-dimensional sparse tensors
https://nvidia.github.io/MinkowskiEngine
Other
2.43k stars 360 forks source link

Fix: stride and coord on different devices #470

Closed Gofinge closed 1 year ago

Gofinge commented 2 years ago

Fix the bug min_coords and tensor_stride on different devices and raise an error on line 414. A better solution is to assign value to self.device even if it is None in self.init? Then we can make all new tensors can be generated on the specific device directly, instead of .to().

Gofinge commented 2 years ago

More specific descriptions of this bug: Assume self.C and self.F are on 'cuda' -> 'min_coord = min(self.C) is on 'cuda' -> tensor_stride = torch.IntTensor() is on 'cpu' -> Boom.