Learn practical skills, build real-world projects, and advance your career
import torch
# Create tensors.
x = torch.tensor(3.)
w = torch.tensor(4., requires_grad=True)
b = torch.tensor(5., requires_grad=True)
x, w, b
(tensor(3.), tensor(4., requires_grad=True), tensor(5., requires_grad=True))
# Arithmetic operations
y = w * x + b
y
tensor(17., grad_fn=<AddBackward0>)
# Arithmetic operations
y = w * x + b
y
tensor(17., grad_fn=<AddBackward0>)
# Compute derivatives
y.backward()