


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


_UpperCAmelCase					:			Dict				     =					logging.get_logger(__name__)

_UpperCAmelCase					:			Any				     =					{
    """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"""



				__UpperCamelCase     :		Union[str, Any]						=						'''convnext'''




				def __init__(self							,      __lowercase=3							,      __lowercase=4							,      __lowercase=4							,      __lowercase=None							,      __lowercase=None							,      __lowercase="gelu"							,      __lowercase=0.0_2							,      __lowercase=1e-12							,      __lowercase=1e-6							,      __lowercase=0.0							,      __lowercase=2_24							,      __lowercase=None							,      __lowercase=None							,      **__lowercase							,      ):
										super().__init__(**_a		)

										__lowerCAmelCase											=					num_channels
										__lowerCAmelCase											=					patch_size
										__lowerCAmelCase											=					num_stages
										__lowerCAmelCase											=					[96, 1_92, 3_84, 7_68] 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											=					get_aligned_output_features_output_indices(
										    out_features=_a							,      out_indices=_a							,      stage_names=self.stage_names		)


class    a__					(			_snake_case   ):







				"""simple docstring"""



				__UpperCamelCase     :		Union[str, Any]						=						version.parse('1.11'   )




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




				@property
				def        _snake_case	(self		):
										return 1e-5


'''simple docstring'''




from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_torch_available,
)


_A										= {
    'configuration_rwkv': ['RWKV_PRETRAINED_CONFIG_ARCHIVE_MAP', 'RwkvConfig', 'RwkvOnnxConfig'],
}

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 _A										= [
     'RWKV_PRETRAINED_MODEL_ARCHIVE_LIST',
     'RwkvForCausalLM',
     'RwkvModel',
     'RwkvPreTrainedModel',
 ]


if TYPE_CHECKING:
 from .configuration_rwkv import RWKV_PRETRAINED_CONFIG_ARCHIVE_MAP, RwkvConfig, RwkvOnnxConfig

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_rwkv import (
      RWKV_PRETRAINED_MODEL_ARCHIVE_LIST,
      RwkvForCausalLM,
      RwkvModel,
      RwkvPreTrainedModel,
  )
else:
 import sys

 _A										= _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)




