

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


lowerCAmelCase							:  Union[str, Any]   	=						logging.get_logger(__name__)

lowerCAmelCase							:  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   __lowercase				( UpperCAmelCase_		,       UpperCAmelCase_	):




			"""simple docstring"""







			_UpperCAmelCase   :							Tuple										=     '''dinat'''

			_UpperCAmelCase   :							Union[str, Any]										=     {
			    '''num_attention_heads''': '''num_heads''',
			    '''num_hidden_layers''': '''num_layers''',
			}



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

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












from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


__UpperCamelCase					:       Optional[Any]    					=      {
    "configuration_jukebox": [
        "JUKEBOX_PRETRAINED_CONFIG_ARCHIVE_MAP",
        "JukeboxConfig",
        "JukeboxPriorConfig",
        "JukeboxVQVAEConfig",
    ],
    "tokenization_jukebox": ["JukeboxTokenizer"],
}

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		__UpperCamelCase					:       Tuple    					=      [
		    "JUKEBOX_PRETRAINED_MODEL_ARCHIVE_LIST",
		    "JukeboxModel",
		    "JukeboxPreTrainedModel",
		    "JukeboxVQVAE",
		    "JukeboxPrior",
		]

if TYPE_CHECKING:
		from .configuration_jukebox import (
		    JUKEBOX_PRETRAINED_CONFIG_ARCHIVE_MAP,
		    JukeboxConfig,
		    JukeboxPriorConfig,
		    JukeboxVQVAEConfig,
		)
		from .tokenization_jukebox import JukeboxTokenizer

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_jukebox import (
				    JUKEBOX_PRETRAINED_MODEL_ARCHIVE_LIST,
				    JukeboxModel,
				    JukeboxPreTrainedModel,
				    JukeboxPrior,
				    JukeboxVQVAE,
				)

else:
		import sys

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

