MCPcopy Create free account
hub / github.com/NVlabs/SegFormer / ExampleModel

Class ExampleModel

tests/test_eval_hook.py:26–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24
25
26class ExampleModel(nn.Module):
27
28 def __init__(self):
29 super(ExampleModel, self).__init__()
30 self.test_cfg = None
31 self.conv = nn.Conv2d(3, 3, 3)
32
33 def forward(self, img, img_metas, test_mode=False, **kwargs):
34 return img
35
36 def train_step(self, data_batch, optimizer):
37 loss = self.forward(**data_batch)
38 return dict(loss=loss)
39
40
41def test_iter_eval_hook():

Callers 4

test_iter_eval_hookFunction · 0.85
test_epoch_eval_hookFunction · 0.85
test_dist_eval_hookFunction · 0.85

Calls

no outgoing calls

Tested by 4

test_iter_eval_hookFunction · 0.68
test_epoch_eval_hookFunction · 0.68
test_dist_eval_hookFunction · 0.68