Skip to content

Instantly share code, notes, and snippets.

@eliasffyksen
Created August 8, 2022 18:58
Show Gist options
  • Save eliasffyksen/46984c82da54a3fc39e1b8d76ef1a8df to your computer and use it in GitHub Desktop.
Save eliasffyksen/46984c82da54a3fc39e1b8d76ef1a8df to your computer and use it in GitHub Desktop.
positions = snake.flatten().topk(2)[1]
[pos_cur, pos_prev] = [T(unravel(x, snake.shape)) for x in positions]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment