mit-han-lab / torchsparse

[MICRO'23, MLSys'22] TorchSparse: Efficient Training and Inference Framework for Sparse Convolution on GPUs.
https://torchsparse.mit.edu
MIT License
1.19k stars 138 forks source link

The correct format of SparseTensor datatype? #264

Closed Tortoise0Knight closed 9 months ago

Tortoise0Knight commented 10 months ago

In https://torchsparse-docs.github.io/reference/torchsparse.html#torchsparse.tensor.SparseTensor, it says: coords – 2D integer tensor with of shape N x 4, where the first three dimensions correspond to quantized x, y, z coordinates, and the last dimension denotes the batch index. However, when I checked the definition of sparse_collate() at line 27, torchsparse/utils/collate.py, it seems that the batch index should be the fist dimension of the batched SparseTensor. Also I checked the .F property of a SparseTensor in a torch.utils.data.DataLoader, it seems corresponding to the source code. Is the description in the documentation wrong?

ys-2020 commented 10 months ago

Yes. Thanks for pointing that out. We shifted the batch index to the first dimension in v2.1.0. Please refer to https://torchsparse-docs.github.io/getting_started/basics.html for more details.