MCPcopy Create free account
hub / github.com/pytorch/pytorch / EvalModeForLoadedModule

Class EvalModeForLoadedModule

test/cpp/jit/tests_setup.py:23–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21
22
23class EvalModeForLoadedModule(FileSetup):
24 path = 'dropout_model.pt'
25
26 def setup(self):
27 class Model(torch.jit.ScriptModule):
28 def __init__(self):
29 super().__init__()
30 self.dropout = torch.nn.Dropout(0.1)
31
32 @torch.jit.script_method
33 def forward(self, x):
34 x = self.dropout(x)
35 return x
36
37 model = Model()
38 model = model.train()
39 model.save(self.path)
40
41
42class SerializationInterop(FileSetup):

Callers 1

tests_setup.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…