


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/nat-mini-in1k-224''': '''https://huggingface.co/shi-labs/nat-mini-in1k-224/resolve/main/config.json''',
    # See all Nat models at https://huggingface.co/models?filter=nat
}




class 		a__    (							a__    ,    a__  ):





							'''simple docstring'''






							lowercase__      :       List[Any]     						=				"nat"

							lowercase__      :       List[str]     						=				{
							    "num_attention_heads": "num_heads",
							    "num_hidden_layers": "num_layers",
							}







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

														lowerCAmelCase__	       =     patch_size
														lowerCAmelCase__	       =     num_channels
														lowerCAmelCase__	       =     embed_dim
														lowerCAmelCase__	       =     depths
														lowerCAmelCase__	       =     len(lowerCamelCase_       )
														lowerCAmelCase__	       =     num_heads
														lowerCAmelCase__	       =     kernel_size
														lowerCAmelCase__	       =     mlp_ratio
														lowerCAmelCase__	       =     qkv_bias
														lowerCAmelCase__	       =     hidden_dropout_prob
														lowerCAmelCase__	       =     attention_probs_dropout_prob
														lowerCAmelCase__	       =     drop_path_rate
														lowerCAmelCase__	       =     hidden_act
														lowerCAmelCase__	       =     layer_norm_eps
														lowerCAmelCase__	       =     initializer_range
														# we set the hidden_size attribute in order to make Nat work with VisionEncoderDecoderModel
														# this indicates the channel dimension after the last stage of the model
														lowerCAmelCase__	       =     int(embed_dim * 2 ** (len(lowerCamelCase_       ) - 1)       )
														lowerCAmelCase__	       =     layer_scale_init_value
														lowerCAmelCase__	       =     ['''stem'''] + [F"""stage{idx}""" for idx in range(1 ,   len(lowerCamelCase_       ) + 1       )]
														lowerCAmelCase__       , lowerCAmelCase__	       =     get_aligned_output_features_output_indices(
														    out_features=lowerCamelCase_ ,   out_indices=lowerCamelCase_ ,   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


__UpperCAmelCase       =							logging.get_logger(__name__)

__UpperCAmelCase       =							{
    '''distilbert-base-uncased''': '''https://huggingface.co/distilbert-base-uncased/resolve/main/config.json''',
    '''distilbert-base-uncased-distilled-squad''': (
        '''https://huggingface.co/distilbert-base-uncased-distilled-squad/resolve/main/config.json'''
    ),
    '''distilbert-base-cased''': '''https://huggingface.co/distilbert-base-cased/resolve/main/config.json''',
    '''distilbert-base-cased-distilled-squad''': (
        '''https://huggingface.co/distilbert-base-cased-distilled-squad/resolve/main/config.json'''
    ),
    '''distilbert-base-german-cased''': '''https://huggingface.co/distilbert-base-german-cased/resolve/main/config.json''',
    '''distilbert-base-multilingual-cased''': (
        '''https://huggingface.co/distilbert-base-multilingual-cased/resolve/main/config.json'''
    ),
    '''distilbert-base-uncased-finetuned-sst-2-english''': (
        '''https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english/resolve/main/config.json'''
    ),
}




class 		a__    (							a__  ):





							'''simple docstring'''






							lowercase__      :       Optional[Any]     						=				"distilbert"
							lowercase__      :       Tuple     						=				{
							    "hidden_size": "dim",
							    "num_attention_heads": "n_heads",
							    "num_hidden_layers": "n_layers",
							}







							def __init__(		self ,   lowerCamelCase_=3_05_22 ,   lowerCamelCase_=5_12 ,   lowerCamelCase_=False ,   lowerCamelCase_=6 ,   lowerCamelCase_=12 ,   lowerCamelCase_=7_68 ,   lowerCamelCase_=4 * 7_68 ,   lowerCamelCase_=0.1 ,   lowerCamelCase_=0.1 ,   lowerCamelCase_="gelu" ,   lowerCamelCase_=0.02 ,   lowerCamelCase_=0.1 ,   lowerCamelCase_=0.2 ,   lowerCamelCase_=0 ,   **lowerCamelCase_ ,   )	->							Any:
														lowerCAmelCase__	       =     vocab_size
														lowerCAmelCase__	       =     max_position_embeddings
														lowerCAmelCase__	       =     sinusoidal_pos_embds
														lowerCAmelCase__	       =     n_layers
														lowerCAmelCase__	       =     n_heads
														lowerCAmelCase__	       =     dim
														lowerCAmelCase__	       =     hidden_dim
														lowerCAmelCase__	       =     dropout
														lowerCAmelCase__	       =     attention_dropout
														lowerCAmelCase__	       =     activation
														lowerCAmelCase__	       =     initializer_range
														lowerCAmelCase__	       =     qa_dropout
														lowerCAmelCase__	       =     seq_classif_dropout
														super().__init__(**lowerCamelCase_ ,   pad_token_id=lowerCamelCase_       )




class 		a__    (							a__  ):





							'''simple docstring'''






							@property
							def   __SCREAMING_SNAKE_CASE							(		self       )	->							Mapping[str, Mapping[int, str]]:
														if self.task == "multiple-choice":
																					lowerCAmelCase__	       =     {0: '''batch''', 1: '''choice''', 2: '''sequence'''}
														else:
																					lowerCAmelCase__	       =     {0: '''batch''', 1: '''sequence'''}
														return OrderedDict(
														    [
														        ('''input_ids''', dynamic_axis),
														        ('''attention_mask''', dynamic_axis),
														    ]       )