e number of dimensions in the Tensor.</p>
<p>Example</p>
<pre><code class="language-javascript">&gt;&gt;&gt; let a = torch.randn([3,2,1,4], true, 'gpu');
&gt;&gt;&gt; console.log(a.ndims);
// 4
</code></pre>
<p><br></p>
<h2 id="tensorgrad">tensor.grad</h2>
<p>Returns the gradients currently stored in the Tensor.</p>
<p>Example</p>
<pre><code class="language-javascript">&gt;&gt;&gt; let a = torch.randn([3,2], true, 'gpu');
&gt;&gt;&gt; let b = torch.randn([2,4], true, 'gpu');
&gt;&gt;&gt; let c = torch.matmu