Merge pull request #27 from AyushExel/patch-2

Remove deprecated code
This commit is contained in:
Morvan
2018-05-30 00:32:22 +08:00
committed by GitHub

View File

@ -17,8 +17,8 @@ x = torch.unsqueeze(torch.linspace(-1, 1, 100), dim=1) # x data (tensor), shape
y = x.pow(2) + 0.2*torch.rand(x.size()) # noisy y data (tensor), shape=(100, 1)
# torch can only train on Variable, so convert them to Variable
x, y = Variable(x), Variable(y)
#x, y = Variable(x), Variable(y)
#The above code is depricated. Now,autograd directly supports tensors
# plt.scatter(x.data.numpy(), y.data.numpy())
# plt.show()