





import unittest

from parameterized import parameterized

from transformers import AutoTokenizer, GPTNeoXConfig, is_torch_available, set_seed
from transformers.testing_utils import require_torch, slow, torch_device

from ...generation.test_utils import GenerationTesterMixin
from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
							import torch

							from transformers import (
							    GPTNeoXForCausalLM,
							    GPTNeoXForQuestionAnswering,
							    GPTNeoXForSequenceClassification,
							    GPTNeoXForTokenClassification,
							    GPTNeoXModel,
							)





class 				a			:






				def __init__(  self			, _lowerCAmelCase			, _lowerCAmelCase=13			, _lowerCAmelCase=7			, _lowerCAmelCase=True			, _lowerCAmelCase=True			, _lowerCAmelCase=True			, _lowerCAmelCase=True			, _lowerCAmelCase=99			, _lowerCAmelCase=64			, _lowerCAmelCase=5			, _lowerCAmelCase=4			, _lowerCAmelCase=37			, _lowerCAmelCase="gelu"			, _lowerCAmelCase=0.1			, _lowerCAmelCase=0.1			, _lowerCAmelCase=512			, _lowerCAmelCase=16			, _lowerCAmelCase=2			, _lowerCAmelCase=0.02			, _lowerCAmelCase=3			, _lowerCAmelCase=4			, _lowerCAmelCase=None			, ):

										"""simple docstring"""




										__SCREAMING_SNAKE_CASE:				Tuple           =   parent
										__SCREAMING_SNAKE_CASE:				str           =   batch_size
										__SCREAMING_SNAKE_CASE:				List[str]           =   seq_length
										__SCREAMING_SNAKE_CASE:				List[Any]           =   is_training
										__SCREAMING_SNAKE_CASE:				Optional[Any]           =   use_input_mask
										__SCREAMING_SNAKE_CASE:				int           =   use_token_type_ids
										__SCREAMING_SNAKE_CASE:				Union[str, Any]           =   use_labels
										__SCREAMING_SNAKE_CASE:				List[str]           =   vocab_size
										__SCREAMING_SNAKE_CASE:				List[str]           =   hidden_size
										__SCREAMING_SNAKE_CASE:				Any           =   num_hidden_layers
										__SCREAMING_SNAKE_CASE:				Any           =   num_attention_heads
										__SCREAMING_SNAKE_CASE:				Any           =   intermediate_size
										__SCREAMING_SNAKE_CASE:				List[Any]           =   hidden_act
										__SCREAMING_SNAKE_CASE:				List[str]           =   hidden_dropout_prob
										__SCREAMING_SNAKE_CASE:				Any           =   attention_probs_dropout_prob
										__SCREAMING_SNAKE_CASE:				Optional[int]           =   max_position_embeddings
										__SCREAMING_SNAKE_CASE:				Any           =   type_vocab_size
										__SCREAMING_SNAKE_CASE:				int           =   type_sequence_label_size
										__SCREAMING_SNAKE_CASE:				Tuple           =   initializer_range
										__SCREAMING_SNAKE_CASE:				Union[str, Any]           =   num_labels
										__SCREAMING_SNAKE_CASE:				int           =   num_choices
										__SCREAMING_SNAKE_CASE:				Dict           =   scope
										__SCREAMING_SNAKE_CASE:				List[str]           =   vocab_size - 1






				def 			snake_case_    (  self					):

										"""simple docstring"""




										__SCREAMING_SNAKE_CASE:				Union[str, Any]           =   ids_tensor([self.batch_size, self.seq_length]			, self.vocab_size					)

										__SCREAMING_SNAKE_CASE:				List[Any]           =   None
										if self.use_input_mask:
																__SCREAMING_SNAKE_CASE:				Tuple           =   random_attention_mask([self.batch_size, self.seq_length]					)

										__SCREAMING_SNAKE_CASE:				str           =   None
										if self.use_labels:
																__SCREAMING_SNAKE_CASE:				Dict           =   ids_tensor([self.batch_size, self.seq_length]			, self.num_labels					)

										__SCREAMING_SNAKE_CASE:				Dict           =   self.get_config()

										return config, input_ids, input_mask, token_labels






				def 			snake_case_    (  self					):

										"""simple docstring"""




										return GPTNeoXConfig(
										    vocab_size=self.vocab_size			, hidden_size=self.hidden_size			, num_hidden_layers=self.num_hidden_layers			, num_attention_heads=self.num_attention_heads			, intermediate_size=self.intermediate_size			, hidden_act=self.hidden_act			, hidden_dropout_prob=self.hidden_dropout_prob			, attention_probs_dropout_prob=self.attention_probs_dropout_prob			, max_position_embeddings=self.max_position_embeddings			, type_vocab_size=self.type_vocab_size			, is_decoder=_lowerCAmelCase			, initializer_range=self.initializer_range			, pad_token_id=self.pad_token_id			, )






				def 			snake_case_    (  self					):

										"""simple docstring"""




										__SCREAMING_SNAKE_CASE       ,__SCREAMING_SNAKE_CASE       ,__SCREAMING_SNAKE_CASE       ,__SCREAMING_SNAKE_CASE:				Union[str, Any]           =   self.prepare_config_and_inputs()

										__SCREAMING_SNAKE_CASE:				List[Any]           =   True

										return config, input_ids, input_mask, token_labels






				def 			snake_case_    (  self			, _lowerCAmelCase			, _lowerCAmelCase			, _lowerCAmelCase					):

										"""simple docstring"""




										__SCREAMING_SNAKE_CASE:				Any           =   GPTNeoXModel(config=_lowerCAmelCase					)
										model.to(_lowerCAmelCase					)
										model.eval()
										__SCREAMING_SNAKE_CASE:				Optional[Any]           =   model(_lowerCAmelCase			, attention_mask=_lowerCAmelCase					)
										__SCREAMING_SNAKE_CASE:				Optional[int]           =   model(_lowerCAmelCase					)
										self.parent.assertEqual(result.last_hidden_state.shape			, (self.batch_size, self.seq_length, self.hidden_size)					)






				def 			snake_case_    (  self			, _lowerCAmelCase			, _lowerCAmelCase			, _lowerCAmelCase					):

										"""simple docstring"""




										__SCREAMING_SNAKE_CASE:				Any           =   True
										__SCREAMING_SNAKE_CASE:				Optional[int]           =   GPTNeoXModel(_lowerCAmelCase					)
										model.to(_lowerCAmelCase					)
										model.eval()
										__SCREAMING_SNAKE_CASE:				int           =   model(_lowerCAmelCase			, attention_mask=_lowerCAmelCase					)
										self.parent.assertEqual(result.last_hidden_state.shape			, (self.batch_size, self.seq_length, self.hidden_size)					)






				def 			snake_case_    (  self			, _lowerCAmelCase			, _lowerCAmelCase			, _lowerCAmelCase			, _lowerCAmelCase					):

										"""simple docstring"""




										__SCREAMING_SNAKE_CASE:				Any           =   GPTNeoXForCausalLM(config=_lowerCAmelCase					)
										model.to(_lowerCAmelCase					)
										model.eval()
										__SCREAMING_SNAKE_CASE:				int           =   model(_lowerCAmelCase			, attention_mask=_lowerCAmelCase			, labels=_lowerCAmelCase					)
										self.parent.assertEqual(result.logits.shape			, (self.batch_size, self.seq_length, self.vocab_size)					)






				def 			snake_case_    (  self			, _lowerCAmelCase			, _lowerCAmelCase			, _lowerCAmelCase			, _lowerCAmelCase					):

										"""simple docstring"""




										__SCREAMING_SNAKE_CASE:				Optional[int]           =   self.num_labels
										__SCREAMING_SNAKE_CASE:				Tuple           =   GPTNeoXForQuestionAnswering(_lowerCAmelCase					)
										model.to(_lowerCAmelCase					)
										model.eval()
										__SCREAMING_SNAKE_CASE:				Dict           =   model(_lowerCAmelCase			, attention_mask=_lowerCAmelCase					)
										self.parent.assertEqual(result.start_logits.shape			, (self.batch_size, self.seq_length)					)
										self.parent.assertEqual(result.end_logits.shape			, (self.batch_size, self.seq_length)					)






				def 			snake_case_    (  self			, _lowerCAmelCase			, _lowerCAmelCase			, _lowerCAmelCase			, _lowerCAmelCase					):

										"""simple docstring"""




										__SCREAMING_SNAKE_CASE:				Optional[int]           =   self.num_labels
										__SCREAMING_SNAKE_CASE:				List[str]           =   GPTNeoXForSequenceClassification(_lowerCAmelCase					)
										model.to(_lowerCAmelCase					)
										model.eval()
										__SCREAMING_SNAKE_CASE:				Tuple           =   ids_tensor([self.batch_size]			, self.type_sequence_label_size					)
										__SCREAMING_SNAKE_CASE:				str           =   model(_lowerCAmelCase			, attention_mask=_lowerCAmelCase			, labels=_lowerCAmelCase					)
										self.parent.assertEqual(result.logits.shape			, (self.batch_size, self.num_labels)					)






				def 			snake_case_    (  self			, _lowerCAmelCase			, _lowerCAmelCase			, _lowerCAmelCase			, _lowerCAmelCase					):

										"""simple docstring"""




										__SCREAMING_SNAKE_CASE:				Optional[Any]           =   self.num_labels
										__SCREAMING_SNAKE_CASE:				Optional[Any]           =   GPTNeoXForTokenClassification(_lowerCAmelCase					)
										model.to(_lowerCAmelCase					)
										model.eval()
										__SCREAMING_SNAKE_CASE:				str           =   model(_lowerCAmelCase			, attention_mask=_lowerCAmelCase			, labels=_lowerCAmelCase					)
										self.parent.assertEqual(result.logits.shape			, (self.batch_size, self.seq_length, self.num_labels)					)






				def 			snake_case_    (  self			, _lowerCAmelCase			, _lowerCAmelCase			, _lowerCAmelCase					):

										"""simple docstring"""




										__SCREAMING_SNAKE_CASE:				Dict           =   True
										__SCREAMING_SNAKE_CASE:				List[str]           =   GPTNeoXForCausalLM(config=_lowerCAmelCase					)
										model.to(_lowerCAmelCase					)
										model.eval()

										# first forward pass
										__SCREAMING_SNAKE_CASE:				str           =   model(_lowerCAmelCase			, attention_mask=_lowerCAmelCase			, use_cache=_lowerCAmelCase					)
										__SCREAMING_SNAKE_CASE:				Optional[int]           =   outputs.past_key_values

										# create hypothetical multiple next token and extent to next_input_ids
										__SCREAMING_SNAKE_CASE:				str           =   ids_tensor((self.batch_size, 3)			, config.vocab_size					)
										__SCREAMING_SNAKE_CASE:				Any           =   ids_tensor((self.batch_size, 3)			, vocab_size=2					)

										# append to next input_ids and
										__SCREAMING_SNAKE_CASE:				Tuple           =   torch.cat([input_ids, next_tokens]			, dim=-1					)
										__SCREAMING_SNAKE_CASE:				Dict           =   torch.cat([input_mask, next_mask]			, dim=-1					)

										__SCREAMING_SNAKE_CASE:				Union[str, Any]           =   model(_lowerCAmelCase			, attention_mask=_lowerCAmelCase			, output_hidden_states=_lowerCAmelCase					)
										__SCREAMING_SNAKE_CASE:				List[str]           =   output_from_no_past['''hidden_states'''][0]
										__SCREAMING_SNAKE_CASE:				Tuple           =   model(
										    _lowerCAmelCase			, attention_mask=_lowerCAmelCase			, past_key_values=_lowerCAmelCase			, output_hidden_states=_lowerCAmelCase			, )['''hidden_states'''][0]

										# select random slice
										__SCREAMING_SNAKE_CASE:				Tuple           =   ids_tensor((1,)			, output_from_past.shape[-1]					).item()
										__SCREAMING_SNAKE_CASE:				int           =   output_from_no_past[:, -3:, random_slice_idx].detach()
										__SCREAMING_SNAKE_CASE:				str           =   output_from_past[:, :, random_slice_idx].detach()

										self.parent.assertTrue(output_from_past_slice.shape[1] == next_tokens.shape[1]					)

										# test that outputs are equal for slice
										self.parent.assertTrue(torch.allclose(_lowerCAmelCase			, _lowerCAmelCase			, atol=1e-3					)					)






				def 			snake_case_    (  self					):

										"""simple docstring"""




										__SCREAMING_SNAKE_CASE:				Optional[int]           =   self.prepare_config_and_inputs()
										__SCREAMING_SNAKE_CASE       ,__SCREAMING_SNAKE_CASE       ,__SCREAMING_SNAKE_CASE       ,__SCREAMING_SNAKE_CASE:				Dict           =   config_and_inputs
										__SCREAMING_SNAKE_CASE:				Optional[Any]           =   {'''input_ids''': input_ids, '''attention_mask''': input_mask}
										return config, inputs_dict





