



"""simple docstring"""
from math import atan, cos, radians, sin, tan

from .haversine_distance import haversine_distance

A:   Dict								=		6_3_7_8_1_3_7.0
A:   str								=		6_3_5_6_7_5_2.3_1_4_2_4_5
A:   Any								=		6_3_7_8_1_3_7

def       _snake_case						(						UpperCamelCase						:		float			,		UpperCamelCase						:		float			,		UpperCamelCase						:		float			,		UpperCamelCase						:		float						):
 UpperCAmelCase	:					Dict	=	(AXIS_A - AXIS_B) / AXIS_A
 # Parametric latitudes
 # https://en.wikipedia.org/wiki/Latitude#Parametric_(or_reduced)_latitude
 UpperCAmelCase	:					Union[str, Any]	=	atan((1 - flattening) * tan(radians(lowerCAmelCase_						)						)						)
 UpperCAmelCase	:					Any	=	atan((1 - flattening) * tan(radians(lowerCAmelCase_						)						)						)

 # Compute central angle between two points
 # using haversine theta. sigma =  haversine_distance / equatorial radius
 UpperCAmelCase	:					str	=	haversine_distance(lowerCAmelCase_			,		lowerCAmelCase_			,		lowerCAmelCase_			,		lowerCAmelCase_						) / EQUATORIAL_RADIUS

 # Intermediate P and Q values
 UpperCAmelCase	:					Any	=	(b_lata + b_lata) / 2
 UpperCAmelCase	:					Optional[int]	=	(b_lata - b_lata) / 2

 # Intermediate X value
 # X = (sigma - sin(sigma)) * sin^2Pcos^2Q / cos^2(sigma/2)
 UpperCAmelCase	:					Optional[Any]	=	(sin(lowerCAmelCase_						) ** 2) * (cos(lowerCAmelCase_						) ** 2)
 UpperCAmelCase	:					List[str]	=	cos(sigma / 2						) ** 2
 UpperCAmelCase	:					Union[str, Any]	=	(sigma - sin(lowerCAmelCase_						)) * (x_numerator / x_demonimator)

 # Intermediate Y value
 # Y = (sigma + sin(sigma)) * cos^2Psin^2Q / sin^2(sigma/2)
 UpperCAmelCase	:					List[Any]	=	(cos(lowerCAmelCase_						) ** 2) * (sin(lowerCAmelCase_						) ** 2)
 UpperCAmelCase	:					Optional[Any]	=	sin(sigma / 2						) ** 2
 UpperCAmelCase	:					Any	=	(sigma + sin(lowerCAmelCase_						)) * (y_numerator / y_denominator)

 return EQUATORIAL_RADIUS * (sigma - ((flattening / 2) * (x_value + y_value)))


if __name__ == "__main__":
      import doctest

      doctest.testmod()







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


_snake_case  :    List[Any]						    =  logging.get_logger(__name__)

_snake_case  :    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 				_UpperCAmelCase    (    _UpperCamelCase    ):

  """simple docstring"""


  a_        = """beit"""






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

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

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





class 				_UpperCAmelCase    (    _UpperCamelCase    ):

  """simple docstring"""


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






  @property
  def 				lowercase		(				self :		Tuple     )							->						Mapping[str, Mapping[int, str]]:
     return OrderedDict(
         [
             ('pixel_values', {0: 'batch', 1: 'num_channels', 2: 'height', 3: 'width'}),
         ]     )






  @property
  def 				lowercase		(				self :		Optional[Any]     )							->						float:
     return 1e-4

