print(x.grad)6. Grad x=torch.tensor([3.0], requires_grad=True) y = torch.pow(x, 2) grad_1 = torch.autograd.grad(y, x, create_graph=True)
確定! 回上一頁