import torch
import math
x0 = torch.tensor(2.00,requires_grad=True)
w0 = torch.tensor(-1.00,requires_grad=True)
x1 = torch.tensor(-2.00,requires_grad=True)
w1 = torch.tensor(-3.00,requires_grad=True)
w2 = torch.tensor(-3.00,requires_grad=True)
y0 = w0 * x0
y1 = x1 * w1
z0 = y0 + y1
z1 = z0 + w2
z2 = z1 * -1
z3 = math.exp(z2)
z4 = z3 + 1
z5 = 1/z4
print(y0)
print(y1)
print(z0)
print(z1)
print(z2)
print(z3)
print(z4)
print(z5)
z5.backward()
print(w0.grad)
print(x0.grad)
print(w1.grad)
print(x1.grad)
print(w2.grad)
print(y0.grad)
print(y1.grad)
print(z0.grad)
print(z1.grad)
print(z2.grad)
print(z3.grad)
print(z4.grad)
print(z5.grad)
有大佬知道应该怎么改吗?