title: PyTorch set_grad_enabled(False) vs with no_grad():
body: <p>Assuming autograd is on (as it is by default), is there any difference (besides  indent) between doing:</p>
  
  <pre><code>with torch.no_grad():
      &lt;code&gt;
  </code></pre>
  
  <p>and </p>
  
  <pre><code>torch.set_grad_enabled(False)
  &lt;code&gt;
  torch.set_grad_enabled(True)
  </code></pre>