MCPcopy Create free account
hub / github.com/modelscope/modelscope / DummyModel

Class DummyModel

tests/trainers/test_trainer.py:46–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44
45
46class 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')

Calls

no outgoing calls

Tested by 6

test_train_0Method · 0.56
test_train_1Method · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…