y = tf.constant([[1, 2, 3], [6, 5, 4]])
flat_y = tf.reshape(y, [-1])
flat_ind_max = ind_max + tf.cast(tf.range(tf.shape(y)[0]) * tf.shape(y)[1],
    tf.int64)
y_ = tf.gather(flat_y, flat_ind_max)
print(sess.run(y_))
TensorFlow: Max of a tensor along an axis