





"""simple docstring"""



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


a_			=      logging.get_logger(__name__)

a_			=      {
    """facebook/data2vec-vision-base-ft""": (
        """https://huggingface.co/facebook/data2vec-vision-base-ft/resolve/main/config.json"""
    ),
}






class 		__snake_case (		SCREAMING_SNAKE_CASE__					):





 """simple docstring"""


 _lowerCamelCase				=					"""data2vec-vision"""

 def __init__(   self ,						__lowerCamelCase=768 ,						__lowerCamelCase=12 ,						__lowerCamelCase=12 ,						__lowerCamelCase=3072 ,						__lowerCamelCase="gelu" ,						__lowerCamelCase=0.0 ,						__lowerCamelCase=0.0 ,						__lowerCamelCase=0.0_2 ,						__lowerCamelCase=1e-1_2 ,						__lowerCamelCase=224 ,						__lowerCamelCase=16 ,						__lowerCamelCase=3 ,						__lowerCamelCase=False ,						__lowerCamelCase=False ,						__lowerCamelCase=False ,						__lowerCamelCase=False ,						__lowerCamelCase=0.1 ,						__lowerCamelCase=0.1 ,						__lowerCamelCase=True ,						__lowerCamelCase=[3, 5, 7, 11] ,						__lowerCamelCase=[1, 2, 3, 6] ,						__lowerCamelCase=True ,						__lowerCamelCase=0.4 ,						__lowerCamelCase=256 ,						__lowerCamelCase=1 ,						__lowerCamelCase=False ,						__lowerCamelCase=255 ,						**__lowerCamelCase ,						):



     '''simple docstring'''




     super().__init__(**lowerCamelCase_  )

     __A   :						Optional[int]									=					hidden_size
     __A   :						Union[str, Any]									=					num_hidden_layers
     __A   :						Union[str, Any]									=					num_attention_heads
     __A   :						str									=					intermediate_size
     __A   :						int									=					hidden_act
     __A   :						List[str]									=					hidden_dropout_prob
     __A   :						Optional[Any]									=					attention_probs_dropout_prob
     __A   :						int									=					initializer_range
     __A   :						str									=					layer_norm_eps

     __A   :						int									=					image_size
     __A   :						List[str]									=					patch_size
     __A   :						List[str]									=					num_channels
     __A   :						Union[str, Any]									=					use_mask_token
     __A   :						Dict									=					use_absolute_position_embeddings
     __A   :						Optional[Any]									=					use_relative_position_bias
     __A   :						List[str]									=					use_shared_relative_position_bias
     __A   :						List[Any]									=					layer_scale_init_value
     __A   :						List[str]									=					drop_path_rate
     __A   :						Tuple									=					use_mean_pooling
     # decode head attributes (semantic segmentation)
     __A   :						Dict									=					out_indices
     __A   :						List[Any]									=					pool_scales
     # auxiliary head attributes (semantic segmentation)
     __A   :						Any									=					use_auxiliary_head
     __A   :						List[str]									=					auxiliary_loss_weight
     __A   :						Dict									=					auxiliary_channels
     __A   :						List[str]									=					auxiliary_num_convs
     __A   :						List[Any]									=					auxiliary_concat_input
     __A   :						List[Any]									=					semantic_loss_ignore_index






class 		__snake_case (		SCREAMING_SNAKE_CASE__					):





 """simple docstring"""


 _lowerCamelCase				=					version.parse("""1.11"""					)

 @property
 def  UpperCamelCase__(   self  ):



     '''simple docstring'''




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







 @property
 def  UpperCamelCase__(   self  ):



     '''simple docstring'''




     return 1e-4











"""simple docstring"""



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 		__snake_case (		SCREAMING_SNAKE_CASE__							,							SCREAMING_SNAKE_CASE__					):





 """simple docstring"""


 _lowerCamelCase				=					"""dinat"""

 _lowerCamelCase				=					{
     """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=[[1, 8, 1], [1, 4, 1, 4], [1, 2, 1, 2, 1, 2], [1, 1, 1, 1, 1]] ,						__lowerCamelCase=3.0 ,						__lowerCamelCase=True ,						__lowerCamelCase=0.0 ,						__lowerCamelCase=0.0 ,						__lowerCamelCase=0.1 ,						__lowerCamelCase="gelu" ,						__lowerCamelCase=0.0_2 ,						__lowerCamelCase=1e-5 ,						__lowerCamelCase=0.0 ,						__lowerCamelCase=None ,						__lowerCamelCase=None ,						**__lowerCamelCase ,						):



     '''simple docstring'''




     super().__init__(**__lowerCamelCase  )

     __A   :						Dict									=					patch_size
     __A   :						Union[str, Any]									=					num_channels
     __A   :						str									=					embed_dim
     __A   :						Optional[Any]									=					depths
     __A   :						int									=					len(__lowerCamelCase  )
     __A   :						Union[str, Any]									=					num_heads
     __A   :						Tuple									=					kernel_size
     __A   :						Optional[int]									=					dilations
     __A   :						Tuple									=					mlp_ratio
     __A   :						Optional[int]									=					qkv_bias
     __A   :						int									=					hidden_dropout_prob
     __A   :						Dict									=					attention_probs_dropout_prob
     __A   :						int									=					drop_path_rate
     __A   :						Dict									=					hidden_act
     __A   :						Any									=					layer_norm_eps
     __A   :						Tuple									=					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   :						str									=					int(embed_dim * 2 ** (len(__lowerCamelCase  ) - 1)  )
     __A   :						List[Any]									=					layer_scale_init_value
     __A   :						Any									=					['''stem'''] + [F"""stage{idx}""" for idx in range(1 ,						len(__lowerCamelCase  ) + 1  )]
     __A			,	__A   :						Union[str, Any]									=					get_aligned_output_features_output_indices(
         out_features=__lowerCamelCase ,						out_indices=__lowerCamelCase ,						stage_names=self.stage_names  )




