






"""simple docstring"""


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


_UpperCamelCase    :   List[str]   			=						logging.get_logger(__name__)

_UpperCamelCase    :   str   			=						{
    'funnel-transformer/small': 'https://huggingface.co/funnel-transformer/small/resolve/main/config.json',
    'funnel-transformer/small-base': 'https://huggingface.co/funnel-transformer/small-base/resolve/main/config.json',
    'funnel-transformer/medium': 'https://huggingface.co/funnel-transformer/medium/resolve/main/config.json',
    'funnel-transformer/medium-base': 'https://huggingface.co/funnel-transformer/medium-base/resolve/main/config.json',
    'funnel-transformer/intermediate': (
        'https://huggingface.co/funnel-transformer/intermediate/resolve/main/config.json'
    ),
    'funnel-transformer/intermediate-base': (
        'https://huggingface.co/funnel-transformer/intermediate-base/resolve/main/config.json'
    ),
    'funnel-transformer/large': 'https://huggingface.co/funnel-transformer/large/resolve/main/config.json',
    'funnel-transformer/large-base': 'https://huggingface.co/funnel-transformer/large-base/resolve/main/config.json',
    'funnel-transformer/xlarge': 'https://huggingface.co/funnel-transformer/xlarge/resolve/main/config.json',
    'funnel-transformer/xlarge-base': 'https://huggingface.co/funnel-transformer/xlarge-base/resolve/main/config.json',
}






class 						snake_case  (  _lowerCamelCase	):
				__magic_name__   					=					'''funnel'''
				__magic_name__   					=					{
				    '''hidden_size''': '''d_model''',
				    '''num_attention_heads''': '''n_head''',
				}





				def __init__(							self     : str    ,		A     : List[Any]=3_0_5_2_2    ,		A     : Any=[4, 4, 4]    ,		A     : Dict=None    ,		A     : Dict=2    ,		A     : Optional[int]=7_6_8    ,		A     : List[str]=1_2    ,		A     : Optional[Any]=6_4    ,		A     : str=3_0_7_2    ,		A     : Any="gelu_new"    ,		A     : Optional[Any]=0.1    ,		A     : Any=0.1    ,		A     : List[str]=0.0    ,		A     : Tuple=0.1    ,		A     : Union[str, Any]=None    ,		A     : Tuple=1E-9    ,		A     : Tuple="mean"    ,		A     : str="relative_shift"    ,		A     : Any=True    ,		A     : List[Any]=True    ,		A     : int=True    ,		**A     : List[str]    ,		):


						'''simple docstring'''




						a					:      Optional[Any]    =       vocab_size
						a					:      List[str]    =       block_sizes
						a					:      Dict    =       [1] * len(A      ) if block_repeats is None else block_repeats
						assert len(A      ) == len(
						    self.block_repeats      ), "`block_sizes` and `block_repeats` should have the same length."
						a					:      Union[str, Any]    =       num_decoder_layers
						a					:      Union[str, Any]    =       d_model
						a					:      Union[str, Any]    =       n_head
						a					:      Optional[Any]    =       d_head
						a					:      Any    =       d_inner
						a					:      Union[str, Any]    =       hidden_act
						a					:      List[Any]    =       hidden_dropout
						a					:      List[str]    =       attention_dropout
						a					:      int    =       activation_dropout
						a					:      Union[str, Any]    =       initializer_range
						a					:      Dict    =       initializer_std
						a					:      Any    =       layer_norm_eps
						assert pooling_type in [
						    "mean",
						    "max",
						], F'''Got {pooling_type} for `pooling_type` but only \'mean\' and \'max\' are supported.'''
						a					:      Any    =       pooling_type
						assert attention_type in [
						    "relative_shift",
						    "factorized",
						], F'''Got {attention_type} for `attention_type` but only \'relative_shift\' and \'factorized\' are supported.'''
						a					:      List[str]    =       attention_type
						a					:      Dict    =       separate_cls
						a					:      List[str]    =       truncate_seq
						a					:      List[str]    =       pool_q_only

						super().__init__(**A      )





				@property
				def     lowerCamelCase__				(							self     : Optional[int]      ):


						'''simple docstring'''




						return sum(self.block_sizes      )





				@num_hidden_layers.setter
				def     lowerCamelCase__				(							self     : Union[str, Any]    ,		A     : Tuple      ):


						'''simple docstring'''




						raise NotImplementedError(
						    'This model does not support the setting of `num_hidden_layers`. Please set `block_sizes`.'      )





				@property
				def     lowerCamelCase__				(							self     : Union[str, Any]      ):


						'''simple docstring'''




						return len(self.block_sizes      )





				@num_blocks.setter
				def     lowerCamelCase__				(							self     : Any    ,		A     : Dict      ):


						'''simple docstring'''




						raise NotImplementedError('This model does not support the setting of `num_blocks`. Please set `block_sizes`.'      )












