



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


a_								=       logging.get_logger(__name__)

a_								=       {
    """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 ):
 lowerCAmelCase__							       =	'''dinat'''

 lowerCAmelCase__							       =	{
     '''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						,					):



    '''simple docstring'''
    super().__init__(**lowerCamelCase__					)

    __lowerCamelCase    				=     patch_size
    __lowerCamelCase    				=     num_channels
    __lowerCamelCase    				=     embed_dim
    __lowerCamelCase    				=     depths
    __lowerCamelCase    				=     len(lowerCamelCase__					)
    __lowerCamelCase    				=     num_heads
    __lowerCamelCase    				=     kernel_size
    __lowerCamelCase    				=     dilations
    __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 Dinat 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    				=     get_aligned_output_features_output_indices(
        out_features=lowerCamelCase__						,					out_indices=lowerCamelCase__						,					stage_names=self.stage_names					)










"""simple docstring"""


def    _lowerCamelCase   (     lowerCamelCase__	:							str  ):
 assert column_title.isupper()
 lowercase__       :       int				=						0
 lowercase__       :       Optional[int]				=						len(lowerCamelCase__  ) - 1
 lowercase__       :       int				=						0

 while index >= 0:
  lowercase__       :       List[str]				=						(ord(column_title[index]  ) - 64) * pow(26       ,		lowerCamelCase__  )
  answer += value
  power += 1
  index -= 1

 return answer


if __name__ == "__main__":
   from doctest import testmod

   testmod()