import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ..auto.configuration_auto import CONFIG_MAPPING


a_							=      logging.get_logger(__name__)


class 			UpperCAmelCase__    (		snake_case					):



  """simple docstring"""






  lowerCAmelCase__		:	Union[str, Any]    		= 'upernet'






  def __init__(				self:			Optional[int]				,				__lowerCAmelCase:			str=None				,				__lowerCAmelCase:			Union[str, Any]=512				,				__lowerCAmelCase:			Optional[int]=0.02				,				__lowerCAmelCase:			str=[1, 2, 3, 6]				,				__lowerCAmelCase:			List[str]=True				,				__lowerCAmelCase:			Optional[int]=0.4				,				__lowerCAmelCase:			Optional[Any]=384				,				__lowerCAmelCase:			int=256				,				__lowerCAmelCase:			int=1				,				__lowerCAmelCase:			str=False				,				__lowerCAmelCase:			Dict=255				,				**__lowerCAmelCase:			Tuple				,				) -> List[str]:




    '''simple docstring'''




    super().__init__(**__lowerCAmelCase   )

    if backbone_config is None:
      logger.info("`backbone_config` is `None`. Initializing the config with the default `ResNet` backbone."   )
      __UpperCAmelCase						    =       CONFIG_MAPPING["resnet"](out_features=["stage1", "stage2", "stage3", "stage4"]   )
    elif isinstance(__lowerCAmelCase				,				__lowerCAmelCase   ):
      __UpperCAmelCase						    =       backbone_config.get("model_type"   )
      __UpperCAmelCase						    =       CONFIG_MAPPING[backbone_model_type]
      __UpperCAmelCase						    =       config_class.from_dict(__lowerCAmelCase   )

    __UpperCAmelCase						    =       backbone_config
    __UpperCAmelCase						    =       hidden_size
    __UpperCAmelCase						    =       initializer_range
    __UpperCAmelCase						    =       pool_scales
    __UpperCAmelCase						    =       use_auxiliary_head
    __UpperCAmelCase						    =       auxiliary_loss_weight
    __UpperCAmelCase						    =       auxiliary_in_channels
    __UpperCAmelCase						    =       auxiliary_channels
    __UpperCAmelCase						    =       auxiliary_num_convs
    __UpperCAmelCase						    =       auxiliary_concat_input
    __UpperCAmelCase						    =       loss_ignore_index






  def 	_UpperCAmelCase				(				self:			Optional[Any]   ) -> Optional[int]:




    '''simple docstring'''




    __UpperCAmelCase						    =       copy.deepcopy(self.__dict__   )
    __UpperCAmelCase						    =       self.backbone_config.to_dict()
    __UpperCAmelCase						    =       self.__class__.model_type
    return output




from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available


a_							=      {
    """configuration_squeezebert""": [
        """SQUEEZEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """SqueezeBertConfig""",
        """SqueezeBertOnnxConfig""",
    ],
    """tokenization_squeezebert""": ["""SqueezeBertTokenizer"""],
}

try:
       if not is_tokenizers_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       a_							=      ["""SqueezeBertTokenizerFast"""]

try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       a_							=      [
           """SQUEEZEBERT_PRETRAINED_MODEL_ARCHIVE_LIST""",
           """SqueezeBertForMaskedLM""",
           """SqueezeBertForMultipleChoice""",
           """SqueezeBertForQuestionAnswering""",
           """SqueezeBertForSequenceClassification""",
           """SqueezeBertForTokenClassification""",
           """SqueezeBertModel""",
           """SqueezeBertModule""",
           """SqueezeBertPreTrainedModel""",
       ]


if TYPE_CHECKING:
       from .configuration_squeezebert import (
           SQUEEZEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP,
           SqueezeBertConfig,
           SqueezeBertOnnxConfig,
       )
       from .tokenization_squeezebert import SqueezeBertTokenizer

       try:
              if not is_tokenizers_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .tokenization_squeezebert_fast import SqueezeBertTokenizerFast

       try:
              if not is_torch_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_squeezebert import (
                  SQUEEZEBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
                  SqueezeBertForMaskedLM,
                  SqueezeBertForMultipleChoice,
                  SqueezeBertForQuestionAnswering,
                  SqueezeBertForSequenceClassification,
                  SqueezeBertForTokenClassification,
                  SqueezeBertModel,
                  SqueezeBertModule,
                  SqueezeBertPreTrainedModel,
              )

else:
       import sys

       a_							=      _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)



