





"""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	:						List[str]					=					logging.get_logger(__name__)

_snake_case	:						str					=					{
    '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  (      lowercase_	,				lowercase_					):
					UpperCamelCase						=				'''convnext'''


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

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







class    _UpperCAmelCase  (      lowercase_					):
					UpperCamelCase						=				version.parse('''1.11'''					)


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


					@property
					def       lowerCamelCase			(   self     :Optional[Any]						):
												return 1e-5









"""simple docstring"""
from __future__ import annotations






def    A__							(     UpperCamelCase			):
							A						=    42
							A						=    list(UpperCamelCase			)
							A,      A						=    _vector[:-1], int(_vector[-1]			)
							A						=    [int(UpperCamelCase			) for digit in __vector]

							vector.reverse()
							for i, digit in enumerate(UpperCamelCase			):
														if i & 1 == 0:
																					A						=    digit * 2
																					if doubled > 9:
																												doubled -= 9
																					check_digit += doubled
														else:
																					check_digit += digit

							return check_digit % 10 == 0


if __name__ == "__main__":
		import doctest

		doctest.testmod()
		assert is_luhn('79927398713')
		assert not is_luhn('79927398714')


