def set_mode(self, mode):
        """Sets the `train/val` mode for all models."""
        self.mode = mode
        for name in self.models:
            self.set_model_mode(name, mode)
Sets the `train/val` mode for all models.
runners/base_runner.py