
"""simple docstring"""






from ...configuration_utils import PretrainedConfig
from ...utils import logging


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

lowerCamelCase__ :       Optional[int]						     =			{
    "microsoft/swinv2-tiny-patch4-window8-256": (
        "https://huggingface.co/microsoft/swinv2-tiny-patch4-window8-256/resolve/main/config.json"
    ),
}




class 				lowercase__(				_UpperCAmelCase   ):
	'''simple docstring'''

	UpperCamelCase				=  """swinv2"""

	UpperCamelCase				=  {
	    """num_attention_heads""": """num_heads""",
	    """num_hidden_layers""": """num_layers""",
	}





	def __init__(						self    :Any		, lowerCamelCase_    :str=2_24		, lowerCamelCase_    :List[str]=4		, lowerCamelCase_    :Optional[int]=3		, lowerCamelCase_    :List[str]=96		, lowerCamelCase_    :Optional[int]=[2, 2, 6, 2]		, lowerCamelCase_    :Any=[3, 6, 12, 24]		, lowerCamelCase_    :List[str]=7		, lowerCamelCase_    :List[str]=4.0		, lowerCamelCase_    :str=True		, lowerCamelCase_    :Any=0.0		, lowerCamelCase_    :List[Any]=0.0		, lowerCamelCase_    :Tuple=0.1		, lowerCamelCase_    :Dict="gelu"		, lowerCamelCase_    :str=False		, lowerCamelCase_    :Tuple=0.0_2		, lowerCamelCase_    :List[str]=1E-5		, lowerCamelCase_    :Dict=32		, **lowerCamelCase_    :Optional[Any]		, )							->			Union[str, Any]:







			'''simple docstring'''




			super().__init__(**lowerCamelCase_					)

			SCREAMING_SNAKE_CASE       :     int				= image_size
			SCREAMING_SNAKE_CASE       :     Union[str, Any]				= patch_size
			SCREAMING_SNAKE_CASE       :     int				= num_channels
			SCREAMING_SNAKE_CASE       :     int				= embed_dim
			SCREAMING_SNAKE_CASE       :     int				= depths
			SCREAMING_SNAKE_CASE       :     List[Any]				= len(lowerCamelCase_					)
			SCREAMING_SNAKE_CASE       :     Any				= num_heads
			SCREAMING_SNAKE_CASE       :     Dict				= window_size
			SCREAMING_SNAKE_CASE       :     int				= mlp_ratio
			SCREAMING_SNAKE_CASE       :     Dict				= qkv_bias
			SCREAMING_SNAKE_CASE       :     Dict				= hidden_dropout_prob
			SCREAMING_SNAKE_CASE       :     List[Any]				= attention_probs_dropout_prob
			SCREAMING_SNAKE_CASE       :     List[str]				= drop_path_rate
			SCREAMING_SNAKE_CASE       :     Tuple				= hidden_act
			SCREAMING_SNAKE_CASE       :     Union[str, Any]				= use_absolute_embeddings
			SCREAMING_SNAKE_CASE       :     int				= layer_norm_eps
			SCREAMING_SNAKE_CASE       :     List[str]				= initializer_range
			SCREAMING_SNAKE_CASE       :     Tuple				= encoder_stride
			# we set the hidden_size attribute in order to make Swinv2 work with VisionEncoderDecoderModel
			# this indicates the channel dimension after the last stage of the model
			SCREAMING_SNAKE_CASE       :     Union[str, Any]				= int(embed_dim * 2 ** (len(lowerCamelCase_					) - 1)					)
			SCREAMING_SNAKE_CASE       :     str				= (0, 0, 0, 0)







"""simple docstring"""






from __future__ import annotations

from numpy import array, cos, cross, floataa, radians, sin
from numpy.typing import NDArray





def __A						(   a_ :							float		,		a_ :							float		,		a_ :							bool = False     )->							list[float]:




		'''simple docstring'''






		if radian_mode:
				return [magnitude * cos(a_     ), magnitude * sin(a_     )]
		return [magnitude * cos(radians(a_     )     ), magnitude * sin(radians(a_     )     )]





def __A						(   a_ :							NDArray[floataa]		,		a_ :							NDArray[floataa]		,		a_ :							float = 10**-1     )->							bool:




		'''simple docstring'''






		SCREAMING_SNAKE_CASE       :     NDArray[floataa]				= cross(a_		,		a_     )
		SCREAMING_SNAKE_CASE       :     float				= sum(a_     )
		return abs(a_     ) < eps


if __name__ == "__main__":
					# Test to check if it works
					lowerCamelCase__ :       Optional[Any]						     =			array(
					    [
					        polar_force(7_1_8.4, 180 - 30),
					        polar_force(8_7_9.5_4, 45),
					        polar_force(100, -90),
					    ]
					)

					lowerCamelCase__ :       NDArray[floataa]						     =			array([[0, 0], [0, 0], [0, 0]])

					assert in_static_equilibrium(forces, location)

					# Problem 1 in image_data/2D_problems.jpg
					lowerCamelCase__ :       Union[str, Any]						     =			array(
					    [
					        polar_force(30 * 9.8_1, 15),
					        polar_force(215, 180 - 45),
					        polar_force(264, 90 - 30),
					    ]
					)

					lowerCamelCase__ :       Any						     =			array([[0, 0], [0, 0], [0, 0]])

					assert in_static_equilibrium(forces, location)

					# Problem in image_data/2D_problems_1.jpg
					lowerCamelCase__ :       Union[str, Any]						     =			array([[0, -2000], [0, -1200], [0, 15600], [0, -12400]])

					lowerCamelCase__ :       Optional[int]						     =			array([[0, 0], [6, 0], [10, 0], [12, 0]])

					assert in_static_equilibrium(forces, location)

					import doctest

					doctest.testmod()





