Set the DistModel to "train" mode. In "train" mode, executing ``__call__`` method will update the parameters of the model and return the loss.
(self)
| 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 | """ |