pytorch多损失回传案例
一个输入两个输出的全连接网络import torchimport torch.nn as nnimport torch.nn.functional as Fclass LinearNet(nn.Module): def __init__(self): super(LinearNet, self).__init__() self.fc1 = nn.Linear(5, 4) self.fc2 = nn.Linear(4, 3) .