Lightning-AI / Lightning-AI/lightning-thunder
The order of dimensions in advanced indexing with unsqueeze (None) does not match PyTorch
Open
@IvanYashchuk is already working on this.
Since Jun 4, 2025.
bug
indexing
lightning-l1
operators
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 121
- PR merge metrics
- No merged PRs in 30d
Description
import thunder
import torch
def fn(a, idx):
return a[idx]
a = torch.randn(5, 5, 7, requires_grad=True)
idx = (None, [1, 2])
print(fn(a, idx).shape) # torch.Size([1, 2, 5, 7])
jfn = thunder.jit(fn)
print(jfn(a, idx).shape) # torch.Size([2, 1, 5, 7])
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.