"""simple docstring"""






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


_A   					=    logging.get_logger(__name__)

_A   					=    {
    'shi-labs/nat-mini-in1k-224': 'https://huggingface.co/shi-labs/nat-mini-in1k-224/resolve/main/config.json',
    # See all Nat models at https://huggingface.co/models?filter=nat
}

class lowerCamelCase		(snake_case__    ,    snake_case__      ):






					'''simple docstring'''


					a   	=		"nat"

					a   	=		{
					    "num_attention_heads": "num_heads",
					    "num_hidden_layers": "num_layers",
					}



					def __init__(						self			:				Dict   , _snake_case			:				Optional[int]=4   , _snake_case			:				List[str]=3   , _snake_case			:				Optional[Any]=64   , _snake_case			:				Optional[int]=[3, 4, 6, 5]   , _snake_case			:				Tuple=[2, 4, 8, 16]   , _snake_case			:				Any=7   , _snake_case			:				Optional[int]=3.0   , _snake_case			:				Dict=True   , _snake_case			:				List[str]=0.0   , _snake_case			:				str=0.0   , _snake_case			:				Any=0.1   , _snake_case			:				Dict="gelu"   , _snake_case			:				Tuple=0.02   , _snake_case			:				Tuple=1e-5   , _snake_case			:				List[str]=0.0   , _snake_case			:				Union[str, Any]=None   , _snake_case			:				Union[str, Any]=None   , **_snake_case			:				Tuple   , )							->       int:
									super().__init__(**lowercase_		)

									SCREAMING_SNAKE_CASE__		  =				patch_size
									SCREAMING_SNAKE_CASE__		  =				num_channels
									SCREAMING_SNAKE_CASE__		  =				embed_dim
									SCREAMING_SNAKE_CASE__		  =				depths
									SCREAMING_SNAKE_CASE__		  =				len(lowercase_		)
									SCREAMING_SNAKE_CASE__		  =				num_heads
									SCREAMING_SNAKE_CASE__		  =				kernel_size
									SCREAMING_SNAKE_CASE__		  =				mlp_ratio
									SCREAMING_SNAKE_CASE__		  =				qkv_bias
									SCREAMING_SNAKE_CASE__		  =				hidden_dropout_prob
									SCREAMING_SNAKE_CASE__		  =				attention_probs_dropout_prob
									SCREAMING_SNAKE_CASE__		  =				drop_path_rate
									SCREAMING_SNAKE_CASE__		  =				hidden_act
									SCREAMING_SNAKE_CASE__		  =				layer_norm_eps
									SCREAMING_SNAKE_CASE__		  =				initializer_range
									# we set the hidden_size attribute in order to make Nat work with VisionEncoderDecoderModel
									# this indicates the channel dimension after the last stage of the model
									SCREAMING_SNAKE_CASE__		  =				int(embed_dim * 2 ** (len(lowercase_		) - 1)		)
									SCREAMING_SNAKE_CASE__		  =				layer_scale_init_value
									SCREAMING_SNAKE_CASE__		  =				["stem"] + [F"""stage{idx}""" for idx in range(1   , len(lowercase_		) + 1		)]
									SCREAMING_SNAKE_CASE__		  =				get_aligned_output_features_output_indices(
									    out_features=lowercase_   , out_indices=lowercase_   , stage_names=self.stage_names		)





"""simple docstring"""






from typing import TYPE_CHECKING

from ....utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


_A   					=    {'configuration_van': ['VAN_PRETRAINED_CONFIG_ARCHIVE_MAP', 'VanConfig']}


try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						_A   					=    [
						    'VAN_PRETRAINED_MODEL_ARCHIVE_LIST',
						    'VanForImageClassification',
						    'VanModel',
						    'VanPreTrainedModel',
						]

if TYPE_CHECKING:
						from .configuration_van import VAN_PRETRAINED_CONFIG_ARCHIVE_MAP, VanConfig

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_van import (
												    VAN_PRETRAINED_MODEL_ARCHIVE_LIST,
												    VanForImageClassification,
												    VanModel,
												    VanPreTrainedModel,
												)

else:
						import sys

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




