title: reduce_sum by certain dimension
body: <p>I have two embeddings tensor <code>A</code> and <code>B</code>, which looks like</p>
  
  <pre><code>[
    [1,1,1],
    [1,1,1]
  ]
  </code></pre>
  
  <p>and </p>
  
  <pre><code>[
    [0,0,0],
    [1,1,1]
  ]
  </code></pre>
  
  <p>what I want to do is calculate the L2 distance <code>d(A,B)</code> element-wise. </p>
  
  <p>First I did a <code>tf.square(tf.sub(lhs, rhs))</code> to get</p>
  
  <pre><code>[
    [1,1,1],
    [0,0,0]
  ]
  </code></pre>
  
  <p>and then I want to do an element-wise reduce which returns </p>
  
  <pre><code>[
    3,
    0
  ]
  </code></pre>
  
  <p>but <code>tf.reduce_sum</code> does not allow my to reduce by row. Any inputs would be appreciated. Thanks.</p>