

'''simple docstring'''





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


UpperCamelCase_							=					logging.get_logger(__name__)

UpperCamelCase_							=					{
    """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       ( lowercase__	,       lowercase__			):
				lowerCamelCase_							=						'dinat'

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







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

										lowercase   :       Optional[int]								=patch_size
										lowercase   :       Dict								=num_channels
										lowercase   :       Dict								=embed_dim
										lowercase   :       Any								=depths
										lowercase   :       str								=len(UpperCAmelCase__      )
										lowercase   :       str								=num_heads
										lowercase   :       str								=kernel_size
										lowercase   :       str								=dilations
										lowercase   :       int								=mlp_ratio
										lowercase   :       int								=qkv_bias
										lowercase   :       Optional[Any]								=hidden_dropout_prob
										lowercase   :       Tuple								=attention_probs_dropout_prob
										lowercase   :       List[str]								=drop_path_rate
										lowercase   :       Dict								=hidden_act
										lowercase   :       str								=layer_norm_eps
										lowercase   :       Dict								=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
										lowercase   :       Union[str, Any]								=int(embed_dim * 2 ** (len(UpperCAmelCase__      ) - 1)      )
										lowercase   :       List[str]								=layer_scale_init_value
										lowercase   :       Tuple								=['''stem'''] + [F'''stage{idx}''' for idx in range(1		,				len(UpperCAmelCase__      ) + 1      )]
										lowercase		,  lowercase   :       str								=get_aligned_output_features_output_indices(
										    out_features=UpperCAmelCase__		,				out_indices=UpperCAmelCase__		,				stage_names=self.stage_names      )








'''simple docstring'''





import warnings

from ...utils import logging
from .image_processing_clip import CLIPImageProcessor


UpperCamelCase_							=					logging.get_logger(__name__)





class 		__SCREAMING_SNAKE_CASE       ( lowercase__			):







				def __init__(					self    :		Union[str, Any]		,				*UpperCAmelCase__    :		Dict		,				**UpperCAmelCase__    :		List[str]      ):
										'''simple docstring'''
										warnings.warn(
										    '''The class CLIPFeatureExtractor is deprecated and will be removed in version 5 of Transformers. Please'''
										    ''' use CLIPImageProcessor instead.'''		,				UpperCAmelCase__		,				)
										super().__init__(*UpperCAmelCase__		,				**UpperCAmelCase__      )





