title: tf.nn.softmax_cross_entropy_with_logits is giving wrong output. Why?
body: <p>I want to calculate cross entropy function with the following command. This command first apply sofmax to the logits and then apply cross entropy function. According to the formula of cross entropy sum(b*loga) where b is correct label and a is the predicted label.  Since sum is taken over all classes in cross entropy formula so I expect that the multiplication goes on like this. If after the sofmax operation output is</p>
  
  <pre><code> [0.45186275  0.27406862  0.27406862]
  </code></pre>
  
  <p>Now if I apply cross entropy it should be like this     </p>
  
  <pre><code> ( 1 * log 0.45186275 + 0 * log 0.27406862 + 0 * log 0.27406862 ) 
  </code></pre>
  
  <p>My output is 0.794377 but I'm expecting a different </p>
  
  <pre><code>a = tf.constant([0.9,0.4,0.4])
  b = tf.constant([1,0,0])
  result =  tf.nn.softmax_cross_entropy_with_logits(logits=a,labels=b)
  sess = tf.InteractiveSession()
  sess.run(tf.initialize_all_variables())
  print result.eval()
  </code></pre>