(报错)RuntimeError: expected scalar type Float but found Long
报错代码importtorchdefsynthetic_data(w,b,num_examples):X=torch.normal(0,1,(num_examples,len(w)))y=torch.matmul(X,w)+by+=torch.normal(0,0.01,y.shape)returnX,y.reshape((-1,1))true_w=torch.tensor([2,-3,4])tr