






from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


__UpperCAmelCase     							=						logging.get_logger(__name__)

__UpperCAmelCase     							=						{
    """facebook/convnextv2-tiny-1k-224""": """https://huggingface.co/facebook/convnextv2-tiny-1k-224/resolve/main/config.json""",
}



class 						lowerCamelCase				(lowerCAmelCase__			,  lowerCAmelCase__      ):







		'''simple docstring'''



		_snake_case   :   Optional[Any]							=  "convnextv2"



		def __init__(							self    ,		_UpperCamelCase=3    ,		_UpperCamelCase=4    ,		_UpperCamelCase=4    ,		_UpperCamelCase=None    ,		_UpperCamelCase=None    ,		_UpperCamelCase="gelu"    ,		_UpperCamelCase=0.02    ,		_UpperCamelCase=1E-12    ,		_UpperCamelCase=0.0    ,		_UpperCamelCase=2_2_4    ,		_UpperCamelCase=None    ,		_UpperCamelCase=None    ,		**_UpperCamelCase    ,		)     ->							Union[str, Any]:
							super().__init__(**a__       )

							UpperCAmelCase_   :				int						=						num_channels
							UpperCAmelCase_   :				Union[str, Any]						=						patch_size
							UpperCAmelCase_   :				Any						=						num_stages
							UpperCAmelCase_   :				int						=						[9_6, 1_9_2, 3_8_4, 7_6_8] if hidden_sizes is None else hidden_sizes
							UpperCAmelCase_   :				Optional[int]						=						[3, 3, 9, 3] if depths is None else depths
							UpperCAmelCase_   :				Union[str, Any]						=						hidden_act
							UpperCAmelCase_   :				List[str]						=						initializer_range
							UpperCAmelCase_   :				Any						=						layer_norm_eps
							UpperCAmelCase_   :				Any						=						drop_path_rate
							UpperCAmelCase_   :				List[str]						=						image_size
							UpperCAmelCase_   :				int						=						['stem'] + [f"stage{idx}" for idx in range(1    ,		len(self.depths       ) + 1       )]
							UpperCAmelCase_	,  UpperCAmelCase_   :				str						=						get_aligned_output_features_output_indices(
							    out_features=a__    ,		out_indices=a__    ,		stage_names=self.stage_names       )














def 					lowercase__				(					__snake_case   :							str					,	__snake_case   :							int					,	__snake_case   :							List[str]  ):


					'''simple docstring'''


					if n == 0:
										return 1

					elif n % 2 == 1:
										return (binary_exponentiation(__snake_case					,	n - 1					,	__snake_case  ) * a) % mod

					else:
										UpperCAmelCase_   :				Optional[int]						=						binary_exponentiation(__snake_case					,	n / 2					,	__snake_case  )
										return (b * b) % mod


# a prime number
__UpperCAmelCase     							=						701

__UpperCAmelCase     							=						1000000000
__UpperCAmelCase     							=						10

# using binary exponentiation function, O(log(p)):
print((a / b) % p == (a * binary_exponentiation(b, p - 2, p)) % p)






print((a / b) % p == (a * b ** (p - 2)) % p)






