
"""simple docstring"""






import copy
import os
import tempfile
from unittest import TestCase
from unittest.mock import patch

import numpy as np
import pyarrow as pa
import pyarrow.parquet as pq
import pytest

from datasets.arrow_writer import ArrowWriter, OptimizedTypedSequence, ParquetWriter, TypedSequence
from datasets.features import ArrayaD, ClassLabel, Features, Image, Value
from datasets.features.features import ArrayaDExtensionType, cast_to_python_objects
from datasets.keyhash import DuplicatedKeysError, InvalidKeyError

from .utils import require_pil




class 			_SCREAMING_SNAKE_CASE					(			A__							):






			def  __lowerCAmelCase (					self       )			->     str:
						lowerCAmelCase_    :str			     =  pa.array(TypedSequence([1, 2, 3]       )       )
						self.assertEqual(arr.type       ,   pa.intaa()       )






			def  __lowerCAmelCase (					self       )			->     str:
						with self.assertRaises(__A       ):
									lowerCAmelCase_    :Any			     =  pa.array(TypedSequence([1, 2, 3]       )       ,   type=pa.intaa()       )






			def  __lowerCAmelCase (					self       )			->     str:
						with self.assertRaises(__A       ):
									lowerCAmelCase_    :Any			     =  pa.array(TypedSequence([1, 2, 3]       ,   try_type=Value("""bool"""       )       ,   type=Value("""int64"""       )       )       )






			def  __lowerCAmelCase (					self       )			->     int:
						lowerCAmelCase_    :Tuple			     =  pa.array(TypedSequence([1, 2, 3]       ,   type=Value("""int32"""       )       )       )
						self.assertEqual(arr.type       ,   pa.intaa()       )






			def  __lowerCAmelCase (					self       )			->     Dict:
						with self.assertRaises((TypeError, pa.lib.ArrowInvalid)       ):
									lowerCAmelCase_    :Optional[int]			     =  pa.array(TypedSequence(["""foo""", """bar"""]       ,   type=Value("""int64"""       )       )       )






			def  __lowerCAmelCase (					self       )			->     Optional[Any]:
						lowerCAmelCase_    :Any			     =  pa.array(TypedSequence([1, 2, 3]       ,   try_type=Value("""int32"""       )       )       )
						self.assertEqual(arr.type       ,   pa.intaa()       )






			def  __lowerCAmelCase (					self       )			->     Optional[Any]:
						lowerCAmelCase_    :int			     =  pa.array(TypedSequence(["""foo""", """bar"""]       ,   try_type=Value("""int64"""       )       )       )
						self.assertEqual(arr.type       ,   pa.string()       )






			def  __lowerCAmelCase (					self       )			->     Optional[int]:
						lowerCAmelCase_    :Optional[int]			     =  pa.array(TypedSequence([[[1, 2, 3]]]       ,   type=ArrayaD((1, 3)       ,   """int64"""       )       )       )
						self.assertEqual(arr.type       ,   ArrayaDExtensionType((1, 3)       ,   """int64"""       )       )






			def  __lowerCAmelCase (					self       )			->     Union[str, Any]:
						with self.assertRaises((TypeError, pa.lib.ArrowInvalid)       ):
									lowerCAmelCase_    :List[Any]			     =  pa.array(TypedSequence(["""foo""", """bar"""]       ,   type=ArrayaD((1, 3)       ,   """int64"""       )       )       )






			def  __lowerCAmelCase (					self       )			->     Union[str, Any]:
						lowerCAmelCase_    :str			     =  pa.array(TypedSequence([[[1, 2, 3]]]       ,   try_type=ArrayaD((1, 3)       ,   """int64"""       )       )       )
						self.assertEqual(arr.type       ,   ArrayaDExtensionType((1, 3)       ,   """int64"""       )       )






			def  __lowerCAmelCase (					self       )			->     str:
						lowerCAmelCase_    :Union[str, Any]			     =  pa.array(TypedSequence(["""foo""", """bar"""]       ,   try_type=ArrayaD((1, 3)       ,   """int64"""       )       )       )
						self.assertEqual(arr.type       ,   pa.string()       )






			@require_pil
			def  __lowerCAmelCase (					self       )			->     Optional[Any]:
						import PIL.Image

						lowerCAmelCase_    :Dict			     =  PIL.Image.fromarray(np.arange(10       ,   dtype=np.uinta       ).reshape(2       ,   5       )       )
						with patch(
						    """datasets.arrow_writer.cast_to_python_objects"""       ,   side_effect=__A       ) as mock_cast_to_python_objects:
									lowerCAmelCase_    :Dict			     =  pa.array(TypedSequence([{"""path""": None, """bytes""": b"""image_bytes"""}, pil_image]       ,   type=Image()       )       )
									lowerCAmelCase_     ,       lowerCAmelCase_    :List[Any]			     =  mock_cast_to_python_objects.call_args_list[-1]
									self.assertIn("""optimize_list_casting"""       ,   __A       )
									self.assertFalse(kwargs["""optimize_list_casting"""]       )






