



"""simple docstring"""

from __future__ import annotations







def 							SCREAMING_SNAKE_CASE__      (		SCREAMING_SNAKE_CASE__ :  List[Any]			):



					"""simple docstring"""





					if not nums:
										raise ValueError("""List is empty"""			)
					return sum(__lowerCAmelCase			) / len(__lowerCAmelCase			)


if __name__ == "__main__":
				import doctest

				doctest.testmod()









"""simple docstring"""

from collections import OrderedDict
from typing import TYPE_CHECKING, Any, Mapping, Optional, Union

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


if TYPE_CHECKING:
			from ... import FeatureExtractionMixin, PreTrainedTokenizerBase, TensorType


a_			   =					logging.get_logger(__name__)

a_			   =					{
    '''microsoft/deberta-v2-xlarge''': '''https://huggingface.co/microsoft/deberta-v2-xlarge/resolve/main/config.json''',
    '''microsoft/deberta-v2-xxlarge''': '''https://huggingface.co/microsoft/deberta-v2-xxlarge/resolve/main/config.json''',
    '''microsoft/deberta-v2-xlarge-mnli''': (
        '''https://huggingface.co/microsoft/deberta-v2-xlarge-mnli/resolve/main/config.json'''
    ),
    '''microsoft/deberta-v2-xxlarge-mnli''': (
        '''https://huggingface.co/microsoft/deberta-v2-xxlarge-mnli/resolve/main/config.json'''
    ),
}







class    __lowercase     (					_UpperCAmelCase):







						"""simple docstring"""







						_A		:							Dict							       =		"""deberta-v2"""







						def __init__(self   ,		lowercase__=12_81_00   ,		lowercase__=15_36   ,		lowercase__=24   ,		lowercase__=24   ,		lowercase__=61_44   ,		lowercase__="gelu"   ,		lowercase__=0.1   ,		lowercase__=0.1   ,		lowercase__=5_12   ,		lowercase__=0   ,		lowercase__=0.02   ,		lowercase__=1e-7   ,		lowercase__=False   ,		lowercase__=-1   ,		lowercase__=0   ,		lowercase__=True   ,		lowercase__=None   ,		lowercase__=0   ,		lowercase__="gelu"   ,		**lowercase__   ,		):
											super().__init__(**lowercase__       )

											snake_case_					:		Union[str, Any] 					=					hidden_size
											snake_case_					:		str 					=					num_hidden_layers
											snake_case_					:		Tuple 					=					num_attention_heads
											snake_case_					:		Dict 					=					intermediate_size
											snake_case_					:		Optional[int] 					=					hidden_act
											snake_case_					:		Union[str, Any] 					=					hidden_dropout_prob
											snake_case_					:		Any 					=					attention_probs_dropout_prob
											snake_case_					:		List[Any] 					=					max_position_embeddings
											snake_case_					:		Union[str, Any] 					=					type_vocab_size
											snake_case_					:		Union[str, Any] 					=					initializer_range
											snake_case_					:		List[Any] 					=					relative_attention
											snake_case_					:		Dict 					=					max_relative_positions
											snake_case_					:		Optional[int] 					=					pad_token_id
											snake_case_					:		List[str] 					=					position_biased_input

											# Backwards compatibility
											if type(lowercase__       ) == str:
																snake_case_					:		Union[str, Any] 					=					[x.strip() for x in pos_att_type.lower().split("""|"""       )]

											snake_case_					:		Optional[int] 					=					pos_att_type
											snake_case_					:		List[str] 					=					vocab_size
											snake_case_					:		Tuple 					=					layer_norm_eps

											snake_case_					:		List[Any] 					=					kwargs.get("""pooler_hidden_size"""   ,		lowercase__       )
											snake_case_					:		List[str] 					=					pooler_dropout
											snake_case_					:		int 					=					pooler_hidden_act







class    __lowercase     (					_UpperCAmelCase):







						"""simple docstring"""







						@property
						def 						__UpperCamelCase							(self       ):
											if self.task == "multiple-choice":
																snake_case_					:		List[Any] 					=					{0: """batch""", 1: """choice""", 2: """sequence"""}
											else:
																snake_case_					:		int 					=					{0: """batch""", 1: """sequence"""}
											if self._config.type_vocab_size > 0:
																return OrderedDict(
																    [("""input_ids""", dynamic_axis), ("""attention_mask""", dynamic_axis), ("""token_type_ids""", dynamic_axis)]       )
											else:
																return OrderedDict([("""input_ids""", dynamic_axis), ("""attention_mask""", dynamic_axis)]       )







						@property
						def 						__UpperCamelCase							(self       ):
											return 12







						def 						__UpperCamelCase							(self   ,		lowercase__   ,		lowercase__ = -1   ,		lowercase__ = -1   ,		lowercase__ = -1   ,		lowercase__ = False   ,		lowercase__ = None   ,		lowercase__ = 3   ,		lowercase__ = 40   ,		lowercase__ = 40   ,		lowercase__ = None   ,		):
											snake_case_					:		str 					=					super().generate_dummy_inputs(preprocessor=lowercase__   ,		framework=lowercase__       )
											if self._config.type_vocab_size == 0 and "token_type_ids" in dummy_inputs:
																del dummy_inputs["token_type_ids"]
											return dummy_inputs




