docstr: Register a new model for this class.
  
  Args:
      config_class ([`PretrainedConfig`]):
          The configuration corresponding to the model to register.
      model_class ([`PreTrainedModel`]):
          The model to register.
docstr_tok: ["Register","a","new","model","for","this","class",".","Args",":","config_class","(","[","`","PretrainedConfig","`","]",")",":","The","configuration","corresponding","to","the","model","to","register",".","model_class","(","[","`","PreTrainedModel","`","]",")",":","The","model","to","register","."]
code: def register(cls, config_class, model_class):
      """
      Register a new model for this class.
  
      Args:
          config_class ([`PretrainedConfig`]):
              The configuration corresponding to the model to register.
          model_class ([`PreTrainedModel`]):
              The model to register.
      """
      if (
          hasattr(model_class, "config_class")
          and model_class.config_class != config_class
      ):
          raise ValueError(
              "The model class you are passing has a `config_class` attribute that is not consistent with the "
              f"config class you passed (model has {model_class.config_class} and you passed {config_class}. Fix "
              "one of those so they match!"
          )
      cls._model_mapping.register(config_class, model_class)
  
imports: import importlib
  from collections import OrderedDict
  from ...configuration_utils import PretrainedConfig
  from ...dynamic_module_utils import get_class_from_dynamic_module
  from ...utils import copy_func, logging
  from .configuration_auto import AutoConfig, model_type_to_module_name, replace_list_option_in_docstrings
label_desc: Use image node_id 4 for calling the _BaseAutoModelClass obj's underlying member method code with example usage: obj.register(cls, config_class, model_class) without return types