一、方法1 autograd import torch from torch import autograd ''' demo1 ''' x = torch.tensor(1.) a = torch.tensor(1., requires_grad=