



"""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__      =    logging.get_logger(__name__)

lowerCAmelCase__      =    {
    '''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 	__snake_case	(     _lowercase):
  snake_case__    :       Union[str, Any]        =						"beit"




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






         """simple docstring"""






         super().__init__(**__lowerCAmelCase		)

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

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






class 	__snake_case	(     _lowercase):
  snake_case__    :       List[str]        =						version.parse("1.11")




  @property
  def 						SCREAMING_SNAKE_CASE    (			self					:						str		):






         """simple docstring"""






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




  @property
  def 						SCREAMING_SNAKE_CASE    (			self					:						Dict		):






         """simple docstring"""






         return 1E-4







"""simple docstring"""






def 	snake_case_  (				A_ :		float						):


       '''simple docstring'''





       if edge <= 0 or not isinstance(A_,    A_						):
              raise ValueError('''Length must be a positive.'''						)
       return 3 * ((25 + 10 * (5 ** (1 / 2))) ** (1 / 2)) * (edge**2)






def 	snake_case_  (				A_ :		float						):


       '''simple docstring'''





       if edge <= 0 or not isinstance(A_,    A_						):
              raise ValueError('''Length must be a positive.'''						)
       return ((15 + (7 * (5 ** (1 / 2)))) / 4) * (edge**3)


if __name__ == "__main__":
   import doctest

   doctest.testmod()


