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


__a  :     Tuple       =  logging.get_logger(__name__)

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




class    _UpperCamelCase      (						_UpperCAmelCase ):


			"""simple docstring"""






			__a  : Any			 =						'''swinv2'''

			__a  : List[str]			 =						{
			    '''num_attention_heads''': '''num_heads''',
			    '''num_hidden_layers''': '''num_layers''',
			}





			def __init__(   self      ,   lowerCAmelCase__=2_24      ,   lowerCAmelCase__=4      ,   lowerCAmelCase__=3      ,   lowerCAmelCase__=96      ,   lowerCAmelCase__=[2, 2, 6, 2]      ,   lowerCAmelCase__=[3, 6, 12, 24]      ,   lowerCAmelCase__=7      ,   lowerCAmelCase__=4.0      ,   lowerCAmelCase__=True      ,   lowerCAmelCase__=0.0      ,   lowerCAmelCase__=0.0      ,   lowerCAmelCase__=0.1      ,   lowerCAmelCase__="gelu"      ,   lowerCAmelCase__=False      ,   lowerCAmelCase__=0.02      ,   lowerCAmelCase__=1E-5      ,   lowerCAmelCase__=32      ,   **lowerCAmelCase__      ,   )     ->					Optional[Any]:

							'''simple docstring'''


							super().__init__(**lowerCAmelCase__						)

							__lowercase 			=							image_size
							__lowercase 			=							patch_size
							__lowercase 			=							num_channels
							__lowercase 			=							embed_dim
							__lowercase 			=							depths
							__lowercase 			=							len(lowerCAmelCase__						)
							__lowercase 			=							num_heads
							__lowercase 			=							window_size
							__lowercase 			=							mlp_ratio
							__lowercase 			=							qkv_bias
							__lowercase 			=							hidden_dropout_prob
							__lowercase 			=							attention_probs_dropout_prob
							__lowercase 			=							drop_path_rate
							__lowercase 			=							hidden_act
							__lowercase 			=							use_absolute_embeddings
							__lowercase 			=							layer_norm_eps
							__lowercase 			=							initializer_range
							__lowercase 			=							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
							__lowercase 			=							int(embed_dim * 2 ** (len(lowerCAmelCase__						) - 1)						)
							__lowercase 			=							(0, 0, 0, 0)
from decimal import Decimal, getcontext
from math import ceil, factorial





def 				UpperCAmelCase						(    lowercase							):







				"""simple docstring"""



				if not isinstance(lowercase							,			lowercase							):
								raise TypeError('''Undefined for non-integers'''							)
				elif precision < 1:
								raise ValueError('''Undefined for non-natural numbers'''							)

				__lowercase 			=							precision
				__lowercase 			=							ceil(precision / 14							)
				__lowercase 			=							426880 * Decimal(10005							).sqrt()
				__lowercase 			=							1
				__lowercase 			=							13591409
				__lowercase 			=							Decimal(lowercase							)
				for k in range(1							,			lowercase							):
								__lowercase 			=							factorial(6 * k							) // (factorial(3 * k							) * factorial(lowercase							) ** 3)
								linear_term += 545140134
								exponential_term *= -262537412640768000
								partial_sum += Decimal(multinomial_term * linear_term							) / exponential_term
				return str(constant_term / partial_sum							)[:-1]


if __name__ == "__main__":
		__a  :     Optional[Any]       =  5_0
		print(F'''The first {n} digits of pi is: {pi(n)}''')