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

username: arkgithubforyou
cooked: <p>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:</p>
<p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/4/6/46fded6ca41ffbea32473d2e930e1557a29fa0bd.png" data-download-href="https://discuss.pytorch.org/uploads/default/46fded6ca41ffbea32473d2e930e1557a29fa0bd" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/4/6/46fded6ca41ffbea32473d2e930e1557a29fa0bd_2_690x188.png" alt="image" data-base62-sha1="a81sw5r7UR5jhnRS87Crk39JPDT" width="690" height="188" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/4/6/46fded6ca41ffbea32473d2e930e1557a29fa0bd_2_690x188.png, https://discuss.pytorch.org/uploads/default/optimized/3X/4/6/46fded6ca41ffbea32473d2e930e1557a29fa0bd_2_1035x282.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/4/6/46fded6ca41ffbea32473d2e930e1557a29fa0bd_2_1380x376.png 2x" data-dominant-color="2E2E2E"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">2649×725 31.3 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/7/d/7d1b90cbb46a73bab106eae550c71a6fcdbc7d93.png" data-download-href="https://discuss.pytorch.org/uploads/default/7d1b90cbb46a73bab106eae550c71a6fcdbc7d93" title="image"><img src="https://discuss.pytorch.org/uploads/default/original/3X/7/d/7d1b90cbb46a73bab106eae550c71a6fcdbc7d93.png" alt="image" data-base62-sha1="hQKK3vPY6XxiyY1leewD8j34FnJ" width="670" height="500" data-dominant-color="303030"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">844×629 13.5 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>what should I look at?</p>

username: arkgithubforyou
cooked: <p>btw the binary is here:</p><aside class="onebox githubfolder">
  <header class="source">
      <img src="https://github.githubassets.com/favicons/favicon.svg" class="site-icon" width="16" height="16">
      <a href="https://github.com/arkgithubforyou/yaho" target="_blank" rel="noopener nofollow ugc">github.com</a>
  </header>
  <article class="onebox-body">
    <img src="https://avatars.githubusercontent.com/u/25368074?s=400&amp;amp;v=4" class="thumbnail onebox-full-image" width="60" height="60">

<h3><a href="https://github.com/arkgithubforyou/yaho" target="_blank" rel="noopener nofollow ugc">arkgithubforyou/yaho</a></h3>


  <p><span class="label1">Contribute to arkgithubforyou/yaho development by creating an account on GitHub.</span></p>

  </article>
  <div class="onebox-metadata">
    
    
  </div>
  <div style="clear: both"></div>
</aside>


username: ptrblck
cooked: <p>Could you update PyTorch to the latest stable version (<code>1.8.1</code>) or the nightly release and retry your code?</p>
<p>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. <img src="https://discuss.pytorch.org/images/emoji/apple/wink.png?v=9" title=":wink:" class="emoji" alt=":wink:"></p>

username: arkgithubforyou
cooked: <p>Turned out there’s a -1 in index -.-</p>