def save(self, dir_name, epoch):
        """save model to dir

        Parameters
        ----------
        dir_name: str
            name of the directory
        epoch: int
        """
        if not os.path.exists(dir_name):
            os.mkdir(dir_name)
        dir_name = os.path.join(dir_name, self.name, )
        if not os.path.exists(dir_name):
            os.mkdir(dir_name)
        pre = os.path.join(dir_name, self.subclass_name)
        self.model.save_checkpoint(pre, epoch, save_optimizer_states=True)
save model to dir

        Parameters
        ----------
        dir_name: str
            name of the directory
        epoch: int
        
python/magent/builtin/mx_model/base.py