We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Tensor
make_tuple
1 parent 313c9b0 commit ab1faa0Copy full SHA for ab1faa0
torchsparse/utils/helpers.py
@@ -256,3 +256,10 @@ def make_tuple(inputs, dimension=3):
256
elif isinstance(inputs, tuple):
257
assert len(inputs) == dimension, 'Input length and dimension mismatch'
258
return inputs
259
+ elif isinstance(inputs, torch.Tensor):
260
+ inputs = inputs.squeeze()
261
+ shape = inputs.shape
262
+ assert len(shape) == 1 and shape[0] == dimension, 'Input length and dimension mismatch'
263
+ if inputs.is_cuda:
264
+ inputs = inputs.cpu()
265
+ return tuple((t.item() for t in inputs))
0 commit comments