Open justinchuby opened 2 months ago
torch._check_is_size(pad_idx) or whatever u0 is
@avikchaudhuri another reason to implement your stack walker lol
Was this change needed in torch/_refs
or in user code? Sorry I am not yet familiar with _check_is_size
User code. I guess it's also possible that maybe some framework code could use a check_is_size but if pad_idx is only passed into the indexing operation we can't do that because negative indices are supported there.
🐛 Describe the bug
I am testing the logic on huggingface longformer. This exact repro is a little complex because I have changed some source code in transformers, but the error stack may give you some ideas?
Versions
main
@jiashenC
cc @ezyang @anijain2305 @chauhang @penguinwu @avikchaudhuri @gmagogsfm @zhxchen17 @tugsbayasgalan @angelayi @suo @ydwu4