"""simple docstring"""






from collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


__lowerCAmelCase       :			int   	=logging.get_logger(__name__)

__lowerCAmelCase       :			Any   	={
    """microsoft/resnet-50""": """https://huggingface.co/microsoft/resnet-50/blob/main/config.json""",
}





class 					_A		(			lowerCAmelCase    ,       lowerCAmelCase      ):
      snake_case__     :  Union[str, Any]				    =      'resnet'
      snake_case__     :  Union[str, Any]				    =      ['basic', 'bottleneck']

      def __init__(		self						,			__lowerCAmelCase=3						,			__lowerCAmelCase=64						,			__lowerCAmelCase=[256, 512, 1024, 2048]						,			__lowerCAmelCase=[3, 4, 6, 3]						,			__lowerCAmelCase="bottleneck"						,			__lowerCAmelCase="relu"						,			__lowerCAmelCase=False						,			__lowerCAmelCase=None						,			__lowerCAmelCase=None						,			**__lowerCAmelCase						,			):







            """simple docstring"""



            super().__init__(**__lowerCAmelCase		)
            if layer_type not in self.layer_types:
                  raise ValueError(f'layer_type={layer_type} is not one of {",".join(self.layer_types		)}'		)
            lowercase								=      num_channels
            lowercase								=      embedding_size
            lowercase								=      hidden_sizes
            lowercase								=      depths
            lowercase								=      layer_type
            lowercase								=      hidden_act
            lowercase								=      downsample_in_first_stage
            lowercase								=      ["""stem"""] + [f'stage{idx}' for idx in range(1						,			len(__lowerCAmelCase		) + 1		)]
            lowercase				,				lowercase								=      get_aligned_output_features_output_indices(
                out_features=__lowerCAmelCase						,			out_indices=__lowerCAmelCase						,			stage_names=self.stage_names		)






class 					_A		(			lowerCAmelCase      ):
      snake_case__     :  Optional[int]				    =      version.parse('1.11'      )

      @property
      def 							A__			(		self		):







            """simple docstring"""



            return OrderedDict(
                [
                    ("""pixel_values""", {0: """batch""", 1: """num_channels""", 2: """height""", 3: """width"""}),
                ]		)







      @property
      def 							A__			(		self		):







            """simple docstring"""



            return 1E-3




"""simple docstring"""






from ...configuration_utils import PretrainedConfig
from ...utils import logging


__lowerCAmelCase       :			int   	=logging.get_logger(__name__)

__lowerCAmelCase       :			Optional[Any]   	={
    """uw-madison/mra-base-512-4""": """https://huggingface.co/uw-madison/mra-base-512-4/resolve/main/config.json""",
}





class 					_A		(			lowerCAmelCase      ):
      snake_case__     :  Optional[int]				    =      'mra'

      def __init__(		self						,			__lowerCAmelCase=5_0265						,			__lowerCAmelCase=768						,			__lowerCAmelCase=12						,			__lowerCAmelCase=12						,			__lowerCAmelCase=3072						,			__lowerCAmelCase="gelu"						,			__lowerCAmelCase=0.1						,			__lowerCAmelCase=0.1						,			__lowerCAmelCase=512						,			__lowerCAmelCase=1						,			__lowerCAmelCase=0.0_2						,			__lowerCAmelCase=1E-5						,			__lowerCAmelCase="absolute"						,			__lowerCAmelCase=4						,			__lowerCAmelCase="full"						,			__lowerCAmelCase=0						,			__lowerCAmelCase=0						,			__lowerCAmelCase=1						,			__lowerCAmelCase=0						,			__lowerCAmelCase=2						,			**__lowerCAmelCase						,			):







            """simple docstring"""



            super().__init__(pad_token_id=__lowerCAmelCase						,			bos_token_id=__lowerCAmelCase						,			eos_token_id=__lowerCAmelCase						,			**__lowerCAmelCase		)

            lowercase								=      vocab_size
            lowercase								=      max_position_embeddings
            lowercase								=      hidden_size
            lowercase								=      num_hidden_layers
            lowercase								=      num_attention_heads
            lowercase								=      intermediate_size
            lowercase								=      hidden_act
            lowercase								=      hidden_dropout_prob
            lowercase								=      attention_probs_dropout_prob
            lowercase								=      initializer_range
            lowercase								=      type_vocab_size
            lowercase								=      layer_norm_eps
            lowercase								=      position_embedding_type
            lowercase								=      block_per_row
            lowercase								=      approx_mode
            lowercase								=      initial_prior_first_n_blocks
            lowercase								=      initial_prior_diagonal_n_blocks



