
"""simple docstring"""





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


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

UpperCamelCase_       :    List[str]						      =			{
    '''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					(       _lowercase  ,					_lowercase   ):




			"""simple docstring"""







			snake_case						   =					"nat"

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




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







								"""simple docstring"""
								super().__init__(**_snake_case						)

								A_								=    patch_size
								A_								=    num_channels
								A_								=    embed_dim
								A_								=    depths
								A_								=    len(_snake_case						)
								A_								=    num_heads
								A_								=    kernel_size
								A_								=    mlp_ratio
								A_								=    qkv_bias
								A_								=    hidden_dropout_prob
								A_								=    attention_probs_dropout_prob
								A_								=    drop_path_rate
								A_								=    hidden_act
								A_								=    layer_norm_eps
								A_								=    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
								A_								=    int(embed_dim * 2 ** (len(_snake_case						) - 1)						)
								A_								=    layer_scale_init_value
								A_								=    ["stem"] + [F'stage{idx}' for idx in range(1							, len(_snake_case						) + 1						)]
								A_			,     A_								=    get_aligned_output_features_output_indices(
								    out_features=_snake_case							, out_indices=_snake_case							, stage_names=self.stage_names						)






"""simple docstring"""





from typing import TYPE_CHECKING

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


UpperCamelCase_       :    Dict						      =			{'''configuration_plbart''': ['''PLBART_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''PLBartConfig''']}

try:
		if not is_sentencepiece_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		UpperCamelCase_       :    int						      =			['''PLBartTokenizer''']

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		UpperCamelCase_       :    Optional[int]						      =			[
		    '''PLBART_PRETRAINED_MODEL_ARCHIVE_LIST''',
		    '''PLBartForCausalLM''',
		    '''PLBartForConditionalGeneration''',
		    '''PLBartForSequenceClassification''',
		    '''PLBartModel''',
		    '''PLBartPreTrainedModel''',
		]


if TYPE_CHECKING:
		from .configuration_plbart import PLBART_PRETRAINED_CONFIG_ARCHIVE_MAP, PLBartConfig

		try:
				if not is_sentencepiece_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .tokenization_plbart import PLBartTokenizer

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_plbart import (
				    PLBART_PRETRAINED_MODEL_ARCHIVE_LIST,
				    PLBartForCausalLM,
				    PLBartForConditionalGeneration,
				    PLBartForSequenceClassification,
				    PLBartModel,
				    PLBartPreTrainedModel,
				)


else:
		import sys

		UpperCamelCase_       :    Optional[int]						      =			_LazyModule(__name__, globals()['''__file__'''], _import_structure)