@require_torch
class 				a			(      __lowercase   ,__lowercase   ,__lowercase   ,unittest.TestCase			):
				SCREAMING_SNAKE_CASE__     :   Optional[int]		      =     (
				    (
				        GPTNeoXModel,
				        GPTNeoXForCausalLM,
				        GPTNeoXForQuestionAnswering,
				        GPTNeoXForSequenceClassification,
				        GPTNeoXForTokenClassification,
				    )
				    if is_torch_available()
				    else ()
				)
				SCREAMING_SNAKE_CASE__     :   Union[str, Any]		      =     (GPTNeoXForCausalLM,) if is_torch_available() else ()
				SCREAMING_SNAKE_CASE__     :   List[str]		      =     (
				    {
				        '''feature-extraction''': GPTNeoXModel,
				        '''question-answering''': GPTNeoXForQuestionAnswering,
				        '''text-classification''': GPTNeoXForSequenceClassification,
				        '''text-generation''': GPTNeoXForCausalLM,
				        '''token-classification''': GPTNeoXForTokenClassification,
				        '''zero-shot''': GPTNeoXForSequenceClassification,
				    }
				    if is_torch_available()
				    else {}
				)
				SCREAMING_SNAKE_CASE__     :   Dict		      =     False
				SCREAMING_SNAKE_CASE__     :   Any		      =     False
				SCREAMING_SNAKE_CASE__     :   List[Any]		      =     False
				SCREAMING_SNAKE_CASE__     :   int		      =     False






				def 			snake_case_    (  self					):

										"""simple docstring"""




										__SCREAMING_SNAKE_CASE:				Union[str, Any]           =   GPTNeoXModelTester(self					)
										__SCREAMING_SNAKE_CASE:				Optional[int]           =   ConfigTester(self			, config_class=_lowerCAmelCase			, hidden_size=64			, num_attention_heads=8					)






				def 			snake_case_    (  self					):

										"""simple docstring"""




										self.config_tester.run_common_tests()






				def 			snake_case_    (  self					):

										"""simple docstring"""




										__SCREAMING_SNAKE_CASE       ,__SCREAMING_SNAKE_CASE       ,__SCREAMING_SNAKE_CASE       ,__SCREAMING_SNAKE_CASE:				str           =   self.model_tester.prepare_config_and_inputs()
										self.model_tester.create_and_check_model(_lowerCAmelCase			, _lowerCAmelCase			, _lowerCAmelCase					)






				def 			snake_case_    (  self					):

										"""simple docstring"""




										__SCREAMING_SNAKE_CASE       ,__SCREAMING_SNAKE_CASE       ,__SCREAMING_SNAKE_CASE       ,__SCREAMING_SNAKE_CASE:				Tuple           =   self.model_tester.prepare_config_and_inputs_for_decoder()
										self.model_tester.create_and_check_model_as_decoder(_lowerCAmelCase			, _lowerCAmelCase			, _lowerCAmelCase					)






				def 			snake_case_    (  self					):

										"""simple docstring"""




										__SCREAMING_SNAKE_CASE       ,__SCREAMING_SNAKE_CASE       ,__SCREAMING_SNAKE_CASE       ,__SCREAMING_SNAKE_CASE:				str           =   self.model_tester.prepare_config_and_inputs_for_decoder()

										__SCREAMING_SNAKE_CASE:				Union[str, Any]           =   None

										self.model_tester.create_and_check_model_as_decoder(_lowerCAmelCase			, _lowerCAmelCase			, _lowerCAmelCase					)






				def 			snake_case_    (  self					):

										"""simple docstring"""




										__SCREAMING_SNAKE_CASE       ,__SCREAMING_SNAKE_CASE       ,__SCREAMING_SNAKE_CASE       ,__SCREAMING_SNAKE_CASE:				Any           =   self.model_tester.prepare_config_and_inputs()
										self.model_tester.create_and_check_decoder_model_past_large_inputs(_lowerCAmelCase			, _lowerCAmelCase			, _lowerCAmelCase					)






				def 			snake_case_    (  self					):

										"""simple docstring"""




										__SCREAMING_SNAKE_CASE:				int           =   self.model_tester.prepare_config_and_inputs()
										self.model_tester.create_and_check_for_causal_lm(*_lowerCAmelCase					)






				def 			snake_case_    (  self					):

										"""simple docstring"""




										__SCREAMING_SNAKE_CASE:				List[str]           =   self.model_tester.prepare_config_and_inputs()
										self.model_tester.create_and_check_for_question_answering(*_lowerCAmelCase					)






				def 			snake_case_    (  self					):

										"""simple docstring"""




										__SCREAMING_SNAKE_CASE:				int           =   self.model_tester.prepare_config_and_inputs()
										self.model_tester.create_and_check_for_sequence_classification(*_lowerCAmelCase					)






				def 			snake_case_    (  self					):

										"""simple docstring"""




										__SCREAMING_SNAKE_CASE:				Optional[int]           =   self.model_tester.prepare_config_and_inputs()
										self.model_tester.create_and_check_for_token_classification(*_lowerCAmelCase					)






				@unittest.skip(reason='''Feed forward chunking is not implemented'''					)
				def 			snake_case_    (  self					):

										"""simple docstring"""




										pass






				@parameterized.expand([('''linear''',), ('''dynamic''',)]					)
				def 			snake_case_    (  self			, _lowerCAmelCase					):

										"""simple docstring"""




										__SCREAMING_SNAKE_CASE       ,__SCREAMING_SNAKE_CASE:				List[str]           =   self.model_tester.prepare_config_and_inputs_for_common()
										__SCREAMING_SNAKE_CASE:				List[Any]           =   ids_tensor([1, 10]			, config.vocab_size					)
										__SCREAMING_SNAKE_CASE:				Any           =   ids_tensor([1, int(config.max_position_embeddings * 1.5					)]			, config.vocab_size					)

										set_seed(42					)  # Fixed seed at init time so the two models get the same random weights
										__SCREAMING_SNAKE_CASE:				Tuple           =   GPTNeoXModel(_lowerCAmelCase					)
										original_model.to(_lowerCAmelCase					)
										original_model.eval()
										__SCREAMING_SNAKE_CASE:				List[str]           =   original_model(_lowerCAmelCase					).last_hidden_state
										__SCREAMING_SNAKE_CASE:				Dict           =   original_model(_lowerCAmelCase					).last_hidden_state

										set_seed(42					)  # Fixed seed at init time so the two models get the same random weights
										__SCREAMING_SNAKE_CASE:				List[str]           =   {'''type''': scaling_type, '''factor''': 10.0}
										__SCREAMING_SNAKE_CASE:				Any           =   GPTNeoXModel(_lowerCAmelCase					)
										scaled_model.to(_lowerCAmelCase					)
										scaled_model.eval()
										__SCREAMING_SNAKE_CASE:				Union[str, Any]           =   scaled_model(_lowerCAmelCase					).last_hidden_state
										__SCREAMING_SNAKE_CASE:				Any           =   scaled_model(_lowerCAmelCase					).last_hidden_state

										# Dynamic scaling does not change the RoPE embeddings until it receives an input longer than the original
										# maximum sequence length, so the outputs for the short input should match.
										if scaling_type == "dynamic":
																self.assertTrue(torch.allclose(_lowerCAmelCase			, _lowerCAmelCase			, atol=1e-5					)					)
										else:
																self.assertFalse(torch.allclose(_lowerCAmelCase			, _lowerCAmelCase			, atol=1e-5					)					)

										# The output should be different for long inputs
										self.assertFalse(torch.allclose(_lowerCAmelCase			, _lowerCAmelCase			, atol=1e-5					)					)





