



import copy

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


__A      		=     logging.get_logger(__name__)



class   lowercase_   (  __a					):
      UpperCamelCase_      :		List[Any]										=    """upernet"""



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

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

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







      def 						UpperCamelCase_		(      self				:    Tuple		)   ->					Dict:
        _snake_case						=							copy.deepcopy(self.__dict__		)
        _snake_case						=							self.backbone_config.to_dict()
        _snake_case						=							self.__class__.model_type
        return output




# Copyright 2023 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import TYPE_CHECKING

# rely on isort to merge the imports
from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available


__A      		=     {'''configuration_mra''': ['''MRA_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''MraConfig''']}

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 __A      		=     [
     '''MRA_PRETRAINED_MODEL_ARCHIVE_LIST''',
     '''MraForMaskedLM''',
     '''MraForMultipleChoice''',
     '''MraForQuestionAnswering''',
     '''MraForSequenceClassification''',
     '''MraForTokenClassification''',
     '''MraLayer''',
     '''MraModel''',
     '''MraPreTrainedModel''',
 ]


if TYPE_CHECKING:
 from .configuration_mra import MRA_PRETRAINED_CONFIG_ARCHIVE_MAP, MraConfig

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_mra import (
      MRA_PRETRAINED_MODEL_ARCHIVE_LIST,
      MraForMaskedLM,
      MraForMultipleChoice,
      MraForQuestionAnswering,
      MraForSequenceClassification,
      MraForTokenClassification,
      MraLayer,
      MraModel,
      MraPreTrainedModel,
  )
else:
 import sys

 __A      		=     _LazyModule(__name__, globals()['''__file__'''], _import_structure)

