



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


__lowerCamelCase     :							List[Any]  							=				logging.get_logger(__name__)

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





class  __magic_name__   (							A__,  A__						):
		lowercase      :       Tuple          ='''convnextv2'''






		def __init__(						self      :     Dict				,		UpperCamelCase__      :     Optional[int]=3				,		UpperCamelCase__      :     List[str]=4				,		UpperCamelCase__      :     Tuple=4				,		UpperCamelCase__      :     List[str]=None				,		UpperCamelCase__      :     Any=None				,		UpperCamelCase__      :     Optional[Any]="gelu"				,		UpperCamelCase__      :     Tuple=0.02				,		UpperCamelCase__      :     Union[str, Any]=1e-1_2				,		UpperCamelCase__      :     Tuple=0.0				,		UpperCamelCase__      :     Any=2_24				,		UpperCamelCase__      :     Tuple=None				,		UpperCamelCase__      :     Optional[Any]=None				,		**UpperCamelCase__      :     Any				,		)				->					str:
								'''simple docstring'''







								super().__init__(**UpperCamelCase__      )

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








from typing import TYPE_CHECKING

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


__lowerCamelCase     :							Any  							=				{
    "configuration_mega": ["MEGA_PRETRAINED_CONFIG_ARCHIVE_MAP", "MegaConfig", "MegaOnnxConfig"],
}

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		__lowerCamelCase     :							Optional[int]  							=				[
		    "MEGA_PRETRAINED_MODEL_ARCHIVE_LIST",
		    "MegaForCausalLM",
		    "MegaForMaskedLM",
		    "MegaForMultipleChoice",
		    "MegaForQuestionAnswering",
		    "MegaForSequenceClassification",
		    "MegaForTokenClassification",
		    "MegaModel",
		    "MegaPreTrainedModel",
		]

if TYPE_CHECKING:
		from .configuration_mega import MEGA_PRETRAINED_CONFIG_ARCHIVE_MAP, MegaConfig, MegaOnnxConfig

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_mega import (
				    MEGA_PRETRAINED_MODEL_ARCHIVE_LIST,
				    MegaForCausalLM,
				    MegaForMaskedLM,
				    MegaForMultipleChoice,
				    MegaForQuestionAnswering,
				    MegaForSequenceClassification,
				    MegaForTokenClassification,
				    MegaModel,
				    MegaPreTrainedModel,
				)

else:
		import sys

		__lowerCamelCase     :							int  							=				_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)



