Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scatter operations missing index locations #1631

Open
sarmientoF opened this issue Nov 27, 2024 · 2 comments
Open

scatter operations missing index locations #1631

sarmientoF opened this issue Nov 27, 2024 · 2 comments

Comments

@sarmientoF
Copy link

It will be great to return the index locations from the scatter operations like torch_scatter:
`from torch_scatter import scatter_max

src = torch.Tensor([[2, 0, 1, 4, 3], [0, 2, 1, 3, 4]])
index = torch.tensor([[4, 5, 4, 2, 3], [0, 0, 2, 2, 1]])
out = src.new_zeros((2, 6))

out, argmax = scatter_max(src, index, out=out)
`
https://pytorch-scatter.readthedocs.io/en/1.3.0/functions/max.html

Is this an upcoming feature ?

@awni
Copy link
Member

awni commented Nov 27, 2024

There's no plan to add this at the moment. A scatter_argmax might be doable, but I'm curious what would you use it for?

@thegodone
Copy link

thegodone commented Nov 28, 2024

this is used in some graphs architecture to speed up computation (one call instead of 2) and not available in mlx-graphs repo https://github.com/mlx-graphs/mlx-graphs/blob/4619d97ade4a788d1fe20b4d08b994ad56ee5ca0/mlx_graphs/utils/scatter.py#L10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants