MCPcopy
hub / github.com/pytorch/vision / TestModel

Class TestModel

test/test_backbone_utils.py:228–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

226
227 def test_train_eval(self):
228 class TestModel(torch.nn.Module):
229 def __init__(self):
230 super().__init__()
231 self.dropout = torch.nn.Dropout(p=1.0)
232
233 def forward(self, x):
234 x = x.float().mean()
235 x = self.dropout(x) # dropout
236 if self.training:
237 x += 100 # add
238 else:
239 x *= 0 # mul
240 x -= 0 # sub
241 return x
242
243 model = TestModel()
244

Callers 1

test_train_evalMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_train_evalMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…