An array $a$ has at least one maximum element $x$. $argmax$ in its simplest case gives the index $i$ of this maximum element, so that $a_i = max(a)$. The Tensorflow argmax requires you to designate one dimension of your tensor to act as that array.

Once you have some indices, you can convert them to values using gather. gather in its simplest case is equivalent to doing an array lookup: $gather(a, i) = a[i]$.

gather assumes that each scalar is an index along the first dimension. You can use gather_nd to target other values:

You should know the rules for all three functions now. As a homework assignment, open a python session and fill in the below puzzle to make the assertion pass:

Handy Tools for working with indices:

If you get stuck, see the solution below: