import torch
x = torch.tensor(data=[2.0, 3.0], requires_grad=True)
y = x ** 2
z = 2 * y + 3
target = torch.tensor([3.0, 4.0])
loss = torch.sum(torch.abs(z - target))
loss.backward()
print(x.grad, y.grad, z.grad)

0139caf8414470cf4f3e7ffa0cde6096bde42057
<mask token>

<mask token>
loss.backward()
print(x.grad, y.grad, z.grad)

<mask token>
x = torch.tensor(data=[2.0, 3.0], requires_grad=True)
y = x ** 2
z = 2 * y + 3
target = torch.tensor([3.0, 4.0])
loss = torch.sum(torch.abs(z - target))
loss.backward()
print(x.grad, y.grad, z.grad)

import torch
x = torch.tensor(data=[2.0, 3.0], requires_grad=True)
y = x ** 2
z = 2 * y + 3
target = torch.tensor([3.0, 4.0])
loss = torch.sum(torch.abs(z - target))
loss.backward()
print(x.grad, y.grad, z.grad)
