rusty1s / pytorch_scatter

PyTorch Extension Library of Optimized Scatter Operations
https://pytorch-scatter.readthedocs.io
MIT License
1.5k stars 178 forks source link

Pytorch_scatter vs Torch.scatter #404

Closed L-Reichardt closed 7 months ago

L-Reichardt commented 7 months ago

Hello,

thank you very much for this library and for the active support. I have been using it continuously in the last two years and it has been indispensable for PointCloud processing. I recently learned that scatter operations were introduced to PyTorch (because of the popularity of this package) and wanted to ask, if there are any major differences / planned support in the future. I.e. should I use on over the other for future projects?

Best Regards, L

rusty1s commented 7 months ago

In general, I recommend to use the PyTorch ops due to ease of use and ease of installation. We worked hard to bring these ops to PyTorch directly. torch-scatter has still the following advantages:

However, please note that torch-scatter is slow on CPU, and it is preferred to use the PyTorch ops for CPU when you don't have a GPU available. That's why we also introduced torch_geometric.utils.scatter that picks the best computation dependent on reduce and device, see https://github.com/pyg-team/pytorch_geometric/blob/master/torch_geometric/utils/scatter.py#L50.