


"""simple docstring"""




from math import asin, atan, cos, radians, sin, sqrt, tan

lowercase_			     =  6378137.0
lowercase_			     =  6356752.314245
lowercase_			     =  6_3_7_8_1_3_7

def        lowercase							(		lowerCAmelCase__ :     float    ,					lowerCAmelCase__ :     float    ,					lowerCAmelCase__ :     float    ,					lowerCAmelCase__ :     float			) ->      float:
		__a           =			(AXIS_A - AXIS_B) / AXIS_A
		__a           =			atan((1 - flattening) * tan(radians(lowerCAmelCase__			)			)			)
		__a           =			atan((1 - flattening) * tan(radians(lowerCAmelCase__			)			)			)
		__a           =			radians(lowerCAmelCase__			)
		__a           =			radians(lowerCAmelCase__			)
		# Equation
		__a           =			sin((phi_a - phi_a) / 2			)
		__a           =			sin((lambda_a - lambda_a) / 2			)
		# Square both values
		sin_sq_phi *= sin_sq_phi
		sin_sq_lambda *= sin_sq_lambda
		__a           =			sqrt(sin_sq_phi + (cos(lowerCAmelCase__			) * cos(lowerCAmelCase__			) * sin_sq_lambda)			)
		return 2 * RADIUS * asin(lowerCAmelCase__			)


if __name__ == "__main__":
				import doctest

				doctest.testmod()










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


lowercase_			     =  logging.get_logger(__name__)

lowercase_			     =  {
    "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					(   __SCREAMING_SNAKE_CASE       ):


		'''simple docstring'''



		__UpperCAmelCase		:			List[str]										=				'beit'

		def __init__(  self							, _a=8_192							, _a=768							, _a=12							, _a=12							, _a=3_072							, _a="gelu"							, _a=0.0							, _a=0.0							, _a=0.02							, _a=1E-12							, _a=224							, _a=16							, _a=3							, _a=False							, _a=False							, _a=False							, _a=False							, _a=0.1							, _a=0.1							, _a=True							, _a=[3, 5, 7, 11]							, _a=[1, 2, 3, 6]							, _a=True							, _a=0.4							, _a=256							, _a=1							, _a=False							, _a=255							, **_a							, ):
				super().__init__(**_a      )

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

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







class 					__lowerCAmelCase					(   __SCREAMING_SNAKE_CASE       ):


		'''simple docstring'''



		__UpperCAmelCase		:			List[Any]										=				version.parse('1.11'       )

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





		@property
		def 			__UpperCAmelCase       (  self      ):
				return 1E-4






