title: What is the difference between sample() and rsample()?
body: <p>When I sample from a distribution in PyTorch, both <code>sample</code> and <code>rsample</code> appear to give similar results:</p>
  <pre><code>import torch, seaborn as sns
  
  x = torch.distributions.Normal(torch.tensor([0.0]), torch.tensor([1.0]))
  </code></pre>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th><a href="https://i.stack.imgur.com/pLWO1.png" rel="noreferrer"><img src="https://i.stack.imgur.com/pLWO1.png" alt="enter image description here" /></a></th>
  <th><a href="https://i.stack.imgur.com/pYJsI.png" rel="noreferrer"><img src="https://i.stack.imgur.com/pYJsI.png" alt="enter image description here" /></a></th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td><code>sns.distplot(x.sample((100000,)))</code></td>
  <td><code>sns.distplot(x.rsample((100000,)))</code></td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>When should I use <code>sample()</code>, and when should I use <code>rsample()</code>?</p>