import torch import torch.nn.functional as F import matplotlib.pyplot as plt # torch.manual_seed(1) # reproducible x = torch.unsqueeze(torch.linspace(-1, 1, 100), dim=1) # 将1维数据转换成2维数据,torch不能处理1维数据.x data (tensor), shape=(100, 1) y = x.pow(2) + 0.2*…