javascript">&gt;&gt;&gt; let a = torch.randn([3,2], true, 'gpu');
&gt;&gt;&gt; console.log(a.data);
//[[0.001, -0.99],
// [-0.13, 0.333]
// [-0.91,-0.044]]
</code></pre>
<p><br></p>
<h2 id="tensorlength">tensor.length</h2>
<p>Returns the tensor's length (size of first dimension).</p>
<p>Example</p>
<pre><code class="language-javascript">&gt;&gt;&gt; let a = torch.randn([3,2], true, 'gpu');
&gt;&gt;&gt; console.log(a.length);
// 3
</code></pre>
<p><br></p>
<h2 id="tensorndims">tensor.ndims</h2>
<p>Returns th