def METHOD_NAME(self, model_cls, module_args, module_kwargs, checkpoint=None, state_key=None, python_path=None):
    module_parts = model_cls.split(".")
    model_cls = module_parts[-1]
    model_path = ".".join(module_parts[:-1])
    with append_to_path(python_path):
        model_cls = importlib.import_module(model_path).__getattribute__(model_cls)
        module = model_cls(*module_args, **module_kwargs)
        if checkpoint:
            checkpoint = self._torch.load(
                checkpoint, map_location=None if self.cuda else self._torch.device('cpu')
            )
            state = checkpoint if not state_key else checkpoint[state_key]
            if all(key.startswith('module.') for key in state):
                module = self._torch.nn.DataParallel(module)
            module.load_state_dict(state, strict=False)
        module.to(self.device)
        module.eval()
        return module