def __init__(self, *, before_train=None, after_train=None, before_step=None, after_step=None):
        """
        Each argument is a function that takes one argument: the trainer.
        """
        self._before_train = before_train
        self._before_step = before_step
        self._after_step = after_step
        self._after_train = after_train

        Each argument is a function that takes one argument: the trainer.
        
video_chat_with_MOSS/models/grit_src/third_party/CenterNet2/detectron2/engine/hooks.py