

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						:Optional[Any]            = logging.get_logger(__name__)

__a						: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      _a				( snake_case_    ,							snake_case_							):




      """simple docstring"""

      _lowerCamelCase					: Optional[Any]					=					'convnext'





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

            A_	     =							num_channels
            A_	     =							patch_size
            A_	     =							num_stages
            A_	     =							[96, 192, 384, 768] 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      _a				( snake_case_							):




      """simple docstring"""

      _lowerCamelCase					: List[str]					=					version.parse('1.11'							)





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







      @property
      def 		__A  (      self       :							Optional[int]  ):
            return 1E-5


import warnings

from ...utils import logging
from .image_processing_mobilenet_va import MobileNetVaImageProcessor


__a						:Optional[int]            = logging.get_logger(__name__)

class      _a				( snake_case_							):




      """simple docstring"""

      def __init__(      self       :							List[Any]	, *UpperCAmelCase       :							Any	, **UpperCAmelCase       :							int  ):
            warnings.warn(
                "The class MobileNetV2FeatureExtractor is deprecated and will be removed in version 5 of Transformers."
                " Please use MobileNetV2ImageProcessor instead."	, UpperCAmelCase	, )
            super().__init__(*UpperCAmelCase	, **UpperCAmelCase  )