class_docstr: Base class for configuration classes that need to respect the same API than PretrainedConfig but with a different
  configuration file name.
class_docstr_tok: ["Base","class","for","configuration","classes","that","need","to","respect","the","same","API","than","PretrainedConfig","but","with","a","different","configuration","file","name","."]
docstr: Serializes this instance to a Python dictionary.
  
  Returns:
      `Dict[str, Any]`: Dictionary of all the attributes that make up this configuration instance.
docstr_tok: ["Serializes","this","instance","to","a","Python","dictionary",".","Returns",":","`","Dict","[","str",",","Any","]","`",":","Dictionary","of","all","the","attributes","that","make","up","this","configuration","instance","."]
code: def to_dict(self) -> Dict[str, Any]:
      """
      Serializes this instance to a Python dictionary.
  
      Returns:
          `Dict[str, Any]`: Dictionary of all the attributes that make up this configuration instance.
      """
      output = copy.deepcopy(self.__dict__)
      if hasattr(self.__class__, "model_type"):
          output["model_type"] = self.__class__.model_type
      if "_auto_class" in output:
          del output["_auto_class"]
      if "_commit_hash" in output:
          del output["_commit_hash"]
  
      # Transformers version when serializing the model
      output["transformers_version"] = transformers_version_str
      output["optimum_version"] = __version__
  
      self.dict_torch_dtype_to_str(output)
  
      return output
  
imports: import copy
  import json
  import os
  import re
  from typing import Any, Dict, List, Tuple, Union
  from huggingface_hub import HfFolder
  from packaging import version
  from transformers import PretrainedConfig
  from transformers import __version__
  from .utils import logging
  from .version import __version__
label_desc: Use image node_id 7 for calling the BaseConfig obj's underlying member method code with example usage: obj.to_dict() and returns: output