

'''simple docstring'''



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


_UpperCamelCase						:  Optional[int]							       =				logging.get_logger(__name__)

_UpperCamelCase						:  Dict							       =				{
    "microsoft/swinv2-tiny-patch4-window8-256": (
        "https://huggingface.co/microsoft/swinv2-tiny-patch4-window8-256/resolve/main/config.json"
    ),
}



class 				_snake_case					(   a_			):
  SCREAMING_SNAKE_CASE			:       Tuple				=     '''swinv2'''

  SCREAMING_SNAKE_CASE			:       Optional[Any]				=     {
      '''num_attention_heads''': '''num_heads''',
      '''num_hidden_layers''': '''num_layers''',
  }

  def __init__(				self      , _SCREAMING_SNAKE_CASE=2_24      , _SCREAMING_SNAKE_CASE=4      , _SCREAMING_SNAKE_CASE=3      , _SCREAMING_SNAKE_CASE=96      , _SCREAMING_SNAKE_CASE=[2, 2, 6, 2]      , _SCREAMING_SNAKE_CASE=[3, 6, 12, 24]      , _SCREAMING_SNAKE_CASE=7      , _SCREAMING_SNAKE_CASE=4.0      , _SCREAMING_SNAKE_CASE=True      , _SCREAMING_SNAKE_CASE=0.0      , _SCREAMING_SNAKE_CASE=0.0      , _SCREAMING_SNAKE_CASE=0.1      , _SCREAMING_SNAKE_CASE="gelu"      , _SCREAMING_SNAKE_CASE=False      , _SCREAMING_SNAKE_CASE=0.02      , _SCREAMING_SNAKE_CASE=1e-5      , _SCREAMING_SNAKE_CASE=32      , **_SCREAMING_SNAKE_CASE      , ):





      '''simple docstring'''

      super().__init__(**_SCREAMING_SNAKE_CASE	)

      lowerCAmelCase 						=							image_size
      lowerCAmelCase 						=							patch_size
      lowerCAmelCase 						=							num_channels
      lowerCAmelCase 						=							embed_dim
      lowerCAmelCase 						=							depths
      lowerCAmelCase 						=							len(_SCREAMING_SNAKE_CASE	)
      lowerCAmelCase 						=							num_heads
      lowerCAmelCase 						=							window_size
      lowerCAmelCase 						=							mlp_ratio
      lowerCAmelCase 						=							qkv_bias
      lowerCAmelCase 						=							hidden_dropout_prob
      lowerCAmelCase 						=							attention_probs_dropout_prob
      lowerCAmelCase 						=							drop_path_rate
      lowerCAmelCase 						=							hidden_act
      lowerCAmelCase 						=							use_absolute_embeddings
      lowerCAmelCase 						=							layer_norm_eps
      lowerCAmelCase 						=							initializer_range
      lowerCAmelCase 						=							encoder_stride
      # we set the hidden_size attribute in order to make Swinv2 work with VisionEncoderDecoderModel
      # this indicates the channel dimension after the last stage of the model
      lowerCAmelCase 						=							int(embed_dim * 2 ** (len(_SCREAMING_SNAKE_CASE	) - 1)	)
      lowerCAmelCase 						=							(0, 0, 0, 0)








'''simple docstring'''



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


_UpperCamelCase						:  Optional[int]							       =				logging.get_logger(__name__)

_UpperCamelCase						:  Tuple							       =				{
    "google/canine-s": "https://huggingface.co/google/canine-s/resolve/main/config.json",
    # See all CANINE models at https://huggingface.co/models?filter=canine
}



class 				_snake_case					(   a_			):
  SCREAMING_SNAKE_CASE			:       List[Any]				=     '''canine'''

  def __init__(				self      , _SCREAMING_SNAKE_CASE=7_68      , _SCREAMING_SNAKE_CASE=12      , _SCREAMING_SNAKE_CASE=12      , _SCREAMING_SNAKE_CASE=30_72      , _SCREAMING_SNAKE_CASE="gelu"      , _SCREAMING_SNAKE_CASE=0.1      , _SCREAMING_SNAKE_CASE=0.1      , _SCREAMING_SNAKE_CASE=1_63_84      , _SCREAMING_SNAKE_CASE=16      , _SCREAMING_SNAKE_CASE=0.02      , _SCREAMING_SNAKE_CASE=1e-12      , _SCREAMING_SNAKE_CASE=0      , _SCREAMING_SNAKE_CASE=0Xe0_00      , _SCREAMING_SNAKE_CASE=0Xe0_01      , _SCREAMING_SNAKE_CASE=4      , _SCREAMING_SNAKE_CASE=4      , _SCREAMING_SNAKE_CASE=8      , _SCREAMING_SNAKE_CASE=1_63_84      , _SCREAMING_SNAKE_CASE=1_28      , **_SCREAMING_SNAKE_CASE      , ):





      '''simple docstring'''

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

      lowerCAmelCase 						=							max_position_embeddings
      lowerCAmelCase 						=							hidden_size
      lowerCAmelCase 						=							num_hidden_layers
      lowerCAmelCase 						=							num_attention_heads
      lowerCAmelCase 						=							intermediate_size
      lowerCAmelCase 						=							hidden_act
      lowerCAmelCase 						=							hidden_dropout_prob
      lowerCAmelCase 						=							attention_probs_dropout_prob
      lowerCAmelCase 						=							initializer_range
      lowerCAmelCase 						=							type_vocab_size
      lowerCAmelCase 						=							layer_norm_eps

      # Character config:
      lowerCAmelCase 						=							downsampling_rate
      lowerCAmelCase 						=							upsampling_kernel_size
      lowerCAmelCase 						=							num_hash_functions
      lowerCAmelCase 						=							num_hash_buckets
      lowerCAmelCase 						=							local_transformer_stride





