title: How to get data from 2D tensor?
body: <p>I would like to get the data from a 2D tensor with <a href="https://js.tensorflow.org/" rel="nofollow noreferrer">tensorflow.js</a>. I tried to use the <code>data()</code> method like this:</p>
  
  <pre><code>const X = tf.tensor2d([[1, 2, 3, 4], [2, 2, 5, 3]]);
  X.data().then(X =&gt; console.log(X)};
  </code></pre>
  
  <p>But the result is a flatten 1D array:</p>
  
  <pre><code>Float32Array(8) [1, 2, 3, 4, 2, 2, 5, 3]
  </code></pre>
  
  <p>Is there a way to keep the shape of the array?</p>