
&gt;&gt;&gt; console.log(a.data);
//[[0, 0],
// [0, 0]
// [0, 0]]
</code></pre>
<p><br></p>
<h2 id="torchones">torch.ones</h2>
<pre><code>torch.ones(*shape,
            requires_grad=false,
            device='cpu') → Tensor
</code></pre>
<p>Returns a tensor filled with ones with dimensions like <code>shape</code>.</p>
<p>Parameters</p>
<ul>
<li><strong>shape (Array)</strong> - Javascript Array containing the shape of the Tensor.</li>
<li><strong>requires_grad (boolean)</strong> - Whether to keep track o