Note that this only works if the tensor is 1-dimensional. Consider the following 2-dimensional tensor:
In [16]: y
Out[16]:
Variable containing:
 0.8057  0.4009  0.0189
 0.8005  0.0217  0.7259
[torch.FloatTensor of size 2x3]

In [17]: y.data
Out[17]:

 0.8057  0.4009  0.0189
 0.8005  0.0217  0.7259
[torch.FloatTensor of size 2x3]

In [18]: y.data[0]
Out[18]:

 0.8057
 0.4009
 0.0189
[torch.FloatTensor of size 3]