



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


snake_case_         = logging.get_logger(__name__)

snake_case_         = {
    """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    A_    (  SCREAMING_SNAKE_CASE_			,     SCREAMING_SNAKE_CASE_       ):



						"""simple docstring"""
						__UpperCamelCase	       =							"""convnext"""






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

												UpperCAmelCase    =				num_channels
												UpperCAmelCase    =				patch_size
												UpperCAmelCase    =				num_stages
												UpperCAmelCase    =				[96, 1_92, 3_84, 7_68] if hidden_sizes is None else hidden_sizes
												UpperCAmelCase    =				[3, 3, 9, 3] if depths is None else depths
												UpperCAmelCase    =				hidden_act
												UpperCAmelCase    =				initializer_range
												UpperCAmelCase    =				layer_norm_eps
												UpperCAmelCase    =				layer_scale_init_value
												UpperCAmelCase    =				drop_path_rate
												UpperCAmelCase    =				image_size
												UpperCAmelCase    =				['stem'] + [f"""stage{idx}""" for idx in range(1     ,						len(self.depths      ) + 1      )]
												UpperCAmelCase   ,					UpperCAmelCase    =				get_aligned_output_features_output_indices(
												    out_features=lowercase_     ,						out_indices=lowercase_     ,						stage_names=self.stage_names      )







class    A_    (  SCREAMING_SNAKE_CASE_       ):



						"""simple docstring"""
						__UpperCamelCase	       =							version.parse("""1.11"""       )






						@property
						def 			UpperCAmelCase__  (      self				:Union[str, Any]      )       ->    Mapping[str, Mapping[int, str]]:
												return OrderedDict(
												    [
												        ('pixel_values', {0: 'batch', 1: 'num_channels', 2: 'height', 3: 'width'}),
												    ]      )






						@property
						def 			UpperCAmelCase__  (      self				:Any      )       ->    float:
												return 1E-5










"""simple docstring"""


def 				_lowerCAmelCase   (     lowercase_	,			lowercase_		):
						UpperCAmelCase    =				1.0
						for i in range(1	,			r + 1		):
												ret *= (n + 1 - i) / i
						return round(lowercase_		)

def 				_lowerCAmelCase   (     lowercase_		):
						return choose(8 + n	,			lowercase_		) + choose(9 + n	,			lowercase_		) - 10

def 				_lowerCAmelCase   (     lowercase_		):
						return sum(non_bouncy_exact(lowercase_		) for i in range(1	,			n + 1		)		)

def 				_lowerCAmelCase   (     lowercase_ = 100		):
						return non_bouncy_upto(lowercase_		)


if __name__ == "__main__":
				print(f'''{solution() = }''')





