RuntimeError: Found dtype Double but expected Float
RuntimeError: Found dtype Double but expected Float在写 Logistic回归的代码时 的报错说明此时需要float型数据,但识别到double型数据,此时需要做一下类型转换原: # 训练模型 out = logistic_model(x) loss = criterion(out, y)修改: x = x.to(torch.float32) y = y.to(torch.float32) out = logistic_mo