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


_snake_case				:   Any     =				logging.get_logger(__name__)

_snake_case				:   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 			lowerCAmelCase (				__UpperCAmelCase		,     __UpperCAmelCase			):
		a							:					Union[str, Any]       =					"""dinat"""

		a							:					Dict       =					{
		    """num_attention_heads""": """num_heads""",
		    """num_hidden_layers""": """num_layers""",
		}




		def __init__(				self					,						UpperCamelCase=4					,						UpperCamelCase=3					,						UpperCamelCase=64					,						UpperCamelCase=[3, 4, 6, 5]					,						UpperCamelCase=[2, 4, 8, 16]					,						UpperCamelCase=7					,						UpperCamelCase=[[1, 8, 1], [1, 4, 1, 4], [1, 2, 1, 2, 1, 2], [1, 1, 1, 1, 1]]					,						UpperCamelCase=3.0					,						UpperCamelCase=True					,						UpperCamelCase=0.0					,						UpperCamelCase=0.0					,						UpperCamelCase=0.1					,						UpperCamelCase="gelu"					,						UpperCamelCase=0.02					,						UpperCamelCase=1e-5					,						UpperCamelCase=0.0					,						UpperCamelCase=None					,						UpperCamelCase=None					,						**UpperCamelCase					,						):
								super().__init__(**UpperCamelCase      )

								_SCREAMING_SNAKE_CASE				= patch_size
								_SCREAMING_SNAKE_CASE				= num_channels
								_SCREAMING_SNAKE_CASE				= embed_dim
								_SCREAMING_SNAKE_CASE				= depths
								_SCREAMING_SNAKE_CASE				= len(UpperCamelCase      )
								_SCREAMING_SNAKE_CASE				= num_heads
								_SCREAMING_SNAKE_CASE				= kernel_size
								_SCREAMING_SNAKE_CASE				= dilations
								_SCREAMING_SNAKE_CASE				= mlp_ratio
								_SCREAMING_SNAKE_CASE				= qkv_bias
								_SCREAMING_SNAKE_CASE				= hidden_dropout_prob
								_SCREAMING_SNAKE_CASE				= attention_probs_dropout_prob
								_SCREAMING_SNAKE_CASE				= drop_path_rate
								_SCREAMING_SNAKE_CASE				= hidden_act
								_SCREAMING_SNAKE_CASE				= layer_norm_eps
								_SCREAMING_SNAKE_CASE				= 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(embed_dim * 2 ** (len(UpperCamelCase      ) - 1)      )
								_SCREAMING_SNAKE_CASE				= layer_scale_init_value
								_SCREAMING_SNAKE_CASE				= ["stem"] + [F'stage{idx}' for idx in range(1					,						len(UpperCamelCase      ) + 1      )]
								_SCREAMING_SNAKE_CASE,							_SCREAMING_SNAKE_CASE				= get_aligned_output_features_output_indices(
								    out_features=UpperCamelCase					,						out_indices=UpperCamelCase					,						stage_names=self.stage_names      )

'''simple docstring'''







from collections import OrderedDict
from typing import Mapping

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


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

_snake_case				:   int     =				{
    """YituTech/conv-bert-base""": """https://huggingface.co/YituTech/conv-bert-base/resolve/main/config.json""",
    """YituTech/conv-bert-medium-small""": (
        """https://huggingface.co/YituTech/conv-bert-medium-small/resolve/main/config.json"""
    ),
    """YituTech/conv-bert-small""": """https://huggingface.co/YituTech/conv-bert-small/resolve/main/config.json""",
    # See all ConvBERT models at https://huggingface.co/models?filter=convbert
}


class 			lowerCAmelCase (				__UpperCAmelCase			):
		a							:					Tuple       =					"""convbert"""




		def __init__(				self					,						UpperCamelCase=30_522					,						UpperCamelCase=768					,						UpperCamelCase=12					,						UpperCamelCase=12					,						UpperCamelCase=3_072					,						UpperCamelCase="gelu"					,						UpperCamelCase=0.1					,						UpperCamelCase=0.1					,						UpperCamelCase=512					,						UpperCamelCase=2					,						UpperCamelCase=0.02					,						UpperCamelCase=1e-12					,						UpperCamelCase=1					,						UpperCamelCase=0					,						UpperCamelCase=2					,						UpperCamelCase=768					,						UpperCamelCase=2					,						UpperCamelCase=9					,						UpperCamelCase=1					,						UpperCamelCase=None					,						**UpperCamelCase					,						):
								super().__init__(
								    pad_token_id=UpperCamelCase					,						bos_token_id=UpperCamelCase					,						eos_token_id=UpperCamelCase					,						**UpperCamelCase					,						)

								_SCREAMING_SNAKE_CASE				= vocab_size
								_SCREAMING_SNAKE_CASE				= hidden_size
								_SCREAMING_SNAKE_CASE				= num_hidden_layers
								_SCREAMING_SNAKE_CASE				= num_attention_heads
								_SCREAMING_SNAKE_CASE				= intermediate_size
								_SCREAMING_SNAKE_CASE				= hidden_act
								_SCREAMING_SNAKE_CASE				= hidden_dropout_prob
								_SCREAMING_SNAKE_CASE				= attention_probs_dropout_prob
								_SCREAMING_SNAKE_CASE				= max_position_embeddings
								_SCREAMING_SNAKE_CASE				= type_vocab_size
								_SCREAMING_SNAKE_CASE				= initializer_range
								_SCREAMING_SNAKE_CASE				= layer_norm_eps
								_SCREAMING_SNAKE_CASE				= embedding_size
								_SCREAMING_SNAKE_CASE				= head_ratio
								_SCREAMING_SNAKE_CASE				= conv_kernel_size
								_SCREAMING_SNAKE_CASE				= num_groups
								_SCREAMING_SNAKE_CASE				= classifier_dropout


class 			lowerCAmelCase (				__UpperCAmelCase			):




		@property
		def     lowercase       (				self      ):
								if self.task == "multiple-choice":
														_SCREAMING_SNAKE_CASE				= {0: "batch", 1: "choice", 2: "sequence"}
								else:
														_SCREAMING_SNAKE_CASE				= {0: "batch", 1: "sequence"}
								return OrderedDict(
								    [
								        ("input_ids", dynamic_axis),
								        ("attention_mask", dynamic_axis),
								        ("token_type_ids", dynamic_axis),
								    ]      )