Skip to content

scatter_logsumexp incorrect behaviour with -inf src tensor #407

Closed
@wangben88

Description

@wangben88

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions