title: Pytorch: Can't call numpy() on Variable that requires grad. Use var.detach().numpy() instead
body: <p>Calling <code>tensor.numpy()</code> gives the error:</p>
  <blockquote>
  <p>RuntimeError: Can't call numpy() on Variable that requires grad. Use var.detach().numpy() instead.</p>
  </blockquote>
  <p><code>tensor.cpu().detach().numpy()</code> gives the same error.</p>