



'''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[Any]												=				logging.get_logger(__name__)

UpperCamelCase__ :			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 		_UpperCamelCase						(							lowerCamelCase__					,      lowerCamelCase__					):


			'''simple docstring'''

			_A   :	Optional[int]    					=	'''dinat'''

			_A   :	Optional[Any]    					=	{
			    '''num_attention_heads''': '''num_heads''',
			    '''num_hidden_layers''': '''num_layers''',
			}

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





					"""simple docstring"""






					super().__init__(**lowerCAmelCase__		)

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










'''simple docstring'''




from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


UpperCamelCase__ :			Optional[int]												=				{'''configuration_wavlm''': ['''WAVLM_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''WavLMConfig''']}

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						UpperCamelCase__ :			Tuple												=				[
						    '''WAVLM_PRETRAINED_MODEL_ARCHIVE_LIST''',
						    '''WavLMForAudioFrameClassification''',
						    '''WavLMForCTC''',
						    '''WavLMForSequenceClassification''',
						    '''WavLMForXVector''',
						    '''WavLMModel''',
						    '''WavLMPreTrainedModel''',
						]

if TYPE_CHECKING:
						from .configuration_wavlm import WAVLM_PRETRAINED_CONFIG_ARCHIVE_MAP, WavLMConfig

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_wavlm import (
												    WAVLM_PRETRAINED_MODEL_ARCHIVE_LIST,
												    WavLMForAudioFrameClassification,
												    WavLMForCTC,
												    WavLMForSequenceClassification,
												    WavLMForXVector,
												    WavLMModel,
												    WavLMPreTrainedModel,
												)

else:
						import sys

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