



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


lowerCamelCase__			= logging.get_logger(__name__)

lowerCamelCase__			= {
    """shi-labs/dinat-mini-in1k-224""": """https://huggingface.co/shi-labs/dinat-mini-in1k-224/resolve/main/config.json""",
    # See all Dinat models at https://huggingface.co/models?filter=dinat
}






class    SCREAMING_SNAKE_CASE			(							lowerCamelCase__			,      lowerCamelCase__					):
							__lowerCamelCase	:	Optional[Any]    ='dinat'

							__lowerCamelCase	:	List[Any]    ={
							    'num_attention_heads': 'num_heads',
							    'num_hidden_layers': 'num_layers',
							}





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

											'''simple docstring'''
											super().__init__(**__lowercase	)

											__a       =		patch_size
											__a       =		num_channels
											__a       =		embed_dim
											__a       =		depths
											__a       =		len(__lowercase	)
											__a       =		num_heads
											__a       =		kernel_size
											__a       =		dilations
											__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 Dinat work with VisionEncoderDecoderModel
											# this indicates the channel dimension after the last stage of the model
											__a       =		int(embed_dim * 2 ** (len(__lowercase	) - 1)	)
											__a       =		layer_scale_init_value
											__a       =		["""stem"""] + [F"stage{idx}" for idx in range(1      ,				len(__lowercase	) + 1	)]
											__a     ,					__a       =		get_aligned_output_features_output_indices(
											    out_features=__lowercase      ,				out_indices=__lowercase      ,				stage_names=self.stage_names	)





from typing import TYPE_CHECKING

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


lowerCamelCase__			= {"""configuration_mbart""": ["""MBART_PRETRAINED_CONFIG_ARCHIVE_MAP""", """MBartConfig""", """MBartOnnxConfig"""]}

try:
						if not is_sentencepiece_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						lowerCamelCase__			= ["""MBartTokenizer"""]

try:
						if not is_tokenizers_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						lowerCamelCase__			= ["""MBartTokenizerFast"""]

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						lowerCamelCase__			= [
						    """MBART_PRETRAINED_MODEL_ARCHIVE_LIST""",
						    """MBartForCausalLM""",
						    """MBartForConditionalGeneration""",
						    """MBartForQuestionAnswering""",
						    """MBartForSequenceClassification""",
						    """MBartModel""",
						    """MBartPreTrainedModel""",
						]

try:
						if not is_tf_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						lowerCamelCase__			= [
						    """TFMBartForConditionalGeneration""",
						    """TFMBartModel""",
						    """TFMBartPreTrainedModel""",
						]

try:
						if not is_flax_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						lowerCamelCase__			= [
						    """FlaxMBartForConditionalGeneration""",
						    """FlaxMBartForQuestionAnswering""",
						    """FlaxMBartForSequenceClassification""",
						    """FlaxMBartModel""",
						    """FlaxMBartPreTrainedModel""",
						]


if TYPE_CHECKING:
						from .configuration_mbart import MBART_PRETRAINED_CONFIG_ARCHIVE_MAP, MBartConfig, MBartOnnxConfig

						try:
												if not is_sentencepiece_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .tokenization_mbart import MBartTokenizer

						try:
												if not is_tokenizers_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .tokenization_mbart_fast import MBartTokenizerFast

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_mbart import (
												    MBART_PRETRAINED_MODEL_ARCHIVE_LIST,
												    MBartForCausalLM,
												    MBartForConditionalGeneration,
												    MBartForQuestionAnswering,
												    MBartForSequenceClassification,
												    MBartModel,
												    MBartPreTrainedModel,
												)

						try:
												if not is_tf_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_tf_mbart import TFMBartForConditionalGeneration, TFMBartModel, TFMBartPreTrainedModel

						try:
												if not is_flax_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_flax_mbart import (
												    FlaxMBartForConditionalGeneration,
												    FlaxMBartForQuestionAnswering,
												    FlaxMBartForSequenceClassification,
												    FlaxMBartModel,
												    FlaxMBartPreTrainedModel,
												)

else:
						import sys

						lowerCamelCase__			= _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)
