title: tf.diag of a 2D matrix
body: <p>I have a 2D tensor with various arrays defined as:</p>
  
  <pre><code>x = tf.constant([[0,1,2],[-1,0,1],[-1,-2,0]])
  </code></pre>
  
  <p>and I want to convert each array to a diagonal matrix as:</p>
  
  <pre><code>diag_x =
  [[[ 0,  0,  0],
    [ 0,  1,  0],
    [ 0,  0,  2]],
   [[-1,  0,  0],
    [ 0,  0,  0],
    [ 0,  0,  1]],
   [[-2,  0,  0],
    [ 0, -1,  0],
    [ 0,  0,  0]]]
  </code></pre>
  
  <p>but if I use the operation <em>tf.diag(x)</em> the output is not this.</p>