a model, to set the model up for the next iteration.</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.matmul(a,b);
&gt;&gt;&gt; c.backward();
&gt;&gt;&gt; console.log(a.grad);
//[[0.001, -0.99],
// [-0.13, 0.333]
// [-0.91,-0.044]]
&gt;&gt;&gt; c.zero_grad_graph(); // Clears gradients of c, b, and a.
&gt;&gt;&gt; console.log(a.grad);
//[[0, 0],
// [0, 0]
// [0, 0]]
