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.15k stars 131 forks source link

[BUG] `coords` batch index should be 0 instead of 3 in `bev.py` #296

Open ashawkey opened 3 months ago

ashawkey commented 3 months ago

Is there an existing issue for this?

Current Behavior

https://github.com/mit-han-lab/torchsparse/blob/462dea4a701f87a7545afb3616bf2cf53dd404f3/torchsparse/nn/modules/bev.py#L96

It seems some modules still use 3 as the batch index instead of 0 in the latest implementation.

Expected Behavior

Modify to coords = (coords - self.offset).t()[[0] + self.bev_dims].long()

Environment

- GCC:
- NVCC:
- PyTorch:
- PyTorch CUDA:
- TorchSparse:

Anything else?

No response

zhijian-liu commented 2 months ago

Thank you for reporting this issue. Could you please submit a short pull request for this? Thanks!