MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / train

Method train

python/paddle/distributed/auto_parallel/api.py:3056–3067  ·  view source on GitHub ↗

Set the DistModel to "train" mode. In "train" mode, executing ``__call__`` method will update the parameters of the model and return the loss.

(self)

Source from the content-addressed store, hash-verified

3054 self.predict()
3055
3056 def train(self) -> None:
3057 """
3058 Set the DistModel to "train" mode. In "train" mode,
3059 executing ``__call__`` method will update the
3060 parameters of the model and return the loss.
3061 """
3062 if not self._engine._has_prepared["train"]:
3063 self._engine._prepare_program(mode="train", init_parameters=False)
3064
3065 self._mode = "train"
3066 self._engine.to_mode("train")
3067 paddle.disable_static()
3068
3069 def eval(self) -> None:
3070 """

Callers 5

__init__Method · 0.95
train_resnetFunction · 0.45
_prepare_trainingMethod · 0.45
_prepare_trainingMethod · 0.45
_prepare_trainingMethod · 0.45

Calls 2

to_modeMethod · 0.80
_prepare_programMethod · 0.45

Tested by 1

train_resnetFunction · 0.36