How to convert Pytorch autograd.Variable to Numpy? : <p>The title says it all. I want to convert a <code>PyTorch autograd.Variable</code> to its equivalent <code>numpy</code> array. In their <a href="http://pytorch.org/tutorials/beginner/former_torchies/tensor_tutorial.html" rel="noreferrer">official documentation</a> they advocated using <code>a.numpy()</code> to get the equivalent <code>numpy</code> array (for <code>PyTorch tensor</code>). But this gives me the following error:</p>

<blockquote>
  <p>Traceback (most recent call last): File "stdin", line 1, in module
  File
  "/home/bishwajit/anaconda3/lib/python3.6/site-packages/torch/autograd/variable.py",
  line 63, in <strong>getattr</strong>    raise AttributeError(name) AttributeError:
  numpy</p>
</blockquote>

<p>Is there any way I can circumvent this?</p>
