title: The purpose of introducing nn.Parameter in pytorch
body: <p>I am new to Pytorch and I am confused about the difference between <code>nn.Parameter</code>  and <code>autograd.Variable</code>. I know that the former one is the subclass of <code>Variable</code> and has the gradient. But I really don't understand why we introduce <code>Parameter</code> and when we should use it?</p>
  
  <hr>
  
  <p><strong>SUMMARY</strong>:</p>
  
  <p>Thanks for the explanation of iacolippo, i finally understand the difference between <code>parameter</code> and <code>variable</code>. In a summary, <code>variable</code> in pytorch is NOT same as in  the <code>variable</code> in tensorflow, the former one is not attach to the model's trainable parameters while the later one will. Attaching to the model means that using <code>model.parameters()</code> will return the certain parameter to you, which is useful in training phase to specify the variable needed to train. The 'variable' is more helpful as a cache in some network.</p>