比如下面这个pytorch的例子. import torch x = torch.tensor([1.0, 2.0, 3.0], requires_grad=True) y = x ** 2 + 2 z = torch.sum(y) z.backward() print(x…
確定! 回上一頁