from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


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

lowerCamelCase_    :		Tuple							=	{
    """facebook/convnextv2-tiny-1k-224""": """https://huggingface.co/facebook/convnextv2-tiny-1k-224/resolve/main/config.json""",
}


class 						a__							(       __snake_case				,						__snake_case		):
			A__    :       Tuple        =      'convnextv2'



			def __init__(						self				,						UpperCAmelCase=3				,						UpperCAmelCase=4				,						UpperCAmelCase=4				,						UpperCAmelCase=None				,						UpperCAmelCase=None				,						UpperCAmelCase="gelu"				,						UpperCAmelCase=0.02				,						UpperCAmelCase=1e-12				,						UpperCAmelCase=0.0				,						UpperCAmelCase=2_2_4				,						UpperCAmelCase=None				,						UpperCAmelCase=None				,						**UpperCAmelCase				,						)			->   Optional[Any]:
								super().__init__(**UpperCAmelCase   )

								__a		 =       num_channels
								__a		 =       patch_size
								__a		 =       num_stages
								__a		 =       [9_6, 1_9_2, 3_8_4, 7_6_8] 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		 =       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   )





from typing import TYPE_CHECKING

from ...file_utils import _LazyModule, is_tokenizers_available, is_torch_available
from ...utils import OptionalDependencyNotAvailable


lowerCamelCase_    :		Union[str, Any]							=	{"""configuration_gpt_neox""": ["""GPT_NEOX_PRETRAINED_CONFIG_ARCHIVE_MAP""", """GPTNeoXConfig"""]}

try:
	if not is_tokenizers_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	lowerCamelCase_    :		Union[str, Any]							=	["""GPTNeoXTokenizerFast"""]

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	lowerCamelCase_    :		List[str]							=	[
	    """GPT_NEOX_PRETRAINED_MODEL_ARCHIVE_LIST""",
	    """GPTNeoXForCausalLM""",
	    """GPTNeoXForQuestionAnswering""",
	    """GPTNeoXForSequenceClassification""",
	    """GPTNeoXForTokenClassification""",
	    """GPTNeoXLayer""",
	    """GPTNeoXModel""",
	    """GPTNeoXPreTrainedModel""",
	]


if TYPE_CHECKING:
	from .configuration_gpt_neox import GPT_NEOX_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTNeoXConfig

	try:
		if not is_tokenizers_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .tokenization_gpt_neox_fast import GPTNeoXTokenizerFast

	try:
		if not is_torch_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_gpt_neox import (
		    GPT_NEOX_PRETRAINED_MODEL_ARCHIVE_LIST,
		    GPTNeoXForCausalLM,
		    GPTNeoXForQuestionAnswering,
		    GPTNeoXForSequenceClassification,
		    GPTNeoXForTokenClassification,
		    GPTNeoXLayer,
		    GPTNeoXModel,
		    GPTNeoXPreTrainedModel,
		)


else:
	import sys

	lowerCamelCase_    :		Dict							=	_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)




