MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / __init__

Method __init__

python/oneflow/framework/model.py:587–597  ·  view source on GitHub ↗
(
        self,
        cfg: TrainingConfig = None,
        model: Model = None,
        callbacks: Optional[Union[Callback, List[Callback]]] = None,
    )

Source from the content-addressed store, hash-verified

585
586class TrainModelOOPStyle(SubModel):
587 def __init__(
588 self,
589 cfg: TrainingConfig = None,
590 model: Model = None,
591 callbacks: Optional[Union[Callback, List[Callback]]] = None,
592 ):
593 super().__init__("training", cfg, model, callbacks)
594 if not self._get_and_check_step():
595 self.is_valid = False
596 if not self._get_and_check_opts():
597 self.is_valid = False
598
599 def step(self, step_idx: int = 0):
600 assert self.is_valid, self.error_msg

Callers

nothing calls this directly

Calls 3

_get_and_check_stepMethod · 0.95
_get_and_check_optsMethod · 0.95
__init__Method · 0.45

Tested by

no test coverage detected