



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


A_						:    Dict				=      logging.get_logger(__name__)

A_						:    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     lowerCAmelCase__						(	_lowerCamelCase ):


	'''simple docstring'''







	_SCREAMING_SNAKE_CASE	:		List[str]  						= '''beit'''





	def __init__(      self				:       Dict     ,       _SCREAMING_SNAKE_CASE				:       Optional[int]=8_192     ,       _SCREAMING_SNAKE_CASE				:       Optional[int]=768     ,       _SCREAMING_SNAKE_CASE				:       str=12     ,       _SCREAMING_SNAKE_CASE				:       int=12     ,       _SCREAMING_SNAKE_CASE				:       Any=3_072     ,       _SCREAMING_SNAKE_CASE				:       List[str]="gelu"     ,       _SCREAMING_SNAKE_CASE				:       Union[str, Any]=0.0     ,       _SCREAMING_SNAKE_CASE				:       Optional[int]=0.0     ,       _SCREAMING_SNAKE_CASE				:       Dict=0.0_2     ,       _SCREAMING_SNAKE_CASE				:       Any=1E-1_2     ,       _SCREAMING_SNAKE_CASE				:       Any=224     ,       _SCREAMING_SNAKE_CASE				:       Union[str, Any]=16     ,       _SCREAMING_SNAKE_CASE				:       Any=3     ,       _SCREAMING_SNAKE_CASE				:       Optional[int]=False     ,       _SCREAMING_SNAKE_CASE				:       Optional[Any]=False     ,       _SCREAMING_SNAKE_CASE				:       Union[str, Any]=False     ,       _SCREAMING_SNAKE_CASE				:       Optional[Any]=False     ,       _SCREAMING_SNAKE_CASE				:       Optional[Any]=0.1     ,       _SCREAMING_SNAKE_CASE				:       Any=0.1     ,       _SCREAMING_SNAKE_CASE				:       str=True     ,       _SCREAMING_SNAKE_CASE				:       Optional[Any]=[3, 5, 7, 11]     ,       _SCREAMING_SNAKE_CASE				:       Any=[1, 2, 3, 6]     ,       _SCREAMING_SNAKE_CASE				:       Tuple=True     ,       _SCREAMING_SNAKE_CASE				:       str=0.4     ,       _SCREAMING_SNAKE_CASE				:       Tuple=256     ,       _SCREAMING_SNAKE_CASE				:       Tuple=1     ,       _SCREAMING_SNAKE_CASE				:       List[str]=False     ,       _SCREAMING_SNAKE_CASE				:       Optional[Any]=255     ,       **_SCREAMING_SNAKE_CASE				:       Union[str, Any]     ,       )						->	Any:





					"""simple docstring"""


					super().__init__(**_SCREAMING_SNAKE_CASE    )

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

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




class     lowerCAmelCase__						(	_lowerCamelCase ):


	'''simple docstring'''







	_SCREAMING_SNAKE_CASE	:		Optional[Any]  						= version.parse('''1.11''' )





	@property
	def 			_lowerCAmelCase     (      self				:       List[str]    )						->	Mapping[str, Mapping[int, str]]:





					"""simple docstring"""


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







	@property
	def 			_lowerCAmelCase     (      self				:       Optional[Any]    )						->	float:





					"""simple docstring"""


					return 1E-4










"""simple docstring"""

from typing import TYPE_CHECKING

from ..utils import _LazyModule


A_						:    str				=      {
    'config': [
        'EXTERNAL_DATA_FORMAT_SIZE_LIMIT',
        'OnnxConfig',
        'OnnxConfigWithPast',
        'OnnxSeq2SeqConfigWithPast',
        'PatchingSpec',
    ],
    'convert': ['export', 'validate_model_outputs'],
    'features': ['FeaturesManager'],
    'utils': ['ParameterFormat', 'compute_serialized_parameters_size'],
}


if TYPE_CHECKING:
							from .config import (
							    EXTERNAL_DATA_FORMAT_SIZE_LIMIT,
							    OnnxConfig,
							    OnnxConfigWithPast,
							    OnnxSeqaSeqConfigWithPast,
							    PatchingSpec,
							)
							from .convert import export, validate_model_outputs
							from .features import FeaturesManager
							from .utils import ParameterFormat, compute_serialized_parameters_size

else:
							import sys

							A_						:    Optional[Any]				=      _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)





