We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 9219526 + 2bfebb0 commit 6fe5ff5Copy full SHA for 6fe5ff5
tutorials/01-basics/pytorch_basics/main.py
@@ -23,9 +23,9 @@
23
# ================================================================== #
24
25
# Create tensors.
26
-x = torch.tensor(1, requires_grad=True)
27
-w = torch.tensor(2, requires_grad=True)
28
-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)
29
30
# Build a computational graph.
31
y = w * x + b # y = 2 * x + 3
0 commit comments