def 						_snake_case       (	lowercase__		:  Optional[Any]      ,     lowercase__		:  int		)  ->				Optional[int]:


			'''simple docstring'''





			lowerCAmelCase_    :str			     =  pa.BufferReader(lowercase__		) if isinstance(lowercase__      ,     pa.Buffer		) else pa.memory_map(lowercase__		)
			lowerCAmelCase_    :Any			     =  pa.ipc.open_stream(lowercase__		)
			lowerCAmelCase_    :pa.Table			     =  f.read_all()
			assert len(pa_table.to_batches()		) == expected_num_chunks
			assert pa_table.to_pydict() == {"col_1": ["foo", "bar"], "col_2": [1, 2]}
			del pa_table






@pytest.mark.parametrize("""writer_batch_size"""      ,     [None, 1, 1_0]		)
@pytest.mark.parametrize(
    """fields"""      ,     [None, {"""col_1""": pa.string(), """col_2""": pa.intaa()}, {"""col_1""": pa.string(), """col_2""": pa.intaa()}]		)
def 						_snake_case       (	lowercase__		:  int      ,     lowercase__		:  str		)  ->				Any:


			'''simple docstring'''





			lowerCAmelCase_    :Tuple			     =  pa.BufferOutputStream()
			lowerCAmelCase_    :Any			     =  pa.schema(lowercase__		) if fields else None
			with ArrowWriter(stream=lowercase__      ,     schema=lowercase__      ,     writer_batch_size=lowercase__		) as writer:
						writer.write({"""col_1""": """foo""", """col_2""": 1}		)
						writer.write({"""col_1""": """bar""", """col_2""": 2}		)
						lowerCAmelCase_     ,       lowerCAmelCase_    :Any			     =  writer.finalize()
			assert num_examples == 2
			assert num_bytes > 0
			if not fields:
						lowerCAmelCase_    :str			     =  {"""col_1""": pa.string(), """col_2""": pa.intaa()}
			assert writer._schema == pa.schema(lowercase__      ,     metadata=writer._schema.metadata		)
			_check_output(output.getvalue()      ,     expected_num_chunks=num_examples if writer_batch_size == 1 else 1		)






def 						_snake_case       (	)  ->				Optional[int]:


			'''simple docstring'''





			lowerCAmelCase_    :Dict			     =  pa.BufferOutputStream()
			lowerCAmelCase_    :Dict			     =  Features({"""labels""": ClassLabel(names=["""neg""", """pos"""]		)}		)
			with ArrowWriter(stream=lowercase__      ,     features=lowercase__		) as writer:
						writer.write({"""labels""": 0}		)
						writer.write({"""labels""": 1}		)
						lowerCAmelCase_     ,       lowerCAmelCase_    :str			     =  writer.finalize()
			assert num_examples == 2
			assert num_bytes > 0
			assert writer._schema == features.arrow_schema
			assert writer._schema.metadata == features.arrow_schema.metadata
			lowerCAmelCase_    :List[str]			     =  pa.BufferReader(output.getvalue()		)
			lowerCAmelCase_    :Tuple			     =  pa.ipc.open_stream(lowercase__		)
			lowerCAmelCase_    :pa.Table			     =  f.read_all()
			lowerCAmelCase_    :List[str]			     =  pa_table.schema
			assert pa_table.num_rows == 2
			assert schema == features.arrow_schema
			assert schema.metadata == features.arrow_schema.metadata
			assert features == Features.from_arrow_schema(lowercase__		)






