day2 自动求梯度 理解pytorch 自动求梯度机制以及相关的操作,主要是以例子说明 创建一个Tensor并设置requires_grad=True import torch x=torch.ones(2,2,requires_grad=True) #跟踪tensor的操作 print(x) print(x.grad_fn