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


__SCREAMING_SNAKE_CASE  =			logging.get_logger(__name__)

__SCREAMING_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 						__snake_case (						_a				, _a  ):
		a_        =				"convnext"




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






								'''simple docstring'''






								super().__init__(**_SCREAMING_SNAKE_CASE)

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







class 						__snake_case (						_a  ):
		a_        =				version.parse("1.11"  )




		@property
		def   _snake_case  (     self				:Union[str, Any])				-> Mapping[str, Mapping[int, str]]:






								'''simple docstring'''






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





		@property
		def   _snake_case  (     self				:List[str])				-> float:






								'''simple docstring'''






								return 1E-5






'''simple docstring'''


from __future__ import annotations

from typing import Any




class 						__snake_case :




		def __init__(     self				:int ,						_SCREAMING_SNAKE_CASE				:Any ,						_SCREAMING_SNAKE_CASE				:Any)				-> None:  # noqa: A002






								'''simple docstring'''






								UpperCamelCase_    :  Optional[Any]				    =    item
								UpperCamelCase_    :  int				    =    next







class 						__snake_case :




		def __init__(     self				:Optional[Any])				-> None:






								'''simple docstring'''






								UpperCamelCase_    :  Node | None				    =    None
								UpperCamelCase_    :  Tuple				    =    0




		def   _snake_case  (     self				:List[Any] ,						_SCREAMING_SNAKE_CASE				:Any)				-> None:






								'''simple docstring'''






								UpperCamelCase_    :  List[Any]				    =    Node(_SCREAMING_SNAKE_CASE ,						self.head)
								self.size += 1




		def   _snake_case  (     self				:int)				-> Any:






								'''simple docstring'''






								if self.head is None:
														return None
								else:
														UpperCamelCase_    :  Any				    =    self.head.item
														UpperCamelCase_    :  List[str]				    =    self.head.next
														self.size -= 1
														return item




		def   _snake_case  (     self				:int)				-> bool:






								'''simple docstring'''






								return self.head is None




		def __str__(     self				:Any)				-> str:






								'''simple docstring'''






								if self.is_empty():
														return ""
								else:
														UpperCamelCase_    :  List[str]				    =    self.head
														UpperCamelCase_    :  Tuple				    =    """"""
														UpperCamelCase_    :  list[str]				    =    []
														while iterate:
																				item_list.append(str(iterate.item))
																				UpperCamelCase_    :  Tuple				    =    iterate.next

														UpperCamelCase_    :  Optional[int]				    =    """ --> """.join(_SCREAMING_SNAKE_CASE)

														return item_str





		def __len__(     self				:List[Any])				-> int:






								'''simple docstring'''






								return self.size




