Сегодня я узнал, что tf.gather()
делает это.
tf.gather(x, tf.argmax(x, axis=0))
<tf.Tensor: shape=(4, 4), dtype=float32, numpy=
array([[ 1.8891758 , 0.7073202 , -0.78521085, -2.7632885 ],
[-1.3851309 , 1.4023514 , -0.9735394 , -0.81982684],
[-0.22595228, -0.7155944 , 0.37807527, 2.2081604 ],
[-0.22595228, -0.7155944 , 0.37807527, 2.2081604 ]],
dtype=float32)>