Why .gather() cannot be applied on these tensors?

This came from the crf within AllenNLP, but I’ve pinned it down to this two specific tensors, which I just don’t understand why I cannot gather:


what should I look at?

btw the binary is here:

Could you update PyTorch to the latest stable version (1.8.1) or the nightly release and retry your code?

PS: you can post snippets by wrapping them into three backticks ```, which makes debugging easier and would allow indexing of the code snippet so that other users could use it in the forum search. :wink:

Turned out there’s a -1 in index -.-