(self)
| 192 | |
| 193 | class ModuleSimpleTrain(torch.nn.Module): |
| 194 | def __init__(self): |
| 195 | super().__init__() |
| 196 | self.linear = torch.nn.Linear(3, 3) |
| 197 | self.loss = torch.nn.CrossEntropyLoss() |
| 198 | |
| 199 | def forward(self, x, y): |
| 200 | return self.loss(self.linear(x).softmax(dim=0), y) |