rusty1s / pytorch_scatter

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

scatter_logsumexp incorrect behaviour with -inf src tensor #407

Open wangben88 opened 6 months ago

wangben88 commented 6 months ago

Hi,

The scatter_logsumexp function seems to produce an incorrect result when the src Tensor has -inf values; as a minimal example:

import torch
from torch_scatter import scatter_logsumexp

src = torch.Tensor([-torch.inf, -torch.inf])
index = torch.tensor([0, 0])
scatter_logsumexp(src=src, index=index)

produces 0.0, rather than -inf. I found #369 which seems to introduce this bug.

Thanks!

github-actions[bot] commented 5 days ago

This issue had no activity for 6 months. It will be closed in 2 weeks unless there is some new activity. Is this issue already resolved?