






'''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


UpperCamelCase     :   str	      =		logging.get_logger(__name__)

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




class 		UpperCamelCase__     (a      ):




		'''simple docstring'''





		_UpperCamelCase						=       'data2vec-vision'






		def __init__(   self ,_lowerCAmelCase=7_68 ,_lowerCAmelCase=12 ,_lowerCAmelCase=12 ,_lowerCAmelCase=30_72 ,_lowerCAmelCase="gelu" ,_lowerCAmelCase=0.0 ,_lowerCAmelCase=0.0 ,_lowerCAmelCase=0.02 ,_lowerCAmelCase=1E-12 ,_lowerCAmelCase=2_24 ,_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=2_56 ,_lowerCAmelCase=1 ,_lowerCAmelCase=False ,_lowerCAmelCase=2_55 ,**_lowerCAmelCase ,):
								super().__init__(**_lowerCAmelCase							)

								lowerCamelCase__								=	hidden_size
								lowerCamelCase__								=	num_hidden_layers
								lowerCamelCase__								=	num_attention_heads
								lowerCamelCase__								=	intermediate_size
								lowerCamelCase__								=	hidden_act
								lowerCamelCase__								=	hidden_dropout_prob
								lowerCamelCase__								=	attention_probs_dropout_prob
								lowerCamelCase__								=	initializer_range
								lowerCamelCase__								=	layer_norm_eps

								lowerCamelCase__								=	image_size
								lowerCamelCase__								=	patch_size
								lowerCamelCase__								=	num_channels
								lowerCamelCase__								=	use_mask_token
								lowerCamelCase__								=	use_absolute_position_embeddings
								lowerCamelCase__								=	use_relative_position_bias
								lowerCamelCase__								=	use_shared_relative_position_bias
								lowerCamelCase__								=	layer_scale_init_value
								lowerCamelCase__								=	drop_path_rate
								lowerCamelCase__								=	use_mean_pooling
								# decode head attributes (semantic segmentation)
								lowerCamelCase__								=	out_indices
								lowerCamelCase__								=	pool_scales
								# auxiliary head attributes (semantic segmentation)
								lowerCamelCase__								=	use_auxiliary_head
								lowerCamelCase__								=	auxiliary_loss_weight
								lowerCamelCase__								=	auxiliary_channels
								lowerCamelCase__								=	auxiliary_num_convs
								lowerCamelCase__								=	auxiliary_concat_input
								lowerCamelCase__								=	semantic_loss_ignore_index




class 		UpperCamelCase__     (a      ):




		'''simple docstring'''





		_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





"""simple docstring"""



from .imports import is_tqdm_available


if is_tqdm_available():
  from tqdm.auto import tqdm as _tqdm

from ..state import PartialState







def     __lowerCAmelCase		(		lowercase    :    bool = True		,				*lowercase    :    str		,				**lowercase    :    List[Any]					)      ->		List[Any]:


    """simple docstring"""





    if not is_tqdm_available():
        raise ImportError("Accelerate's `tqdm` module requires `tqdm` to be installed. Please run `pip install tqdm`."					)
    snake_case       : Dict    =       False
    if main_process_only:
        snake_case       : int    =       PartialState().local_process_index == 0
    return _tqdm(*lowercase		,				**lowercase		,				disable=lowercase					)





