Merge pull request #128 from timctho/master

Fix requires_grad=True needs float tensor
This commit is contained in:
Yunjey Choi
2018-08-07 12:46:30 +09:00
committed by GitHub

View File

@ -23,9 +23,9 @@ import torchvision.transforms as transforms
# ================================================================== #
# Create tensors.
x = torch.tensor(1, requires_grad=True)
w = torch.tensor(2, requires_grad=True)
b = torch.tensor(3, requires_grad=True)
x = torch.tensor(1., requires_grad=True)
w = torch.tensor(2., requires_grad=True)
b = torch.tensor(3., requires_grad=True)
# Build a computational graph.
y = w * x + b # y = 2 * x + 3