def load(self, model_file, save_dir, verbose=True):
if not os.path.exists(save_dir):<EOL><INDENT>self.logger.error("<STR_LIT>")<EOL><DEDENT>try:<EOL><INDENT>checkpoint = torch.load(f"<STR_LIT>")<EOL><DEDENT>except BaseException:<EOL><INDENT>self.logger.error(<EOL>f"<STR_LIT>"<EOL>)<EOL><DEDENT>self.load_state_dict(checkpoint["<STR_LIT>"])<EOL>self.settings = checkpoint["<STR_LIT>"]<EOL>self.cardinality = checkpoint["<STR_LIT>"]<EOL>self.name = checkpoint["<STR_LIT:name>"]<EOL>if verbose:<EOL><INDENT>self.logger.info(<EOL>f"<STR_LIT>"<EOL>)<EOL><DEDENT>
Load model from file and rebuild the model.

        :param model_file: Saved model file name.
        :type model_file: str
        :param save_dir: Saved model directory.
        :type save_dir: str
        :param verbose: Print log or not
        :type verbose: bool