



'''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				:    int     						=logging.get_logger(__name__)

_A				:    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 		lowerCamelCase__      (						A     ):




					'''simple docstring'''



					A_						    =						"""beit"""




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



						'''simple docstring'''





						super().__init__(**UpperCamelCase_					)

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

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






class 		lowerCamelCase__      (						A     ):




					'''simple docstring'''



					A_						    =						version.parse("""1.11"""     )




					@property
					def 						__UpperCAmelCase     (  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 						__UpperCAmelCase     (  self				:	Optional[int]					)  ->       float:



						'''simple docstring'''





						return 1E-4





'''simple docstring'''

from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_sentencepiece_available,
    is_tokenizers_available,
    is_torch_available,
)


_A				:    Union[str, Any]     						={'''configuration_reformer''': ['''REFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''ReformerConfig''']}

try:
		if not is_sentencepiece_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		_A				:    Dict     						=['''ReformerTokenizer''']

try:
		if not is_tokenizers_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		_A				:    Union[str, Any]     						=['''ReformerTokenizerFast''']

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		_A				:    str     						=[
		    '''REFORMER_PRETRAINED_MODEL_ARCHIVE_LIST''',
		    '''ReformerAttention''',
		    '''ReformerForMaskedLM''',
		    '''ReformerForQuestionAnswering''',
		    '''ReformerForSequenceClassification''',
		    '''ReformerLayer''',
		    '''ReformerModel''',
		    '''ReformerModelWithLMHead''',
		    '''ReformerPreTrainedModel''',
		]


if TYPE_CHECKING:
		from .configuration_reformer import REFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, ReformerConfig

		try:
				if not is_sentencepiece_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .tokenization_reformer import ReformerTokenizer

		try:
				if not is_tokenizers_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .tokenization_reformer_fast import ReformerTokenizerFast

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_reformer import (
				    REFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
				    ReformerAttention,
				    ReformerForMaskedLM,
				    ReformerForQuestionAnswering,
				    ReformerForSequenceClassification,
				    ReformerLayer,
				    ReformerModel,
				    ReformerModelWithLMHead,
				    ReformerPreTrainedModel,
				)

else:
		import sys

		_A				:    Union[str, Any]     						=_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)
