





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


UpperCAmelCase_					:   Dict 							=						logging.get_logger(__name__)

UpperCAmelCase_					:   Union[str, Any] 							=						{
    """facebook/data2vec-vision-base-ft""": (
        """https://huggingface.co/facebook/data2vec-vision-base-ft/resolve/main/config.json"""
    ),
}





class 							lowercase__    (							__A  ):
  __UpperCamelCase	     =  """data2vec-vision"""







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

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

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





class 							lowercase__    (							__A  ):
  __UpperCamelCase	     =  version.parse("""1.11"""  )







  @property
  def 	UpperCAmelCase__		(	self						):
       return OrderedDict(
           [
               ("""pixel_values""", {0: """batch""", 1: """num_channels""", 2: """height""", 3: """width"""}),
           ]						)







  @property
  def 	UpperCAmelCase__		(	self						):
       return 1e-4







from collections import namedtuple

UpperCAmelCase_					:   Union[str, Any] 							=						namedtuple("""from_to""", """from_ to""")

UpperCAmelCase_					:   int 							=						{
    """cubicmeter""": from_to(1, 1),
    """litre""": from_to(0.0_01, 10_00),
    """kilolitre""": from_to(1, 1),
    """gallon""": from_to(0.0_04_54, 2_64.1_72),
    """cubicyard""": from_to(0.7_64_55, 1.3_07_95),
    """cubicfoot""": from_to(0.0_28, 35.31_47),
    """cup""": from_to(0.0_00_23_65_88, 42_26.75),
}






def 							_lowerCAmelCase (  _a   :					float					,   _a   :					str					,   _a   :					str			)	->			float:
     if from_type not in METRIC_CONVERSION:
          raise ValueError(
              F'Invalid \'from_type\' value: {from_type!r}  Supported values are:\n'
              + """, """.join(_a			)			)
     if to_type not in METRIC_CONVERSION:
          raise ValueError(
              F'Invalid \'to_type\' value: {to_type!r}.  Supported values are:\n'
              + """, """.join(_a			)			)
     return value * METRIC_CONVERSION[from_type].from_ * METRIC_CONVERSION[to_type].to


if __name__ == "__main__":
      import doctest

      doctest.testmod()
