






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


lowerCamelCase_				: str    	=							logging.get_logger(__name__)

lowerCamelCase_				: str    	=							{
    '''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							(		SCREAMING_SNAKE_CASE	):


			'''simple docstring'''





			__a							:							Dict					     =					"beit"






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

									'''simple docstring'''







									super().__init__(**lowercase			)

									UpperCamelCase__         = vocab_size
									UpperCamelCase__         = hidden_size
									UpperCamelCase__         = num_hidden_layers
									UpperCamelCase__         = num_attention_heads
									UpperCamelCase__         = intermediate_size
									UpperCamelCase__         = hidden_act
									UpperCamelCase__         = hidden_dropout_prob
									UpperCamelCase__         = attention_probs_dropout_prob
									UpperCamelCase__         = initializer_range
									UpperCamelCase__         = layer_norm_eps

									UpperCamelCase__         = image_size
									UpperCamelCase__         = patch_size
									UpperCamelCase__         = num_channels
									UpperCamelCase__         = use_mask_token
									UpperCamelCase__         = use_absolute_position_embeddings
									UpperCamelCase__         = use_relative_position_bias
									UpperCamelCase__         = use_shared_relative_position_bias
									UpperCamelCase__         = layer_scale_init_value
									UpperCamelCase__         = drop_path_rate
									UpperCamelCase__         = use_mean_pooling
									# decode head attributes (semantic segmentation)
									UpperCamelCase__         = out_indices
									UpperCamelCase__         = pool_scales
									# auxiliary head attributes (semantic segmentation)
									UpperCamelCase__         = use_auxiliary_head
									UpperCamelCase__         = auxiliary_loss_weight
									UpperCamelCase__         = auxiliary_channels
									UpperCamelCase__         = auxiliary_num_convs
									UpperCamelCase__         = auxiliary_concat_input
									UpperCamelCase__         = semantic_loss_ignore_index
class    _SCREAMING_SNAKE_CASE							(		SCREAMING_SNAKE_CASE	):


			'''simple docstring'''





			__a							:							List[Any]					     =					version.parse("1.11"	)






			@property
			def 				A      (   self							:						Optional[int]			)							->    Mapping[str, Mapping[int, str]]:

									'''simple docstring'''







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







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

									'''simple docstring'''







									return 1e-4








'''simple docstring'''


import math







def 	__magic_name__( _A					):
						'''simple docstring'''





						assert isinstance(_A						,      _A					) and (
						    number >= 0
						), "'number' must been an int and positive"

						if 1 < number < 4:
												# 2 and 3 are primes
												return True
						elif number < 2 or not number % 2:
												# Negatives, 0, 1 and all even numbers are not primes
												return False

						UpperCamelCase__         = range(3						,      int(math.sqrt(_A					) + 1					)						,      2					)
						return not any(not number % i for i in odd_numbers					)







def 	__magic_name__( _A						,      _A=1						,      **_A					):
						'''simple docstring'''





						UpperCamelCase__         = factor * value
						UpperCamelCase__         = value

						while not is_prime(_A					):
												value += 1 if not ("desc" in kwargs and kwargs["desc"] is True) else -1

						if value == first_value_val:
												return next_prime(value + 1						,      **_A					)
						return value
