






"""simple docstring"""







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


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

__a       :	List[Any]             = {
    '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						(  __snake_case       , __snake_case							):





							"""simple docstring"""





							_SCREAMING_SNAKE_CASE    ='dinat'

							_SCREAMING_SNAKE_CASE    ={
							    'num_attention_heads': 'num_heads',
							    'num_hidden_layers': 'num_layers',
							}




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

												'''simple docstring'''

												super().__init__(**__A    )

												a__          =  patch_size
												a__          =  num_channels
												a__          =  embed_dim
												a__          =  depths
												a__          =  len(__A    )
												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(__A    ) - 1)    )
												a__          =  layer_scale_init_value
												a__          =  ['''stem'''] + [F'stage{idx}' for idx in range(1				,		len(__A    ) + 1    )]
												a__       ,a__          =  get_aligned_output_features_output_indices(
												    out_features=__A				,		out_indices=__A				,		stage_names=self.stage_names    )










"""simple docstring"""







from typing import TYPE_CHECKING

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


__a       :	Tuple             = {'configuration_deit': ['DEIT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'DeiTConfig', 'DeiTOnnxConfig']}

try:
	if not is_vision_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	__a       :	Tuple             = ['DeiTFeatureExtractor']
	__a       :	Optional[Any]             = ['DeiTImageProcessor']

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	__a       :	Optional[int]             = [
	    'DEIT_PRETRAINED_MODEL_ARCHIVE_LIST',
	    'DeiTForImageClassification',
	    'DeiTForImageClassificationWithTeacher',
	    'DeiTForMaskedImageModeling',
	    'DeiTModel',
	    'DeiTPreTrainedModel',
	]

try:
	if not is_tf_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	__a       :	Dict             = [
	    'TF_DEIT_PRETRAINED_MODEL_ARCHIVE_LIST',
	    'TFDeiTForImageClassification',
	    'TFDeiTForImageClassificationWithTeacher',
	    'TFDeiTForMaskedImageModeling',
	    'TFDeiTModel',
	    'TFDeiTPreTrainedModel',
	]


if TYPE_CHECKING:
	from .configuration_deit import DEIT_PRETRAINED_CONFIG_ARCHIVE_MAP, DeiTConfig, DeiTOnnxConfig

	try:
		if not is_vision_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .feature_extraction_deit import DeiTFeatureExtractor
		from .image_processing_deit import DeiTImageProcessor

	try:
		if not is_torch_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_deit import (
		    DEIT_PRETRAINED_MODEL_ARCHIVE_LIST,
		    DeiTForImageClassification,
		    DeiTForImageClassificationWithTeacher,
		    DeiTForMaskedImageModeling,
		    DeiTModel,
		    DeiTPreTrainedModel,
		)

	try:
		if not is_tf_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_tf_deit import (
		    TF_DEIT_PRETRAINED_MODEL_ARCHIVE_LIST,
		    TFDeiTForImageClassification,
		    TFDeiTForImageClassificationWithTeacher,
		    TFDeiTForMaskedImageModeling,
		    TFDeiTModel,
		    TFDeiTPreTrainedModel,
		)


else:
	import sys

	__a       :	List[Any]             = _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)


