





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					:    List[str]   =  logging.get_logger(__name__)

_A					:    List[Any]   =  {
    'google/vit-base-patch16-224': 'https://huggingface.co/vit-base-patch16-224/resolve/main/config.json',
    # See all ViT models at https://huggingface.co/models?filter=vit
}


class    __SCREAMING_SNAKE_CASE			( UpperCamelCase_					):
       _UpperCAmelCase      :  int     =    "vit"







       def __init__(      self     :	int		,					A     :	Tuple=7_6_8		,					A     :	Dict=1_2		,					A     :	Union[str, Any]=1_2		,					A     :	Union[str, Any]=3_0_7_2		,					A     :	List[Any]="gelu"		,					A     :	Any=0.0		,					A     :	str=0.0		,					A     :	Union[str, Any]=0.02		,					A     :	Dict=1e-12		,					A     :	List[str]=2_2_4		,					A     :	Union[str, Any]=1_6		,					A     :	Union[str, Any]=3		,					A     :	str=True		,					A     :	int=1_6		,					**A     :	int		,					)   ->Union[str, Any]:
          super().__init__(**UpperCamelCase__			)

          lowerCamelCase__   :						str					   =							hidden_size
          lowerCamelCase__   :						Union[str, Any]					   =							num_hidden_layers
          lowerCamelCase__   :						List[Any]					   =							num_attention_heads
          lowerCamelCase__   :						Tuple					   =							intermediate_size
          lowerCamelCase__   :						Union[str, Any]					   =							hidden_act
          lowerCamelCase__   :						Any					   =							hidden_dropout_prob
          lowerCamelCase__   :						Union[str, Any]					   =							attention_probs_dropout_prob
          lowerCamelCase__   :						Dict					   =							initializer_range
          lowerCamelCase__   :						Union[str, Any]					   =							layer_norm_eps
          lowerCamelCase__   :						int					   =							image_size
          lowerCamelCase__   :						List[str]					   =							patch_size
          lowerCamelCase__   :						Union[str, Any]					   =							num_channels
          lowerCamelCase__   :						Union[str, Any]					   =							qkv_bias
          lowerCamelCase__   :						List[str]					   =							encoder_stride


class    __SCREAMING_SNAKE_CASE			( UpperCamelCase_					):
       _UpperCAmelCase      :  List[str]     =    version.parse("1.11"					)







       @property
       def 						__lowerCamelCase    (      self     :	Union[str, Any]			)   ->Optional[Any]:
          return OrderedDict(
              [
                  ('''pixel_values''', {0: '''batch''', 1: '''num_channels''', 2: '''height''', 3: '''width'''}),
              ]			)







       @property
       def 						__lowerCamelCase    (      self     :	List[str]			)   ->Optional[Any]:
          return 1e-4




import math
def       A	(    _lowercase						):
						return math.sqrt(_lowercase						) * math.sqrt(_lowercase						) == num
def       A	(    _lowercase						):
						SCREAMING_SNAKE_CASE							:    Dict							=							0
						SCREAMING_SNAKE_CASE							:    Tuple							=							n
						while left <= right:
												SCREAMING_SNAKE_CASE							:    Union[str, Any]							=							(left + right) // 2
												if mid**2 == n:
																		return True
												elif mid**2 > n:
																		SCREAMING_SNAKE_CASE							:    Optional[Any]							=							mid - 1
												else:
																		SCREAMING_SNAKE_CASE							:    Optional[int]							=							mid + 1
						return False


if __name__ == "__main__":
					import doctest

					doctest.testmod()





