MCPcopy Index your code
hub / github.com/apple/ml-pointersect / _set_eval_mode

Method _set_eval_mode

cdslib/core/script/base_train.py:637–645  ·  view source on GitHub ↗

Set all the nn.modules to evaluation mode.

(self)

Source from the content-addressed store, hash-verified

635 v.train()
636
637 def _set_eval_mode(self):
638 """Set all the nn.modules to evaluation mode."""
639 vs = inspect.getmembers(self, lambda v: isinstance(v, BaseModel))
640 for v_name, v in vs:
641 v.eval()
642
643 vs = inspect.getmembers(self, lambda v: isinstance(v, torch.nn.Module))
644 for v_name, v in vs:
645 v.eval()
646
647 def load(self, filename: str, device: torch.device = torch.device("cpu")):
648 """

Callers 1

runMethod · 0.95

Calls 1

evalMethod · 0.80

Tested by

no test coverage detected