@require_torch
class 				a			(      unittest.TestCase			):






				@slow
				def 			snake_case_    (  self					):

										"""simple docstring"""




										__SCREAMING_SNAKE_CASE:				Union[str, Any]           =   AutoTokenizer.from_pretrained('''EleutherAI/pythia-410m-deduped'''					)
										for checkpointing in [True, False]:
																__SCREAMING_SNAKE_CASE:				Union[str, Any]           =   GPTNeoXForCausalLM.from_pretrained('''EleutherAI/pythia-410m-deduped'''					)

																if checkpointing:
																						model.gradient_checkpointing_enable()
																else:
																						model.gradient_checkpointing_disable()
																model.to(_lowerCAmelCase					)

																__SCREAMING_SNAKE_CASE:				str           =   tokenizer('''My favorite food is'''			, return_tensors='''pt'''					).to(_lowerCAmelCase					)
																# The hub repo. is updated on 2023-04-04, resulting in poor outputs.
																# See: https://github.com/huggingface/transformers/pull/24193
																__SCREAMING_SNAKE_CASE:				Union[str, Any]           =   '''My favorite food is a good old-fashioned, old-fashioned, old-fashioned.\n\nI\'m not sure'''

																__SCREAMING_SNAKE_CASE:				Tuple           =   model.generate(**_lowerCAmelCase			, do_sample=_lowerCAmelCase			, max_new_tokens=20					)
																__SCREAMING_SNAKE_CASE:				Any           =   tokenizer.batch_decode(_lowerCAmelCase					)[0]

																self.assertEqual(_lowerCAmelCase			, _lowerCAmelCase					)










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							:       Optional[int]					 =	logging.get_logger(__name__)

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





