





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


lowercase_					     =	logging.get_logger(__name__)

lowercase_					     =	{
    """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        SCREAMING_SNAKE_CASE     (UpperCAmelCase    ,			UpperCAmelCase   ):
   _UpperCamelCase					:	int				      = 'dinat'

   _UpperCamelCase					:	Any				      = {
       'num_attention_heads': 'num_heads',
       'num_hidden_layers': 'num_layers',
   }


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





      """simple docstring"""







      super().__init__(**a )

      lowercase__			    =						patch_size
      lowercase__			    =						num_channels
      lowercase__			    =						embed_dim
      lowercase__			    =						depths
      lowercase__			    =						len(a )
      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(a ) - 1) )
      lowercase__			    =						layer_scale_init_value
      lowercase__			    =						['stem'] + [f"""stage{idx}""" for idx in range(1    ,  len(a ) + 1 )]
      lowercase__    ,					lowercase__			    =						get_aligned_output_features_output_indices(
          out_features=a    ,  out_indices=a    ,  stage_names=self.stage_names )









from collections import OrderedDict
from typing import Mapping

from packaging import version

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


lowercase_					     =	logging.get_logger(__name__)

lowercase_					     =	{
    """facebook/deit-base-distilled-patch16-224""": (
        """https://huggingface.co/facebook/deit-base-patch16-224/resolve/main/config.json"""
    ),
    # See all DeiT models at https://huggingface.co/models?filter=deit
}
class        SCREAMING_SNAKE_CASE     (UpperCAmelCase   ):
   _UpperCamelCase					:	Any				      = 'deit'


   def __init__(					self    :       Any    ,  a    :       Union[str, Any]=768    ,  a    :       Optional[Any]=12    ,  a    :       Union[str, Any]=12    ,  a    :       Optional[int]=3_072    ,  a    :       Optional[int]="gelu"    ,  a    :       Optional[Any]=0.0    ,  a    :       List[Any]=0.0    ,  a    :       int=0.02    ,  a    :       List[str]=1E-1_2    ,  a    :       Optional[int]=224    ,  a    :       Tuple=16    ,  a    :       List[Any]=3    ,  a    :       List[str]=True    ,  a    :       Any=16    ,  **a    :       Union[str, Any]    ,  )->     int:





     """simple docstring"""







     super().__init__(**a )

     lowercase__			    =						hidden_size
     lowercase__			    =						num_hidden_layers
     lowercase__			    =						num_attention_heads
     lowercase__			    =						intermediate_size
     lowercase__			    =						hidden_act
     lowercase__			    =						hidden_dropout_prob
     lowercase__			    =						attention_probs_dropout_prob
     lowercase__			    =						initializer_range
     lowercase__			    =						layer_norm_eps
     lowercase__			    =						image_size
     lowercase__			    =						patch_size
     lowercase__			    =						num_channels
     lowercase__			    =						qkv_bias
     lowercase__			    =						encoder_stride






class        SCREAMING_SNAKE_CASE     (UpperCAmelCase   ):
   _UpperCamelCase					:	List[Any]				      = version.parse('1.11'   )


   @property
   def  SCREAMING_SNAKE_CASE_							(					self    :       int )->     Mapping[str, Mapping[int, str]]:





     """simple docstring"""







     return OrderedDict(
         [
             ('pixel_values', {0: 'batch', 1: 'num_channels', 2: 'height', 3: 'width'}),
         ] )


   @property
   def  SCREAMING_SNAKE_CASE_							(					self    :       Any )->     float:





     """simple docstring"""







     return 1E-4


