




"""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
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


_lowerCamelCase	:      Tuple   =							logging.get_logger(__name__)

_lowerCamelCase	:      Optional[Any]   =							{
    'facebook/convnext-tiny-224': 'https://huggingface.co/facebook/convnext-tiny-224/resolve/main/config.json',
    # See all ConvNeXT models at https://huggingface.co/models?filter=convnext
}

class 							lowercase   (     __UpperCAmelCase  ,						__UpperCAmelCase):
				__lowerCAmelCase     :     Any								= """convnext"""







				def __init__(				self :       Optional[int]   ,  _lowerCamelCase :       Any=3   ,  _lowerCamelCase :       int=4   ,  _lowerCamelCase :       List[str]=4   ,  _lowerCamelCase :       List[Any]=None   ,  _lowerCamelCase :       Union[str, Any]=None   ,  _lowerCamelCase :       Tuple="gelu"   ,  _lowerCamelCase :       int=0.02   ,  _lowerCamelCase :       int=1E-12   ,  _lowerCamelCase :       Optional[Any]=1E-6   ,  _lowerCamelCase :       Union[str, Any]=0.0   ,  _lowerCamelCase :       str=2_24   ,  _lowerCamelCase :       List[Any]=None   ,  _lowerCamelCase :       Any=None   ,  **_lowerCamelCase :       Union[str, Any]   ,  ):



					"""simple docstring"""

					super().__init__(**_lowerCamelCase							)

					A_	:					List[Any]						 =		num_channels
					A_	:					str						 =		patch_size
					A_	:					Union[str, Any]						 =		num_stages
					A_	:					Union[str, Any]						 =		[96, 1_92, 3_84, 7_68] if hidden_sizes is None else hidden_sizes
					A_	:					str						 =		[3, 3, 9, 3] if depths is None else depths
					A_	:					Dict						 =		hidden_act
					A_	:					Union[str, Any]						 =		initializer_range
					A_	:					List[Any]						 =		layer_norm_eps
					A_	:					Union[str, Any]						 =		layer_scale_init_value
					A_	:					List[Any]						 =		drop_path_rate
					A_	:					Any						 =		image_size
					A_	:					Optional[int]						 =		['''stem'''] + [F"""stage{idx}""" for idx in range(1   ,  len(self.depths							) + 1							)]
					A_ ,			A_	:					Optional[int]						 =		get_aligned_output_features_output_indices(
					    out_features=_lowerCamelCase   ,  out_indices=_lowerCamelCase   ,  stage_names=self.stage_names							)

class 							lowercase   (     __UpperCAmelCase):
				__lowerCAmelCase     :     Tuple								= version.parse("""1.11""")







				@property
				def        a_	(				self :       List[Any]							):



					"""simple docstring"""

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







				@property
				def        a_	(				self :       str							):



					"""simple docstring"""

					return 1E-5











"""simple docstring"""

from __future__ import annotations

def 		lowercase_   (		_UpperCAmelCase	,   _UpperCAmelCase	,   _UpperCAmelCase						):




	"""simple docstring"""






	assert (
	    c % greatest_common_divisor(_UpperCAmelCase	,   _UpperCAmelCase						) == 0
	)  # greatest_common_divisor(a,b) function implemented below
	((A_) ,			(A_) ,			(A_))	:					List[Any]						 =		extended_gcd(_UpperCAmelCase	,   _UpperCAmelCase						)  # extended_gcd(a,b) function implemented below
	A_	:					int						 =		c / d
	return (r * x, r * y)

def 		lowercase_   (		_UpperCAmelCase	,   _UpperCAmelCase	,   _UpperCAmelCase	,   _UpperCAmelCase = 2						):




	"""simple docstring"""






	((A_) ,			(A_))	:					Any						 =		diophantine(_UpperCAmelCase	,   _UpperCAmelCase	,   _UpperCAmelCase						)  # Initial value
	A_	:					Union[str, Any]						 =		greatest_common_divisor(_UpperCAmelCase	,   _UpperCAmelCase						)
	A_	:					List[str]						 =		a // d
	A_	:					str						 =		b // d

	for i in range(_UpperCAmelCase						):
		A_	:					int						 =		xa + i * q
		A_	:					str						 =		ya - i * p
		print(_UpperCAmelCase	,   _UpperCAmelCase						)

def 		lowercase_   (		_UpperCAmelCase	,   _UpperCAmelCase						):




	"""simple docstring"""






	if a < b:
		A_ ,			A_	:					Tuple						 =		b, a

	while a % b != 0:
		A_ ,			A_	:					int						 =		b, a % b

	return b

def 		lowercase_   (		_UpperCAmelCase	,   _UpperCAmelCase						):




	"""simple docstring"""






	assert a >= 0 and b >= 0

	if b == 0:
		A_ ,			A_ ,			A_	:					str						 =		a, 1, 0
	else:
		((A_) ,			(A_) ,			(A_))	:					List[str]						 =		extended_gcd(_UpperCAmelCase	,   a % b						)
		A_	:					Optional[int]						 =		q
		A_	:					Tuple						 =		p - q * (a // b)

	assert a % d == 0 and b % d == 0
	assert d == a * x + b * y

	return (d, x, y)


if __name__ == "__main__":
		from doctest import testmod

		testmod(name='diophantine', verbose=True)
		testmod(name='diophantine_all_soln', verbose=True)
		testmod(name='extended_gcd', verbose=True)
		testmod(name='greatest_common_divisor', verbose=True)





