MCPcopy Create free account
hub / github.com/Sense-X/Co-DETR / ExampleModel

Class ExampleModel

tests/test_runtime/test_eval_hook.py:45–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43
44
45class ExampleModel(nn.Module):
46
47 def __init__(self):
48 super().__init__()
49 self.conv = nn.Linear(1, 1)
50 self.test_cfg = None
51
52 def forward(self, imgs, rescale=False, return_loss=False):
53 return imgs
54
55 def train_step(self, data_batch, optimizer, **kwargs):
56 outputs = {
57 'loss': 0.5,
58 'log_vars': {
59 'accuracy': 0.98
60 },
61 'num_samples': 1
62 }
63 return outputs
64
65
66@pytest.mark.skipif(

Callers 1

test_eval_hookFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_eval_hookFunction · 0.68