Open erichan1 opened 2 years ago
Can index into a NestedTensor without grad, but cannot index into a NestedTensor with grad
Steps to reproduce the behavior:
import torch c = torch.Tensor([1,2]) d = torch.nested_tensor([c,c]) print(d[0]) # works d.requires_grad=True print(d[0]) # fails
Traceback (most recent call last): File "/fsx/users/erichan1/work/erichan1_test/random/nt_index_test.py", line 6, in <module> print(d[0]) # fails RuntimeError: Internal error: NestedTensorImpl doesn't support sizes. Please file an issue on https://github.com/pytorch/nestedtensor
The second print should print tensor([1., 2.]), but fails instead.
conda
pip
n/a
🐛 Bug
Can index into a NestedTensor without grad, but cannot index into a NestedTensor with grad
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The second print should print tensor([1., 2.]), but fails instead.
Environment
conda
,pip
, source): PipAdditional context
n/a