Skip to content

Commit 538ba18

Browse files
authored
Merge pull request #27 from AyushExel/patch-2
Remove deprecated code
2 parents de563d7 + e19eb5d commit 538ba18

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tutorial-contents/301_regression.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
y = x.pow(2) + 0.2*torch.rand(x.size()) # noisy y data (tensor), shape=(100, 1)
1818

1919
# torch can only train on Variable, so convert them to Variable
20-
x, y = Variable(x), Variable(y)
21-
20+
#x, y = Variable(x), Variable(y)
21+
#The above code is depricated. Now,autograd directly supports tensors
2222
# plt.scatter(x.data.numpy(), y.data.numpy())
2323
# plt.show()
2424

@@ -60,4 +60,4 @@ def forward(self, x):
6060
plt.pause(0.1)
6161

6262
plt.ioff()
63-
plt.show()
63+
plt.show()

0 commit comments

Comments
 (0)