


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


lowerCAmelCase	=							logging.get_logger(__name__)

lowerCAmelCase	=							{
    '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 	_a							(      UpperCamelCase__					,     UpperCamelCase__      ):
							_lowercase     :      Tuple  				=			'''dinat'''

							_lowercase     :      List[str]  				=			{
							    '''num_attention_heads''': '''num_heads''',
							    '''num_hidden_layers''': '''num_layers''',
							}

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





									"""simple docstring"""







									super().__init__(**UpperCamelCase_							)

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






import logging

from transformers import PretrainedConfig


lowerCAmelCase	=							logging.getLogger(__name__)


lowerCAmelCase	=							{
    'bertabs-finetuned-cnndm': 'https://huggingface.co/remi/bertabs-finetuned-cnndm-extractive-abstractive-summarization/resolve/main/config.json',
}


class 	_a							(      UpperCamelCase__      ):
							_lowercase     :      List[Any]  				=			'''bertabs'''

							def __init__(							self:     List[str]   ,						UpperCamelCase_:     Dict=30_522   ,						UpperCamelCase_:     Union[str, Any]=512   ,						UpperCamelCase_:     Optional[int]=6   ,						UpperCamelCase_:     int=512   ,						UpperCamelCase_:     Optional[int]=8   ,						UpperCamelCase_:     List[Any]=512   ,						UpperCamelCase_:     Tuple=0.2   ,						UpperCamelCase_:     List[Any]=6   ,						UpperCamelCase_:     Tuple=768   ,						UpperCamelCase_:     List[Any]=8   ,						UpperCamelCase_:     Union[str, Any]=2_048   ,						UpperCamelCase_:     str=0.2   ,						**UpperCamelCase_:     Any   ,						)      ->       List[str]:





									"""simple docstring"""







									super().__init__(**UpperCamelCase_							)

									lowercase__						=				vocab_size
									lowercase__						=				max_pos

									lowercase__						=				enc_layers
									lowercase__						=				enc_hidden_size
									lowercase__						=				enc_heads
									lowercase__						=				enc_ff_size
									lowercase__						=				enc_dropout

									lowercase__						=				dec_layers
									lowercase__						=				dec_hidden_size
									lowercase__						=				dec_heads
									lowercase__						=				dec_ff_size
									lowercase__						=				dec_dropout


