How can I get the max value and corresponding index of a tensor simultaneously in Tensorflow? The only way I came out is using tf.argmax with tf.reduce_max. But I'm afraid of that it may be inefficient to find the max value twice.
Before you worry about performance, I'd recommend profiling it. Finding the maximum is an inexpensive operation. Also, can you index into the element using the return value of argmax? That way you'd only take the max once.