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


a							=logging.get_logger(__name__)

a							={
    '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        __UpperCAmelCase						(     __lowerCAmelCase				,				__lowerCAmelCase     ):
				A__				:       List[str]  							=	'''convnext'''

				def __init__(				self     ,			_lowerCamelCase=3     ,			_lowerCamelCase=4     ,			_lowerCamelCase=4     ,			_lowerCamelCase=None     ,			_lowerCamelCase=None     ,			_lowerCamelCase="gelu"     ,			_lowerCamelCase=0.0_2     ,			_lowerCamelCase=1E-12     ,			_lowerCamelCase=1E-6     ,			_lowerCamelCase=0.0     ,			_lowerCamelCase=224     ,			_lowerCamelCase=None     ,			_lowerCamelCase=None     ,			**_lowerCamelCase     ,			):
										super().__init__(**_lowerCamelCase				)

										lowerCamelCase__ =num_channels
										lowerCamelCase__ =patch_size
										lowerCamelCase__ =num_stages
										lowerCamelCase__ =[96, 192, 384, 768] if hidden_sizes is None else hidden_sizes
										lowerCamelCase__ =[3, 3, 9, 3] if depths is None else depths
										lowerCamelCase__ =hidden_act
										lowerCamelCase__ =initializer_range
										lowerCamelCase__ =layer_norm_eps
										lowerCamelCase__ =layer_scale_init_value
										lowerCamelCase__ =drop_path_rate
										lowerCamelCase__ =image_size
										lowerCamelCase__ =["stem"] + [F'''stage{idx}''' for idx in range(1     ,			len(self.depths				) + 1				)]
										lowerCamelCase__ ,				lowerCamelCase__ =get_aligned_output_features_output_indices(
										    out_features=_lowerCamelCase     ,			out_indices=_lowerCamelCase     ,			stage_names=self.stage_names				)






class        __UpperCAmelCase						(     __lowerCAmelCase     ):
				A__				:       int  							=	version.parse('''1.11'''     )

				@property
				def 		_a     (				self				):
										return OrderedDict(
										    [
										        ("pixel_values", {0: "batch", 1: "num_channels", 2: "height", 3: "width"}),
										    ]				)






				@property
				def 		_a     (				self				):
										return 1E-5



"""simple docstring"""


from __future__ import annotations





def       lowerCamelCase_			( __lowerCAmelCase    )							-> int | float:




						'''simple docstring'''



						lowerCamelCase__ =sorted(__lowerCAmelCase    )
						lowerCamelCase__ =len(__lowerCAmelCase    )
						lowerCamelCase__ =length >> 1
						return (
						    (sorted_list[mid_index] + sorted_list[mid_index - 1]) / 2
						    if length % 2 == 0
						    else sorted_list[mid_index]
						)





def       lowerCamelCase_			( )							-> Tuple:




						'''simple docstring'''



						import doctest

						doctest.testmod()


if __name__ == "__main__":
	main()


