pytorch
8a3a54e0 - Fix index_select decomp (#86469)

Commit
2 years ago
Fix index_select decomp (#86469) For decomposing index_select with 0-dim tensor, we cannot write `x.unsqueeze(0)[index].squeeze(0).clone()` , as tensor[index] will trigger index.item() if index is a 0-dim tensor, and .item() cannot be symbolically traced with FakeTensor. We use `torch.ops.aten.index(x.unsqueeze(0), [index]).squeeze(0).clone()` as a workaround. Pull Request resolved: https://github.com/pytorch/pytorch/pull/86469 Approved by: https://github.com/ngimel
Author
Committer
Parents
Loading