title: How convert output tensor to one-hot tensor?
body: <p>I need to calculate loss from the softmax output vs target.
  My target is like [0,0,1] and output is [0.3,0.3,0.4]
  For the purpose, prediction is correct. But a cost function of below type doesn't account for this kind of accuracy</p>
  
  <pre><code>self._output = output = tf.nn.softmax(y)
  self._cost = cost = tf.reduce_mean(tf.square( output - tf.reshape(self._targets, [-1])))
  </code></pre>
  
  <p>How can I easily convert the output [0.3,0.3,0.4] to [0,0,1] in TF itself?</p>