


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__   	=							logging.get_logger(__name__)

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







class       lowerCamelCase__   (       lowerCAmelCase):
     SCREAMING_SNAKE_CASE__      			=			'''data2vec-vision'''





     def __init__(self		,     UpperCAmelCase=7_6_8		,     UpperCAmelCase=1_2		,     UpperCAmelCase=1_2		,     UpperCAmelCase=3_0_7_2		,     UpperCAmelCase="gelu"		,     UpperCAmelCase=0.0		,     UpperCAmelCase=0.0		,     UpperCAmelCase=0.02		,     UpperCAmelCase=1e-12		,     UpperCAmelCase=2_2_4		,     UpperCAmelCase=1_6		,     UpperCAmelCase=3		,     UpperCAmelCase=False		,     UpperCAmelCase=False		,     UpperCAmelCase=False		,     UpperCAmelCase=False		,     UpperCAmelCase=0.1		,     UpperCAmelCase=0.1		,     UpperCAmelCase=True		,     UpperCAmelCase=[3, 5, 7, 1_1]		,     UpperCAmelCase=[1, 2, 3, 6]		,     UpperCAmelCase=True		,     UpperCAmelCase=0.4		,     UpperCAmelCase=2_5_6		,     UpperCAmelCase=1		,     UpperCAmelCase=False		,     UpperCAmelCase=2_5_5		,     **UpperCAmelCase		,     )     ->   Optional[int]:
      super().__init__(**UpperCAmelCase       )

      _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							      =use_mask_token
      _lowercase							      =use_absolute_position_embeddings
      _lowercase							      =use_relative_position_bias
      _lowercase							      =use_shared_relative_position_bias
      _lowercase							      =layer_scale_init_value
      _lowercase							      =drop_path_rate
      _lowercase							      =use_mean_pooling
      # decode head attributes (semantic segmentation)
      _lowercase							      =out_indices
      _lowercase							      =pool_scales
      # auxiliary head attributes (semantic segmentation)
      _lowercase							      =use_auxiliary_head
      _lowercase							      =auxiliary_loss_weight
      _lowercase							      =auxiliary_channels
      _lowercase							      =auxiliary_num_convs
      _lowercase							      =auxiliary_concat_input
      _lowercase							      =semantic_loss_ignore_index







class       lowerCamelCase__   (       lowerCAmelCase):
     SCREAMING_SNAKE_CASE__      			=			version.parse('''1.11''')





     @property
     def      __A					(self       )     ->   Mapping[str, Mapping[int, str]]:
      return OrderedDict(
          [
              ('''pixel_values''', {0: '''batch''', 1: '''num_channels''', 2: '''height''', 3: '''width'''}),
          ]       )





     @property
     def      __A					(self       )     ->   float:
      return 1e-4





from typing import TYPE_CHECKING

from ..utils import _LazyModule


UpperCAmelCase__   	=							{
    '''config''': [
        '''EXTERNAL_DATA_FORMAT_SIZE_LIMIT''',
        '''OnnxConfig''',
        '''OnnxConfigWithPast''',
        '''OnnxSeq2SeqConfigWithPast''',
        '''PatchingSpec''',
    ],
    '''convert''': ['''export''', '''validate_model_outputs'''],
    '''features''': ['''FeaturesManager'''],
    '''utils''': ['''ParameterFormat''', '''compute_serialized_parameters_size'''],
}


if TYPE_CHECKING:
  from .config import (
      EXTERNAL_DATA_FORMAT_SIZE_LIMIT,
      OnnxConfig,
      OnnxConfigWithPast,
      OnnxSeqaSeqConfigWithPast,
      PatchingSpec,
  )
  from .convert import export, validate_model_outputs
  from .features import FeaturesManager
  from .utils import ParameterFormat, compute_serialized_parameters_size

else:
  import sys

  UpperCAmelCase__   	=							_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)

