title: Can I change volatile = False to torch.set_grad_enabled(True)??(in Pytorch)
body: <p>I have old python codes, so I need to change some parts.</p>
  <pre><code>next_q_values.volatile=False
  </code></pre>
  <p>I have this code, and next_q_values is 'torch.Tensor'</p>
  <p>when I run this code:</p>
  <blockquote>
  <p>error occured: &quot;volatile was removed and now has no effect use with
  torch no_grad instead&quot;</p>
  </blockquote>
  <p>After search, I know that <code>volatile = True</code> is same as <code>torch.no_grad()</code>,
  but I want to use <code>volatile = False</code>, So I can't use <code>torch.no_grad()</code>.</p>
  <p>Can I change <code>volatile = False</code> to <code>torch.set_grad_enabled(True)</code>?</p>