


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_				:			Optional[int]   =	{
    '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 			SCREAMING_SNAKE_CASE__  (    lowerCamelCase__      ):
      snake_case__    :					List[Any]					       =						"""beit"""
      def __init__(	self    :	Any					,							SCREAMING_SNAKE_CASE__    :	Optional[Any]=8_1_9_2					,							SCREAMING_SNAKE_CASE__    :	Dict=7_6_8					,							SCREAMING_SNAKE_CASE__    :	Tuple=1_2					,							SCREAMING_SNAKE_CASE__    :	Optional[Any]=1_2					,							SCREAMING_SNAKE_CASE__    :	Any=3_0_7_2					,							SCREAMING_SNAKE_CASE__    :	List[str]="gelu"					,							SCREAMING_SNAKE_CASE__    :	Dict=0.0					,							SCREAMING_SNAKE_CASE__    :	Optional[Any]=0.0					,							SCREAMING_SNAKE_CASE__    :	Optional[int]=0.02					,							SCREAMING_SNAKE_CASE__    :	Any=1E-12					,							SCREAMING_SNAKE_CASE__    :	Tuple=2_2_4					,							SCREAMING_SNAKE_CASE__    :	Any=1_6					,							SCREAMING_SNAKE_CASE__    :	Tuple=3					,							SCREAMING_SNAKE_CASE__    :	Any=False					,							SCREAMING_SNAKE_CASE__    :	str=False					,							SCREAMING_SNAKE_CASE__    :	str=False					,							SCREAMING_SNAKE_CASE__    :	List[str]=False					,							SCREAMING_SNAKE_CASE__    :	str=0.1					,							SCREAMING_SNAKE_CASE__    :	Any=0.1					,							SCREAMING_SNAKE_CASE__    :	Tuple=True					,							SCREAMING_SNAKE_CASE__    :	str=[3, 5, 7, 1_1]					,							SCREAMING_SNAKE_CASE__    :	Optional[Any]=[1, 2, 3, 6]					,							SCREAMING_SNAKE_CASE__    :	Tuple=True					,							SCREAMING_SNAKE_CASE__    :	Union[str, Any]=0.4					,							SCREAMING_SNAKE_CASE__    :	Tuple=2_5_6					,							SCREAMING_SNAKE_CASE__    :	str=1					,							SCREAMING_SNAKE_CASE__    :	List[Any]=False					,							SCREAMING_SNAKE_CASE__    :	List[Any]=2_5_5					,							**SCREAMING_SNAKE_CASE__    :	Optional[int]					,							)		->      Dict:
             super().__init__(**snake_case__					)

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

             a_ :		Optional[Any]							=  image_size
             a_ :		Union[str, Any]							=  patch_size
             a_ :		str							=  num_channels
             a_ :		int							=  use_mask_token
             a_ :		Optional[Any]							=  use_absolute_position_embeddings
             a_ :		int							=  use_relative_position_bias
             a_ :		Any							=  use_shared_relative_position_bias
             a_ :		Dict							=  layer_scale_init_value
             a_ :		List[Any]							=  drop_path_rate
             a_ :		List[str]							=  use_mean_pooling
             # decode head attributes (semantic segmentation)
             a_ :		Optional[Any]							=  out_indices
             a_ :		List[Any]							=  pool_scales
             # auxiliary head attributes (semantic segmentation)
             a_ :		int							=  use_auxiliary_head
             a_ :		Optional[Any]							=  auxiliary_loss_weight
             a_ :		Dict							=  auxiliary_channels
             a_ :		Any							=  auxiliary_num_convs
             a_ :		List[str]							=  auxiliary_concat_input
             a_ :		Dict							=  semantic_loss_ignore_index
class 			SCREAMING_SNAKE_CASE__  (    lowerCamelCase__      ):
      snake_case__    :					Optional[int]					       =						version.parse('''1.11'''      )
      @property
      def 	SCREAMING_SNAKE_CASE							(	self    :	str					)		->      Mapping[str, Mapping[int, str]]:
             return OrderedDict(
                 [
                     ('pixel_values', {0: 'batch', 1: 'num_channels', 2: 'height', 3: 'width'}),
                 ]					)

      @property
      def 	SCREAMING_SNAKE_CASE							(	self    :	Any					)		->      float:
             return 1E-4






from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


UpperCAmelCase_				:			Dict   =	{'configuration_vit_msn': ['VIT_MSN_PRETRAINED_CONFIG_ARCHIVE_MAP', 'ViTMSNConfig']}

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   UpperCAmelCase_				:			int   =	[
       'VIT_MSN_PRETRAINED_MODEL_ARCHIVE_LIST',
       'ViTMSNModel',
       'ViTMSNForImageClassification',
       'ViTMSNPreTrainedModel',
   ]

if TYPE_CHECKING:
   from .configuration_vit_msn import VIT_MSN_PRETRAINED_CONFIG_ARCHIVE_MAP, ViTMSNConfig

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_vit_msn import (
          VIT_MSN_PRETRAINED_MODEL_ARCHIVE_LIST,
          ViTMSNForImageClassification,
          ViTMSNModel,
          ViTMSNPreTrainedModel,
      )

else:
   import sys

   UpperCAmelCase_				:			Dict   =	_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)