class 				a			(      __lowercase			):
				SCREAMING_SNAKE_CASE__     :   Union[str, Any]		      =     '''data2vec-vision'''






				def __init__(  self			, _lowerCAmelCase=768			, _lowerCAmelCase=12			, _lowerCAmelCase=12			, _lowerCAmelCase=3072			, _lowerCAmelCase="gelu"			, _lowerCAmelCase=0.0			, _lowerCAmelCase=0.0			, _lowerCAmelCase=0.02			, _lowerCAmelCase=1e-12			, _lowerCAmelCase=224			, _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=256			, _lowerCAmelCase=1			, _lowerCAmelCase=False			, _lowerCAmelCase=255			, **_lowerCAmelCase			, ):

										"""simple docstring"""




										super().__init__(**_lowerCAmelCase					)

										__SCREAMING_SNAKE_CASE:				str           =   hidden_size
										__SCREAMING_SNAKE_CASE:				Tuple           =   num_hidden_layers
										__SCREAMING_SNAKE_CASE:				Tuple           =   num_attention_heads
										__SCREAMING_SNAKE_CASE:				int           =   intermediate_size
										__SCREAMING_SNAKE_CASE:				Optional[Any]           =   hidden_act
										__SCREAMING_SNAKE_CASE:				int           =   hidden_dropout_prob
										__SCREAMING_SNAKE_CASE:				str           =   attention_probs_dropout_prob
										__SCREAMING_SNAKE_CASE:				Any           =   initializer_range
										__SCREAMING_SNAKE_CASE:				Union[str, Any]           =   layer_norm_eps

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





class 				a			(      __lowercase			):
				SCREAMING_SNAKE_CASE__     :   List[Any]		      =     version.parse('''1.11'''			)






				@property
				def 			snake_case_    (  self					):

										"""simple docstring"""




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






				@property
				def 			snake_case_    (  self					):

										"""simple docstring"""




										return 1e-4



