How to Argsort in Tensorflow?
In your case you could probably use top_k
which returns the highest k
values. k
can be a 1D vector defining how many values to 'top' per dimensions. In your case, if you want the second axis set k=[0, 5, 0]
might do it.
tf.nn.top_k(matrix, k=[0,5,0], sorted=True)
I didn't run it tho. Hope this helps