@pytest.mark.parametrize("""writer_batch_size"""      ,     [None, 1, 1_0]		)
def 						_snake_case       (	lowercase__		:  Any		)  ->				str:


			'''simple docstring'''





			lowerCAmelCase_    :str			     =  pa.BufferOutputStream()
			with ArrowWriter(
			    stream=lowercase__      ,     writer_batch_size=lowercase__      ,     hash_salt="""split_name"""      ,     check_duplicates=lowercase__      ,     ) as writer:
						with pytest.raises(lowercase__		):
									writer.write({"""col_1""": """foo""", """col_2""": 1}      ,     key=[1, 2]		)
									lowerCAmelCase_     ,       lowerCAmelCase_    :Dict			     =  writer.finalize()






@pytest.mark.parametrize("""writer_batch_size"""      ,     [None, 2, 1_0]		)
def 						_snake_case       (	lowercase__		:  Dict		)  ->				Union[str, Any]:


			'''simple docstring'''





			lowerCAmelCase_    :List[str]			     =  pa.BufferOutputStream()
			with ArrowWriter(
			    stream=lowercase__      ,     writer_batch_size=lowercase__      ,     hash_salt="""split_name"""      ,     check_duplicates=lowercase__      ,     ) as writer:
						with pytest.raises(lowercase__		):
									writer.write({"""col_1""": """foo""", """col_2""": 1}      ,     key=1_0		)
									writer.write({"""col_1""": """bar""", """col_2""": 2}      ,     key=1_0		)
									lowerCAmelCase_     ,       lowerCAmelCase_    :int			     =  writer.finalize()






@pytest.mark.parametrize("""writer_batch_size"""      ,     [None, 2, 1_0]		)
def 						_snake_case       (	lowercase__		:  Tuple		)  ->				Tuple:


			'''simple docstring'''





			lowerCAmelCase_    :Union[str, Any]			     =  pa.BufferOutputStream()
			with ArrowWriter(
			    stream=lowercase__      ,     writer_batch_size=lowercase__      ,     hash_salt="""split_name"""      ,     check_duplicates=lowercase__      ,     ) as writer:
						writer.write({"""col_1""": """foo""", """col_2""": 1}      ,     key=1		)
						writer.write({"""col_1""": """bar""", """col_2""": 2}      ,     key=2		)
						lowerCAmelCase_     ,       lowerCAmelCase_    :Union[str, Any]			     =  writer.finalize()
			assert num_examples == 2
			assert num_bytes > 0
			_check_output(output.getvalue()      ,     expected_num_chunks=num_examples if writer_batch_size == 1 else 1		)






@pytest.mark.parametrize("""writer_batch_size"""      ,     [None, 1, 1_0]		)
@pytest.mark.parametrize(
    """fields"""      ,     [None, {"""col_1""": pa.string(), """col_2""": pa.intaa()}, {"""col_1""": pa.string(), """col_2""": pa.intaa()}]		)
def 						_snake_case       (	lowercase__		:  List[str]      ,     lowercase__		:  List[Any]		)  ->				List[str]:


			'''simple docstring'''





			lowerCAmelCase_    :Dict			     =  pa.BufferOutputStream()
			lowerCAmelCase_    :str			     =  pa.schema(lowercase__		) if fields else None
			with ArrowWriter(stream=lowercase__      ,     schema=lowercase__      ,     writer_batch_size=lowercase__		) as writer:
						writer.write_batch({"""col_1""": ["""foo""", """bar"""], """col_2""": [1, 2]}		)
						writer.write_batch({"""col_1""": [], """col_2""": []}		)
						lowerCAmelCase_     ,       lowerCAmelCase_    :int			     =  writer.finalize()
			assert num_examples == 2
			assert num_bytes > 0
			if not fields:
						lowerCAmelCase_    :Optional[Any]			     =  {"""col_1""": pa.string(), """col_2""": pa.intaa()}
			assert writer._schema == pa.schema(lowercase__      ,     metadata=writer._schema.metadata		)
			_check_output(output.getvalue()      ,     expected_num_chunks=num_examples if writer_batch_size == 1 else 1		)






