




"""simple docstring"""



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


SCREAMING_SNAKE_CASE    =	logging.get_logger(__name__)

SCREAMING_SNAKE_CASE    =	{
    "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_  (						A_,       A_							):
    lowercase__						 =				'''dinat'''

    lowercase__						 =				{
        '''num_attention_heads''': '''num_heads''',
        '''num_hidden_layers''': '''num_layers''',
    }




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




     '''simple docstring'''

     super().__init__(**snake_case_				)

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











"""simple docstring"""



import baseaa







def   _SCREAMING_SNAKE_CASE       (							lowercase_						)						->		bytes:
 return baseaa.aaaencode(string.encode("utf-8"						)						)







def   _SCREAMING_SNAKE_CASE       (							lowercase_						)						->		str:
 return baseaa.aaadecode(lowercase_						).decode("utf-8"						)


if __name__ == "__main__":
      import doctest

      doctest.testmod()





