def METHOD_NAME(trainer) -> None:
    if hasattr(trainer.model, "module"):
        if hasattr(trainer.model.module, "on_epoch_start"):
            trainer.model.module.METHOD_NAME(trainer)
    else:
        if hasattr(trainer.model, "on_epoch_start"):
            trainer.model.METHOD_NAME(trainer)
    if hasattr(trainer.criterion, "on_epoch_start"):
        trainer.criterion.METHOD_NAME(trainer)
    if hasattr(trainer.optimizer, "on_epoch_start"):
        trainer.optimizer.METHOD_NAME(trainer)