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

Method is_training

torch/_dynamo/variables/nn_module.py:133–135  ·  view source on GitHub ↗
(self, tx)

Source from the content-addressed store, hash-verified

131 return variables.ConstantVariable.create(result)
132
133 def is_training(self, tx):
134 mod = tx.output.get_submodule(self.module_key)
135 return getattr(mod, "training", False)
136
137 def convert_to_unspecialized(self, tx):
138 """Restart analysis treating this module as an UnspecializedNNModuleVariable"""

Callers 1

visitMethod · 0.80

Calls 1

get_submoduleMethod · 0.45

Tested by

no test coverage detected