@pytest.mark.parametrize("""writer_batch_size"""      ,     [None, 1, 1_0]		)
@pytest.mark.parametrize(
    """fields"""      ,     [None, {"""col_1""": pa.string(), """col_2""": pa.intaa()}, {"""col_1""": pa.string(), """col_2""": pa.intaa()}]		)
def 						_snake_case       (	lowercase__		:  str      ,     lowercase__		:  Optional[Any]		)  ->				List[str]:


			'''simple docstring'''





			lowerCAmelCase_    :List[Any]			     =  pa.BufferOutputStream()
			lowerCAmelCase_    :Optional[Any]			     =  pa.schema(lowercase__		) if fields else None
			with ArrowWriter(stream=lowercase__      ,     schema=lowercase__      ,     writer_batch_size=lowercase__		) as writer:
						writer.write_table(pa.Table.from_pydict({"""col_1""": ["""foo""", """bar"""], """col_2""": [1, 2]}		)		)
						lowerCAmelCase_     ,       lowerCAmelCase_    :int			     =  writer.finalize()
			assert num_examples == 2
			assert num_bytes > 0
			if not fields:
						lowerCAmelCase_    :Dict			     =  {"""col_1""": pa.string(), """col_2""": pa.intaa()}
			assert writer._schema == pa.schema(lowercase__      ,     metadata=writer._schema.metadata		)
			_check_output(output.getvalue()      ,     expected_num_chunks=num_examples if writer_batch_size == 1 else 1		)






@pytest.mark.parametrize("""writer_batch_size"""      ,     [None, 1, 1_0]		)
@pytest.mark.parametrize(
    """fields"""      ,     [None, {"""col_1""": pa.string(), """col_2""": pa.intaa()}, {"""col_1""": pa.string(), """col_2""": pa.intaa()}]		)
def 						_snake_case       (	lowercase__		:  Optional[int]      ,     lowercase__		:  Optional[Any]		)  ->				Optional[int]:


			'''simple docstring'''





			lowerCAmelCase_    :int			     =  pa.BufferOutputStream()
			lowerCAmelCase_    :Dict			     =  pa.schema(lowercase__		) if fields else None
			with ArrowWriter(stream=lowercase__      ,     schema=lowercase__      ,     writer_batch_size=lowercase__		) as writer:
						writer.write_row(pa.Table.from_pydict({"""col_1""": ["""foo"""], """col_2""": [1]}		)		)
						writer.write_row(pa.Table.from_pydict({"""col_1""": ["""bar"""], """col_2""": [2]}		)		)
						lowerCAmelCase_     ,       lowerCAmelCase_    :List[Any]			     =  writer.finalize()
			assert num_examples == 2
			assert num_bytes > 0
			if not fields:
						lowerCAmelCase_    :str			     =  {"""col_1""": pa.string(), """col_2""": pa.intaa()}
			assert writer._schema == pa.schema(lowercase__      ,     metadata=writer._schema.metadata		)
			_check_output(output.getvalue()      ,     expected_num_chunks=num_examples if writer_batch_size == 1 else 1		)






def 						_snake_case       (	)  ->				Union[str, Any]:


			'''simple docstring'''





			with tempfile.TemporaryDirectory() as tmp_dir:
						lowerCAmelCase_    :List[Any]			     =  {"""col_1""": pa.string(), """col_2""": pa.intaa()}
						lowerCAmelCase_    :Any			     =  os.path.join(lowercase__      ,     """test.arrow"""		)
						with ArrowWriter(path=lowercase__      ,     schema=pa.schema(lowercase__		)		) as writer:
									writer.write_batch({"""col_1""": ["""foo""", """bar"""], """col_2""": [1, 2]}		)
									lowerCAmelCase_     ,       lowerCAmelCase_    :Dict			     =  writer.finalize()
						assert num_examples == 2
						assert num_bytes > 0
						assert writer._schema == pa.schema(lowercase__      ,     metadata=writer._schema.metadata		)
						_check_output(lowercase__      ,     1		)






