# Should not variables be passed instead of tensors in the examples given in documentation

**URL:** <https://discuss.pytorch.org/t/should-not-variables-be-passed-instead-of-tensors-in-the-examples-given-in-documentation/18761>\
**Category:** Uncategorized\
**Created:** [May 28, 2018, 9:07am UTC](https://discuss.pytorch.org/t/should-not-variables-be-passed-instead-of-tensors-in-the-examples-given-in-documentation/18761 "2018-05-28T09:07:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![smujjiga](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/smujjiga/32/27996_2.png) [@smujjiga](https://discuss.pytorch.org/u/smujjiga)\
**Post date:** [May 28, 2018, 9:07am UTC](https://discuss.pytorch.org/t/should-not-variables-be-passed-instead-of-tensors-in-the-examples-given-in-documentation/18761/1 "2018-05-28T09:07:03Z")

</div>

Should not variables be passed instead of tensors in the examples given in documentation. For example the example given for LSTM on page [torch.nn — PyTorch master documentation](https://pytorch.org/docs/master/nn.html?highlight=lstm#torch.nn.LSTM) is

> > > rnn = nn.LSTM(10, 20, 2)  
> > > input = torch.randn(5, 3, 10)  
> > > h0 = torch.randn(2, 3, 20)  
> > > c0 = torch.randn(2, 3, 20)  
> > > output, (hn, cn) = rnn(input, (h0, c0))

Should not be it

> > > rnn = nn.LSTM(10, 20, 2)  
> > > input = Variable(torch.randn(5, 3, 10))  
> > > h0 = Variable(torch.randn(2, 3, 20))  
> > > c0 = Variable(torch.randn(2, 3, 20))  
> > > output, (hn, cn) = rnn(input, (h0, c0))

---

<div class="post-metadata">

**Author:** ![thadar](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/t/ea5d25/32.png) [@thadar](https://discuss.pytorch.org/u/thadar)\
**Post date:** [May 28, 2018, 9:57am UTC](https://discuss.pytorch.org/t/should-not-variables-be-passed-instead-of-tensors-in-the-examples-given-in-documentation/18761/2 "2018-05-28T09:57:40Z")

</div>

Hi,  
Since pytorch 0.4 was released, Variables and Tensors were merged that’s why it should not be using Variable.  
The documentation is for pytorch 0.5 unstable developer docs
