| 44 | |
| 45 | |
| 46 | class DummyModel(TorchModel): |
| 47 | |
| 48 | def __init__(self): |
| 49 | super().__init__() |
| 50 | self.linear = nn.Linear(5, 4) |
| 51 | self.bn = nn.BatchNorm1d(4) |
| 52 | |
| 53 | def forward(self, feat, labels): |
| 54 | x = self.linear(feat) |
| 55 | |
| 56 | x = self.bn(x) |
| 57 | loss = torch.sum(x) |
| 58 | return dict(logits=x, loss=loss) |
| 59 | |
| 60 | |
| 61 | @TRAINERS.register_module(module_name='test_vis') |
no outgoing calls
searching dependent graphs…