def 						_snake_case       (	lowercase__		:  Optional[int]		)  ->				int:


			'''simple docstring'''





			if pa.types.is_list(lowercase__		):
						return get_base_dtype(arr_type.value_type		)
			else:
						return arr_type






def 						_snake_case       (	lowercase__		:  Optional[int]      ,     lowercase__		:  Optional[Any]		)  ->				Optional[Any]:


			'''simple docstring'''





			if isinstance(lst[0]      ,     lowercase__		):
						change_first_primitive_element_in_list(lst[0]      ,     lowercase__		)
			else:
						lowerCAmelCase_    :Dict			     =  value






@pytest.mark.parametrize("""optimized_int_type, expected_dtype"""      ,     [(None, pa.intaa()), (Value("""int32"""		), pa.intaa())]		)
@pytest.mark.parametrize("""sequence"""      ,     [[1, 2, 3], [[1, 2, 3]], [[[1, 2, 3]]]]		)
def 						_snake_case       (	lowercase__		:  Dict      ,     lowercase__		:  Tuple      ,     lowercase__		:  Dict		)  ->				List[str]:


			'''simple docstring'''





			lowerCAmelCase_    :Optional[Any]			     =  pa.array(TypedSequence(lowercase__      ,     optimized_int_type=lowercase__		)		)
			assert get_base_dtype(arr.type		) == expected_dtype






@pytest.mark.parametrize(
    """col, expected_dtype"""      ,     [
        ("""attention_mask""", pa.inta()),
        ("""special_tokens_mask""", pa.inta()),
        ("""token_type_ids""", pa.inta()),
        ("""input_ids""", pa.intaa()),
        ("""other""", pa.intaa()),
    ]      ,     )
@pytest.mark.parametrize("""sequence"""      ,     [[1, 2, 3], [[1, 2, 3]], [[[1, 2, 3]]]]		)
def 						_snake_case       (	lowercase__		:  int      ,     lowercase__		:  List[str]      ,     lowercase__		:  int		)  ->				Optional[Any]:


			'''simple docstring'''





			lowerCAmelCase_    :Tuple			     =  pa.array(OptimizedTypedSequence(lowercase__      ,     col=lowercase__		)		)
			assert get_base_dtype(arr.type		) == expected_dtype

			# not in range
			if col != "other":
						# avoids errors due to in-place modifications
						lowerCAmelCase_    :int			     =  copy.deepcopy(lowercase__		)
						lowerCAmelCase_    :Tuple			     =  np.iinfo(expected_dtype.to_pandas_dtype()		).max + 1
						change_first_primitive_element_in_list(lowercase__      ,     lowercase__		)
						lowerCAmelCase_    :Optional[Any]			     =  pa.array(OptimizedTypedSequence(lowercase__      ,     col=lowercase__		)		)
						assert get_base_dtype(arr.type		) == pa.intaa()






@pytest.mark.parametrize("""raise_exception"""      ,     [False, True]		)
def 						_snake_case       (	lowercase__		:  int      ,     lowercase__		:  Tuple		)  ->				Optional[int]:


			'''simple docstring'''





			lowerCAmelCase_    :Union[str, Any]			     =  str(tmp_path / """dataset-train.arrow"""		)
			try:
						with ArrowWriter(path=lowercase__		) as writer:
									if raise_exception:
												raise pa.lib.ArrowInvalid()
									else:
												writer.stream.close()
			except pa.lib.ArrowInvalid:
						pass
			finally:
						assert writer.stream.closed






def 						_snake_case       (	lowercase__		:  Optional[Any]		)  ->				int:


			'''simple docstring'''





			lowerCAmelCase_    :Tuple			     =  """mock://dataset-train.arrow"""
			with ArrowWriter(path=lowercase__      ,     storage_options=mockfs.storage_options		) as writer:
						assert isinstance(writer._fs      ,     type(lowercase__		)		)
						assert writer._fs.storage_options == mockfs.storage_options
						writer.write({"""col_1""": """foo""", """col_2""": 1}		)
						writer.write({"""col_1""": """bar""", """col_2""": 2}		)
						lowerCAmelCase_     ,       lowerCAmelCase_    :str			     =  writer.finalize()
			assert num_examples == 2
			assert num_bytes > 0
			assert mockfs.exists(lowercase__		)