"""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


_UpperCamelCase    :   Union[str, Any]   			=						logging.get_logger(__name__)

_UpperCamelCase    :   List[Any]   			=						{
    'microsoft/beit-base-patch16-224-pt22k': (
        'https://huggingface.co/microsoft/beit-base-patch16-224-pt22k/resolve/main/config.json'
    ),
    # See all BEiT models at https://huggingface.co/models?filter=beit
}






class 						snake_case  (  UpperCAmelCase	):
    __magic_name__   					=					'''beit'''





    def __init__(							self     : int    ,		A     : int=8_1_9_2    ,		A     : List[Any]=7_6_8    ,		A     : str=1_2    ,		A     : str=1_2    ,		A     : Dict=3_0_7_2    ,		A     : Optional[int]="gelu"    ,		A     : List[Any]=0.0    ,		A     : Union[str, Any]=0.0    ,		A     : Optional[Any]=0.02    ,		A     : Optional[int]=1E-12    ,		A     : Dict=2_2_4    ,		A     : str=1_6    ,		A     : Optional[Any]=3    ,		A     : List[Any]=False    ,		A     : Union[str, Any]=False    ,		A     : Optional[Any]=False    ,		A     : int=False    ,		A     : List[str]=0.1    ,		A     : Union[str, Any]=0.1    ,		A     : str=True    ,		A     : Tuple=[3, 5, 7, 1_1]    ,		A     : List[str]=[1, 2, 3, 6]    ,		A     : Optional[Any]=True    ,		A     : Union[str, Any]=0.4    ,		A     : Any=2_5_6    ,		A     : List[Any]=1    ,		A     : Optional[Any]=False    ,		A     : Any=2_5_5    ,		**A     : List[Any]    ,		):


      '''simple docstring'''




      super().__init__(**A      )

      a					:      Optional[int]    =       vocab_size
      a					:      Dict    =       hidden_size
      a					:      Optional[int]    =       num_hidden_layers
      a					:      Tuple    =       num_attention_heads
      a					:      Optional[int]    =       intermediate_size
      a					:      Optional[Any]    =       hidden_act
      a					:      Optional[int]    =       hidden_dropout_prob
      a					:      Optional[int]    =       attention_probs_dropout_prob
      a					:      Optional[Any]    =       initializer_range
      a					:      Union[str, Any]    =       layer_norm_eps

      a					:      Union[str, Any]    =       image_size
      a					:      str    =       patch_size
      a					:      Optional[Any]    =       num_channels
      a					:      List[str]    =       use_mask_token
      a					:      Optional[Any]    =       use_absolute_position_embeddings
      a					:      Any    =       use_relative_position_bias
      a					:      Any    =       use_shared_relative_position_bias
      a					:      Dict    =       layer_scale_init_value
      a					:      Optional[int]    =       drop_path_rate
      a					:      Dict    =       use_mean_pooling
      # decode head attributes (semantic segmentation)
      a					:      Optional[Any]    =       out_indices
      a					:      List[str]    =       pool_scales
      # auxiliary head attributes (semantic segmentation)
      a					:      Tuple    =       use_auxiliary_head
      a					:      Dict    =       auxiliary_loss_weight
      a					:      Any    =       auxiliary_channels
      a					:      Dict    =       auxiliary_num_convs
      a					:      List[str]    =       auxiliary_concat_input
      a					:      List[Any]    =       semantic_loss_ignore_index






class 						snake_case  (  UpperCAmelCase	):
    __magic_name__   					=					version.parse('''1.11'''	)





    @property
    def     lowerCamelCase__				(							self     : List[str]      ):


      '''simple docstring'''




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





    @property
    def     lowerCamelCase__				(							self     : Optional[Any]      ):


      '''simple docstring'''




      return 1E-4




