





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    _SCREAMING_SNAKE_CASE						(	__SCREAMING_SNAKE_CASE    ):







 '''simple docstring'''
 lowercase_		=			"data2vec-vision"

 def __init__(self				:   Optional[Any]       , UpperCAmelCase_				:   int=768       , UpperCAmelCase_				:   Dict=12       , UpperCAmelCase_				:   List[str]=12       , UpperCAmelCase_				:   Optional[int]=3_072       , UpperCAmelCase_				:   List[str]="gelu"       , UpperCAmelCase_				:   Union[str, Any]=0.0       , UpperCAmelCase_				:   List[str]=0.0       , UpperCAmelCase_				:   Union[str, Any]=0.02       , UpperCAmelCase_				:   List[str]=1E-1_2       , UpperCAmelCase_				:   Optional[Any]=224       , UpperCAmelCase_				:   Optional[Any]=16       , UpperCAmelCase_				:   Optional[int]=3       , UpperCAmelCase_				:   Optional[int]=False       , UpperCAmelCase_				:   str=False       , UpperCAmelCase_				:   Tuple=False       , UpperCAmelCase_				:   Any=False       , UpperCAmelCase_				:   str=0.1       , UpperCAmelCase_				:   Optional[int]=0.1       , UpperCAmelCase_				:   Union[str, Any]=True       , UpperCAmelCase_				:   Tuple=[3, 5, 7, 11]       , UpperCAmelCase_				:   Tuple=[1, 2, 3, 6]       , UpperCAmelCase_				:   str=True       , UpperCAmelCase_				:   Any=0.4       , UpperCAmelCase_				:   int=256       , UpperCAmelCase_				:   Tuple=1       , UpperCAmelCase_				:   str=False       , UpperCAmelCase_				:   Optional[Any]=255       , **UpperCAmelCase_				:   str       , )       ->Tuple:



   '''simple docstring'''



   super().__init__(**UpperCAmelCase_)

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

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



class    _SCREAMING_SNAKE_CASE						(	__SCREAMING_SNAKE_CASE    ):







 '''simple docstring'''
 lowercase_		=			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








class    _SCREAMING_SNAKE_CASE						:







 '''simple docstring'''

 def __init__(self				:   Optional[Any]       , UpperCAmelCase_				:   int)       ->Optional[int]:



   '''simple docstring'''



   lowerCamelCase__:      Any			  =n
   lowerCamelCase__:      Tuple			  =[None] * self.n
   lowerCamelCase__:      str			  =0  # index of the first element
   lowerCamelCase__:      Tuple			  =0
   lowerCamelCase__:      Optional[Any]			  =0

 def __len__(self				:   str)       ->int:



   '''simple docstring'''



   return self.size

 def 							SCREAMING_SNAKE_CASE_					(self				:   int)       ->bool:



   '''simple docstring'''



   return self.size == 0

 def 							SCREAMING_SNAKE_CASE_					(self				:   List[str])       ->str:



   '''simple docstring'''



   return False if self.is_empty() else self.array[self.front]

 def 							SCREAMING_SNAKE_CASE_					(self				:   int       , UpperCAmelCase_				:   Optional[int])       ->str:



   '''simple docstring'''



   if self.size >= self.n:
     raise Exception("QUEUE IS FULL")

   lowerCamelCase__:      List[Any]			  =data
   lowerCamelCase__:      Dict			  =(self.rear + 1) % self.n
   self.size += 1
   return self







 def 							SCREAMING_SNAKE_CASE_					(self				:   Tuple)       ->Tuple:



   '''simple docstring'''



   if self.size == 0:
     raise Exception("UNDERFLOW")

   lowerCamelCase__:      Optional[Any]			  =self.array[self.front]
   lowerCamelCase__:      Optional[int]			  =None
   lowerCamelCase__:      Dict			  =(self.front + 1) % self.n
   self.size -= 1
   return temp