def 						_snake_case       (	)  ->				Dict:


			'''simple docstring'''





			lowerCAmelCase_    :Optional[int]			     =  pa.BufferOutputStream()
			with ParquetWriter(stream=lowercase__		) as writer:
						writer.write({"""col_1""": """foo""", """col_2""": 1}		)
						writer.write({"""col_1""": """bar""", """col_2""": 2}		)
						lowerCAmelCase_     ,       lowerCAmelCase_    :int			     =  writer.finalize()
			assert num_examples == 2
			assert num_bytes > 0
			lowerCAmelCase_    :Any			     =  pa.BufferReader(output.getvalue()		)
			lowerCAmelCase_    :pa.Table			     =  pq.read_table(lowercase__		)
			assert pa_table.to_pydict() == {"col_1": ["foo", "bar"], "col_2": [1, 2]}






@require_pil
@pytest.mark.parametrize("""embed_local_files"""      ,     [False, True]		)
def 						_snake_case       (	lowercase__		:  str      ,     lowercase__		:  List[Any]		)  ->				List[Any]:


			'''simple docstring'''





			import PIL.Image

			lowerCAmelCase_    :int			     =  str(tmp_path / """test_image_rgb.jpg"""		)
			PIL.Image.fromarray(np.zeros((5, 5)      ,     dtype=np.uinta		)		).save(lowercase__      ,     format="""png"""		)
			lowerCAmelCase_    :List[str]			     =  pa.BufferOutputStream()
			with ParquetWriter(
			    stream=lowercase__      ,     features=Features({"""image""": Image()}		)      ,     embed_local_files=lowercase__		) as writer:
						writer.write({"""image""": image_path}		)
						writer.finalize()
			lowerCAmelCase_    :str			     =  pa.BufferReader(output.getvalue()		)
			lowerCAmelCase_    :pa.Table			     =  pq.read_table(lowercase__		)
			lowerCAmelCase_    :List[str]			     =  pa_table.to_pydict()
			if embed_local_files:
						assert isinstance(out["""image"""][0]["""path"""]      ,     lowercase__		)
						with open(lowercase__      ,     """rb"""		) as f:
									assert out["image"][0]["bytes"] == f.read()
			else:
						assert out["image"][0]["path"] == image_path
						assert out["image"][0]["bytes"] is None






def 						_snake_case       (	)  ->				Union[str, Any]:


			'''simple docstring'''





			lowerCAmelCase_    :Any			     =  pa.schema([pa.field("""col_1"""      ,     pa.string()      ,     nullable=lowercase__		)]		)
			lowerCAmelCase_    :Dict			     =  pa.BufferOutputStream()
			with ArrowWriter(stream=lowercase__		) as writer:
						writer._build_writer(inferred_schema=lowercase__		)
						assert writer._schema == pa.schema([pa.field("""col_1"""      ,     pa.string()		)]		)










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


lowerCAmelCase__      				=   logging.get_logger(__name__)

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


class       SCREAMING_SNAKE_CASE__				(		lowercase				):
       """simple docstring"""


       a  :				List[Any]   ="data2vec-vision"

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






         """simple docstring"""





         super().__init__(**snake_case__						)

         lowerCAmelCase     :     Tuple								=							hidden_size
         lowerCAmelCase     :     List[Any]								=							num_hidden_layers
         lowerCAmelCase     :     Tuple								=							num_attention_heads
         lowerCAmelCase     :     Optional[int]								=							intermediate_size
         lowerCAmelCase     :     Optional[int]								=							hidden_act
         lowerCAmelCase     :     Dict								=							hidden_dropout_prob
         lowerCAmelCase     :     Optional[Any]								=							attention_probs_dropout_prob
         lowerCAmelCase     :     int								=							initializer_range
         lowerCAmelCase     :     Dict								=							layer_norm_eps

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


class       SCREAMING_SNAKE_CASE__				(		lowercase				):
       """simple docstring"""


       a  :				Union[str, Any]   =version.parse("1.11"				)

       @property
       def        lowercase__							(						self						):






         """simple docstring"""





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







       @property
       def        lowercase__							(						self						):






         """simple docstring"""





         return 1e-4





