Understanding indexing with pytorch gather

torch.gather(input, dim, index, out=None, sparse_grad=False) → TensorGathers values along an axis specified by dim.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Mateusz Bednarski

Mateusz Bednarski

AI enthusiast. Focused mostly on NLP and good software engineering practices for machine learning projects. Currently working at Roche.