How can I get the max value and corresponding index of a tensor simultaneously in Tensorflow?
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.