
"""simple docstring"""



from typing import Dict, List, Optional, Union

import numpy as np

from ...image_processing_utils import BaseImageProcessor, BatchFeature, get_size_dict
from ...image_transforms import (
    center_crop,
    get_resize_output_image_size,
    normalize,
    rescale,
    resize,
    to_channel_dimension_format,
)
from ...image_utils import (
    IMAGENET_STANDARD_MEAN,
    IMAGENET_STANDARD_STD,
    ChannelDimension,
    ImageInput,
    PILImageResampling,
    is_valid_image,
    to_numpy_array,
    valid_images,
)
from ...utils import TensorType, is_vision_available, logging


if is_vision_available():
	import PIL


_snake_case          =						logging.get_logger(__name__)






def 	__snake_case  (    SCREAMING_SNAKE_CASE:					Optional[int]						):






							"""simple docstring"""



							if isinstance(SCREAMING_SNAKE_CASE     ,  (list, tuple)						) and isinstance(videos[0]     ,  (list, tuple)						) and is_valid_image(videos[0][0]						):
														return videos

							elif isinstance(SCREAMING_SNAKE_CASE     ,  (list, tuple)						) and is_valid_image(videos[0]						):
														return [videos]

							elif is_valid_image(SCREAMING_SNAKE_CASE						):
														return [[videos]]

							raise ValueError(f"""Could not make batched video from {videos}"""						)

class        _SCREAMING_SNAKE_CASE  (  UpperCAmelCase							):






				'''simple docstring'''



				SCREAMING_SNAKE_CASE_:							List[Any]							=					["pixel_values"]


				def __init__(					self	:			Dict				,     UpperCAmelCase_	:			bool = True				,     UpperCAmelCase_	:			Dict[str, int] = None				,     UpperCAmelCase_	:			PILImageResampling = PILImageResampling.BILINEAR				,     UpperCAmelCase_	:			bool = True				,     UpperCAmelCase_	:			Dict[str, int] = None				,     UpperCAmelCase_	:			bool = True				,     UpperCAmelCase_	:			Union[int, float] = 1 / 255				,     UpperCAmelCase_	:			bool = True				,     UpperCAmelCase_	:			Optional[Union[float, List[float]]] = None				,     UpperCAmelCase_	:			Optional[Union[float, List[float]]] = None				,     **UpperCAmelCase_	:			Optional[int]				,     )		->  None:







											"""simple docstring"""




											super().__init__(**UpperCAmelCase_  )
											_lowerCAmelCase  	=			size if size is not None else {'shortest_edge': 224}
											_lowerCAmelCase  	=			get_size_dict(UpperCAmelCase_				,     default_to_square=UpperCAmelCase_  )
											_lowerCAmelCase  	=			crop_size if crop_size is not None else {'height': 224, 'width': 224}
											_lowerCAmelCase  	=			get_size_dict(UpperCAmelCase_				,     param_name='crop_size'  )

											_lowerCAmelCase  	=			do_resize
											_lowerCAmelCase  	=			size
											_lowerCAmelCase  	=			do_center_crop
											_lowerCAmelCase  	=			crop_size
											_lowerCAmelCase  	=			resample
											_lowerCAmelCase  	=			do_rescale
											_lowerCAmelCase  	=			rescale_factor
											_lowerCAmelCase  	=			do_normalize
											_lowerCAmelCase  	=			image_mean if image_mean is not None else IMAGENET_STANDARD_MEAN
											_lowerCAmelCase  	=			image_std if image_std is not None else IMAGENET_STANDARD_STD


				def 				__lowerCamelCase	(					self	:			str				,     UpperCAmelCase_	:			np.ndarray				,     UpperCAmelCase_	:			Dict[str, int]				,     UpperCAmelCase_	:			PILImageResampling = PILImageResampling.BILINEAR				,     UpperCAmelCase_	:			Optional[Union[str, ChannelDimension]] = None				,     **UpperCAmelCase_	:			Optional[int]				,     )		->  np.ndarray:







											"""simple docstring"""




											_lowerCAmelCase  	=			get_size_dict(UpperCAmelCase_				,     default_to_square=UpperCAmelCase_  )
											if "shortest_edge" in size:
																		_lowerCAmelCase  	=			get_resize_output_image_size(UpperCAmelCase_				,     size['shortest_edge']				,     default_to_square=UpperCAmelCase_  )
											elif "height" in size and "width" in size:
																		_lowerCAmelCase  	=			(size['height'], size['width'])
											else:
																		raise ValueError(F"""Size must have 'height' and 'width' or 'shortest_edge' as keys. Got {size.keys()}"""  )
											return resize(UpperCAmelCase_				,     size=UpperCAmelCase_				,     resample=UpperCAmelCase_				,     data_format=UpperCAmelCase_				,     **UpperCAmelCase_  )


				def 				__lowerCamelCase	(					self	:			Optional[Any]				,     UpperCAmelCase_	:			np.ndarray				,     UpperCAmelCase_	:			Dict[str, int]				,     UpperCAmelCase_	:			Optional[Union[str, ChannelDimension]] = None				,     **UpperCAmelCase_	:			Tuple				,     )		->  np.ndarray:







											"""simple docstring"""




											_lowerCAmelCase  	=			get_size_dict(UpperCAmelCase_  )
											if "height" not in size or "width" not in size:
																		raise ValueError(F"""Size must have 'height' and 'width' as keys. Got {size.keys()}"""  )
											return center_crop(UpperCAmelCase_				,     size=(size['height'], size['width'])				,     data_format=UpperCAmelCase_				,     **UpperCAmelCase_  )


				def 				__lowerCamelCase	(					self	:			Optional[int]				,     UpperCAmelCase_	:			np.ndarray				,     UpperCAmelCase_	:			Union[int, float]				,     UpperCAmelCase_	:			Optional[Union[str, ChannelDimension]] = None				,     **UpperCAmelCase_	:			int				,     )		->  Any:







											"""simple docstring"""




											return rescale(UpperCAmelCase_				,     scale=UpperCAmelCase_				,     data_format=UpperCAmelCase_				,     **UpperCAmelCase_  )


				def 				__lowerCamelCase	(					self	:			Optional[int]				,     UpperCAmelCase_	:			np.ndarray				,     UpperCAmelCase_	:			Union[float, List[float]]				,     UpperCAmelCase_	:			Union[float, List[float]]				,     UpperCAmelCase_	:			Optional[Union[str, ChannelDimension]] = None				,     **UpperCAmelCase_	:			Union[str, Any]				,     )		->  np.ndarray:







											"""simple docstring"""




											return normalize(UpperCAmelCase_				,     mean=UpperCAmelCase_				,     std=UpperCAmelCase_				,     data_format=UpperCAmelCase_				,     **UpperCAmelCase_  )


				def 				__lowerCamelCase	(					self	:			Tuple				,     UpperCAmelCase_	:			ImageInput				,     UpperCAmelCase_	:			bool = None				,     UpperCAmelCase_	:			Dict[str, int] = None				,     UpperCAmelCase_	:			PILImageResampling = None				,     UpperCAmelCase_	:			bool = None				,     UpperCAmelCase_	:			Dict[str, int] = None				,     UpperCAmelCase_	:			bool = None				,     UpperCAmelCase_	:			float = None				,     UpperCAmelCase_	:			bool = None				,     UpperCAmelCase_	:			Optional[Union[float, List[float]]] = None				,     UpperCAmelCase_	:			Optional[Union[float, List[float]]] = None				,     UpperCAmelCase_	:			Optional[ChannelDimension] = ChannelDimension.FIRST				,     )		->  np.ndarray:







											"""simple docstring"""




											if do_resize and size is None or resample is None:
																		raise ValueError('Size and resample must be specified if do_resize is True.'  )

											if do_center_crop and crop_size is None:
																		raise ValueError('Crop size must be specified if do_center_crop is True.'  )

											if do_rescale and rescale_factor is None:
																		raise ValueError('Rescale factor must be specified if do_rescale is True.'  )

											if do_normalize and (image_mean is None or image_std is None):
																		raise ValueError('Image mean and std must be specified if do_normalize is True.'  )

											# All transformations expect numpy arrays.
											_lowerCAmelCase  	=			to_numpy_array(UpperCAmelCase_  )

											if do_resize:
																		_lowerCAmelCase  	=			self.resize(image=UpperCAmelCase_				,     size=UpperCAmelCase_				,     resample=UpperCAmelCase_  )

											if do_center_crop:
																		_lowerCAmelCase  	=			self.center_crop(UpperCAmelCase_				,     size=UpperCAmelCase_  )

											if do_rescale:
																		_lowerCAmelCase  	=			self.rescale(image=UpperCAmelCase_				,     scale=UpperCAmelCase_  )

											if do_normalize:
																		_lowerCAmelCase  	=			self.normalize(image=UpperCAmelCase_				,     mean=UpperCAmelCase_				,     std=UpperCAmelCase_  )

											_lowerCAmelCase  	=			to_channel_dimension_format(UpperCAmelCase_				,     UpperCAmelCase_  )
											return image







				def 				__lowerCamelCase	(					self	:			int				,     UpperCAmelCase_	:			ImageInput				,     UpperCAmelCase_	:			bool = None				,     UpperCAmelCase_	:			Dict[str, int] = None				,     UpperCAmelCase_	:			PILImageResampling = None				,     UpperCAmelCase_	:			bool = None				,     UpperCAmelCase_	:			Dict[str, int] = None				,     UpperCAmelCase_	:			bool = None				,     UpperCAmelCase_	:			float = None				,     UpperCAmelCase_	:			bool = None				,     UpperCAmelCase_	:			Optional[Union[float, List[float]]] = None				,     UpperCAmelCase_	:			Optional[Union[float, List[float]]] = None				,     UpperCAmelCase_	:			Optional[Union[str, TensorType]] = None				,     UpperCAmelCase_	:			ChannelDimension = ChannelDimension.FIRST				,     **UpperCAmelCase_	:			int				,     )		->  PIL.Image.Image:







											"""simple docstring"""




											_lowerCAmelCase  	=			do_resize if do_resize is not None else self.do_resize
											_lowerCAmelCase  	=			resample if resample is not None else self.resample
											_lowerCAmelCase  	=			do_center_crop if do_center_crop is not None else self.do_center_crop
											_lowerCAmelCase  	=			do_rescale if do_rescale is not None else self.do_rescale
											_lowerCAmelCase  	=			rescale_factor if rescale_factor is not None else self.rescale_factor
											_lowerCAmelCase  	=			do_normalize if do_normalize is not None else self.do_normalize
											_lowerCAmelCase  	=			image_mean if image_mean is not None else self.image_mean
											_lowerCAmelCase  	=			image_std if image_std is not None else self.image_std

											_lowerCAmelCase  	=			size if size is not None else self.size
											_lowerCAmelCase  	=			get_size_dict(UpperCAmelCase_				,     default_to_square=UpperCAmelCase_  )
											_lowerCAmelCase  	=			crop_size if crop_size is not None else self.crop_size
											_lowerCAmelCase  	=			get_size_dict(UpperCAmelCase_				,     param_name='crop_size'  )

											if not valid_images(UpperCAmelCase_  ):
																		raise ValueError(
																		    'Invalid image type. Must be of type PIL.Image.Image, numpy.ndarray, '
																		    'torch.Tensor, tf.Tensor or jax.ndarray.'  )

											_lowerCAmelCase  	=			make_batched(UpperCAmelCase_  )

											_lowerCAmelCase  	=			[
											    [
											        self._preprocess_image(
											            image=UpperCAmelCase_				,     do_resize=UpperCAmelCase_				,     size=UpperCAmelCase_				,     resample=UpperCAmelCase_				,     do_center_crop=UpperCAmelCase_				,     crop_size=UpperCAmelCase_				,     do_rescale=UpperCAmelCase_				,     rescale_factor=UpperCAmelCase_				,     do_normalize=UpperCAmelCase_				,     image_mean=UpperCAmelCase_				,     image_std=UpperCAmelCase_				,     data_format=UpperCAmelCase_				,     )
											        for img in video
											    ]
											    for video in videos
											]

											_lowerCAmelCase  	=			{'pixel_values': videos}
											return BatchFeature(data=UpperCAmelCase_				,     tensor_type=UpperCAmelCase_  )








"""simple docstring"""



from __future__ import annotations

import unittest

from transformers import DebertaVaConfig, is_tf_available
from transformers.testing_utils import require_tf, slow

from ...test_configuration_common import ConfigTester
from ...test_modeling_tf_common import TFModelTesterMixin, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_tf_available():
	import tensorflow as tf

	from transformers import (
	    TFDebertaVaForMaskedLM,
	    TFDebertaVaForQuestionAnswering,
	    TFDebertaVaForSequenceClassification,
	    TFDebertaVaForTokenClassification,
	    TFDebertaVaModel,
	)
class        _SCREAMING_SNAKE_CASE  :






				'''simple docstring'''



				def __init__(					self	:			Dict				,     UpperCAmelCase_	:			Tuple				,     UpperCAmelCase_	:			Optional[int]=13				,     UpperCAmelCase_	:			Tuple=7				,     UpperCAmelCase_	:			Union[str, Any]=True				,     UpperCAmelCase_	:			int=True				,     UpperCAmelCase_	:			int=True				,     UpperCAmelCase_	:			Optional[int]=True				,     UpperCAmelCase_	:			Dict=99				,     UpperCAmelCase_	:			Tuple=32				,     UpperCAmelCase_	:			str=2				,     UpperCAmelCase_	:			int=4				,     UpperCAmelCase_	:			Any=37				,     UpperCAmelCase_	:			str="gelu"				,     UpperCAmelCase_	:			Union[str, Any]=0.1				,     UpperCAmelCase_	:			str=0.1				,     UpperCAmelCase_	:			int=512				,     UpperCAmelCase_	:			str=16				,     UpperCAmelCase_	:			str=2				,     UpperCAmelCase_	:			Union[str, Any]=0.02				,     UpperCAmelCase_	:			List[str]=False				,     UpperCAmelCase_	:			List[Any]=True				,     UpperCAmelCase_	:			Optional[int]="None"				,     UpperCAmelCase_	:			List[Any]=3				,     UpperCAmelCase_	:			Any=4				,     UpperCAmelCase_	:			Tuple=None				,     )		->  Optional[Any]:







											"""simple docstring"""




											_lowerCAmelCase  	=			parent
											_lowerCAmelCase  	=			batch_size
											_lowerCAmelCase  	=			seq_length
											_lowerCAmelCase  	=			is_training
											_lowerCAmelCase  	=			use_input_mask
											_lowerCAmelCase  	=			use_token_type_ids
											_lowerCAmelCase  	=			use_labels
											_lowerCAmelCase  	=			vocab_size
											_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  	=			max_position_embeddings
											_lowerCAmelCase  	=			type_vocab_size
											_lowerCAmelCase  	=			type_sequence_label_size
											_lowerCAmelCase  	=			initializer_range
											_lowerCAmelCase  	=			num_labels
											_lowerCAmelCase  	=			num_choices
											_lowerCAmelCase  	=			relative_attention
											_lowerCAmelCase  	=			position_biased_input
											_lowerCAmelCase  	=			pos_att_type
											_lowerCAmelCase  	=			scope


				def 				__lowerCamelCase	(					self	:			Tuple  )		->  Optional[Any]:







											"""simple docstring"""




											_lowerCAmelCase  	=			ids_tensor([self.batch_size, self.seq_length]				,     self.vocab_size  )

											_lowerCAmelCase  	=			None
											if self.use_input_mask:
																		_lowerCAmelCase  	=			random_attention_mask([self.batch_size, self.seq_length]  )

											_lowerCAmelCase  	=			None
											if self.use_token_type_ids:
																		_lowerCAmelCase  	=			ids_tensor([self.batch_size, self.seq_length]				,     self.type_vocab_size  )

											_lowerCAmelCase  	=			None
											_lowerCAmelCase  	=			None
											_lowerCAmelCase  	=			None
											if self.use_labels:
																		_lowerCAmelCase  	=			ids_tensor([self.batch_size]				,     self.type_sequence_label_size  )
																		_lowerCAmelCase  	=			ids_tensor([self.batch_size, self.seq_length]				,     self.num_labels  )

											_lowerCAmelCase  	=			DebertaVaConfig(
											    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				,     relative_attention=self.relative_attention				,     position_biased_input=self.position_biased_input				,     initializer_range=self.initializer_range				,     return_dict=UpperCAmelCase_				,     )

											return config, input_ids, token_type_ids, input_mask, sequence_labels, token_labels, choice_labels


				def 				__lowerCamelCase	(					self	:			Tuple				,     UpperCAmelCase_	:			Any				,     UpperCAmelCase_	:			Union[str, Any]				,     UpperCAmelCase_	:			Any				,     UpperCAmelCase_	:			List[Any]				,     UpperCAmelCase_	:			Tuple				,     UpperCAmelCase_	:			int				,     UpperCAmelCase_	:			Tuple  )		->  int:







											"""simple docstring"""




											_lowerCAmelCase  	=			TFDebertaVaModel(config=UpperCAmelCase_  )
											_lowerCAmelCase  	=			{'input_ids': input_ids, 'attention_mask': input_mask, 'token_type_ids': token_type_ids}

											_lowerCAmelCase  	=			[input_ids, input_mask]
											_lowerCAmelCase  	=			model(UpperCAmelCase_  )

											_lowerCAmelCase  	=			model(UpperCAmelCase_  )

											self.parent.assertEqual(result.last_hidden_state.shape				,     (self.batch_size, self.seq_length, self.hidden_size)  )


				def 				__lowerCamelCase	(					self	:			Tuple				,     UpperCAmelCase_	:			Dict				,     UpperCAmelCase_	:			List[Any]				,     UpperCAmelCase_	:			Any				,     UpperCAmelCase_	:			Optional[Any]				,     UpperCAmelCase_	:			Union[str, Any]				,     UpperCAmelCase_	:			Optional[Any]				,     UpperCAmelCase_	:			Any  )		->  Optional[int]:







											"""simple docstring"""




											_lowerCAmelCase  	=			TFDebertaVaForMaskedLM(config=UpperCAmelCase_  )
											_lowerCAmelCase  	=			{
											    'input_ids': input_ids,
											    'attention_mask': input_mask,
											    'token_type_ids': token_type_ids,
											}
											_lowerCAmelCase  	=			model(UpperCAmelCase_  )
											self.parent.assertEqual(result.logits.shape				,     (self.batch_size, self.seq_length, self.vocab_size)  )


				def 				__lowerCamelCase	(					self	:			Any				,     UpperCAmelCase_	:			List[str]				,     UpperCAmelCase_	:			Any				,     UpperCAmelCase_	:			List[Any]				,     UpperCAmelCase_	:			List[str]				,     UpperCAmelCase_	:			Dict				,     UpperCAmelCase_	:			Optional[Any]				,     UpperCAmelCase_	:			int  )		->  List[str]:







											"""simple docstring"""




											_lowerCAmelCase  	=			self.num_labels
											_lowerCAmelCase  	=			TFDebertaVaForSequenceClassification(config=UpperCAmelCase_  )
											_lowerCAmelCase  	=			{
											    'input_ids': input_ids,
											    'attention_mask': input_mask,
											    'token_type_ids': token_type_ids,
											}

											_lowerCAmelCase  	=			model(UpperCAmelCase_  )
											self.parent.assertEqual(result.logits.shape				,     (self.batch_size, self.num_labels)  )


				def 				__lowerCamelCase	(					self	:			int				,     UpperCAmelCase_	:			int				,     UpperCAmelCase_	:			str				,     UpperCAmelCase_	:			List[Any]				,     UpperCAmelCase_	:			List[Any]				,     UpperCAmelCase_	:			Any				,     UpperCAmelCase_	:			List[str]				,     UpperCAmelCase_	:			Optional[Any]  )		->  Tuple:







											"""simple docstring"""




											_lowerCAmelCase  	=			self.num_labels
											_lowerCAmelCase  	=			TFDebertaVaForTokenClassification(config=UpperCAmelCase_  )
											_lowerCAmelCase  	=			{
											    'input_ids': input_ids,
											    'attention_mask': input_mask,
											    'token_type_ids': token_type_ids,
											}
											_lowerCAmelCase  	=			model(UpperCAmelCase_  )
											self.parent.assertEqual(result.logits.shape				,     (self.batch_size, self.seq_length, self.num_labels)  )


				def 				__lowerCamelCase	(					self	:			Tuple				,     UpperCAmelCase_	:			Union[str, Any]				,     UpperCAmelCase_	:			Any				,     UpperCAmelCase_	:			int				,     UpperCAmelCase_	:			Union[str, Any]				,     UpperCAmelCase_	:			Tuple				,     UpperCAmelCase_	:			List[Any]				,     UpperCAmelCase_	:			List[str]  )		->  List[Any]:







											"""simple docstring"""




											_lowerCAmelCase  	=			TFDebertaVaForQuestionAnswering(config=UpperCAmelCase_  )
											_lowerCAmelCase  	=			{
											    'input_ids': input_ids,
											    'attention_mask': input_mask,
											    'token_type_ids': token_type_ids,
											}

											_lowerCAmelCase  	=			model(UpperCAmelCase_  )
											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 				__lowerCamelCase	(					self	:			List[Any]  )		->  List[Any]:







											"""simple docstring"""




											_lowerCAmelCase  	=			self.prepare_config_and_inputs()
											(
											    (
											    _lowerCAmelCase
											)	,		(
											    _lowerCAmelCase
											)	,		(
											    _lowerCAmelCase
											)	,		(
											    _lowerCAmelCase
											)	,		(
											    _lowerCAmelCase
											)	,		(
											    _lowerCAmelCase
											)	,		(
											    _lowerCAmelCase
											)	,		
											)  	=			config_and_inputs
											_lowerCAmelCase  	=			{'input_ids': input_ids, 'token_type_ids': token_type_ids, 'attention_mask': input_mask}
											return config, inputs_dict






@require_tf
class        _SCREAMING_SNAKE_CASE  (  UpperCAmelCase      ,				UpperCAmelCase      ,				unittest.TestCase							):






				'''simple docstring'''



				SCREAMING_SNAKE_CASE_:							List[str]							=					(
				    (
				        TFDebertaVaModel,
				        TFDebertaVaForMaskedLM,
				        TFDebertaVaForQuestionAnswering,
				        TFDebertaVaForSequenceClassification,
				        TFDebertaVaForTokenClassification,
				    )
				    if is_tf_available()
				    else ()
				)
				SCREAMING_SNAKE_CASE_:							str							=					(
				    {
				        "feature-extraction": TFDebertaVaModel,
				        "fill-mask": TFDebertaVaForMaskedLM,
				        "question-answering": TFDebertaVaForQuestionAnswering,
				        "text-classification": TFDebertaVaForSequenceClassification,
				        "token-classification": TFDebertaVaForTokenClassification,
				        "zero-shot": TFDebertaVaForSequenceClassification,
				    }
				    if is_tf_available()
				    else {}
				)

				SCREAMING_SNAKE_CASE_:							str							=					False
				SCREAMING_SNAKE_CASE_:							List[str]							=					False


				def 				__lowerCamelCase	(					self	:			Optional[int]  )		->  List[str]:







											"""simple docstring"""




											_lowerCAmelCase  	=			TFDebertaVaModelTester(self  )
											_lowerCAmelCase  	=			ConfigTester(self				,     config_class=UpperCAmelCase_				,     hidden_size=37  )


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







											"""simple docstring"""




											self.config_tester.run_common_tests()


				def 				__lowerCamelCase	(					self	:			Optional[int]  )		->  List[str]:







											"""simple docstring"""




											_lowerCAmelCase  	=			self.model_tester.prepare_config_and_inputs()
											self.model_tester.create_and_check_model(*UpperCAmelCase_  )


				def 				__lowerCamelCase	(					self	:			List[Any]  )		->  Optional[int]:







											"""simple docstring"""




											_lowerCAmelCase  	=			self.model_tester.prepare_config_and_inputs()
											self.model_tester.create_and_check_for_masked_lm(*UpperCAmelCase_  )


				def 				__lowerCamelCase	(					self	:			Dict  )		->  List[str]:







											"""simple docstring"""




											_lowerCAmelCase  	=			self.model_tester.prepare_config_and_inputs()
											self.model_tester.create_and_check_for_question_answering(*UpperCAmelCase_  )


				def 				__lowerCamelCase	(					self	:			Any  )		->  int:







											"""simple docstring"""




											_lowerCAmelCase  	=			self.model_tester.prepare_config_and_inputs()
											self.model_tester.create_and_check_for_sequence_classification(*UpperCAmelCase_  )


				def 				__lowerCamelCase	(					self	:			Tuple  )		->  Optional[int]:







											"""simple docstring"""




											_lowerCAmelCase  	=			self.model_tester.prepare_config_and_inputs()
											self.model_tester.create_and_check_for_token_classification(*UpperCAmelCase_  )







				@slow
				def 				__lowerCamelCase	(					self	:			List[str]  )		->  List[Any]:







											"""simple docstring"""




											_lowerCAmelCase  	=			TFDebertaVaModel.from_pretrained('kamalkraj/deberta-v2-xlarge'  )
											self.assertIsNotNone(UpperCAmelCase_  )






@require_tf
class        _SCREAMING_SNAKE_CASE  (  unittest.TestCase							):






				'''simple docstring'''



				@unittest.skip(reason='Model not available yet'  )
				def 				__lowerCamelCase	(					self	:			Optional[Any]  )		->  Tuple:







											"""simple docstring"""




											pass







				@slow
				def 				__lowerCamelCase	(					self	:			Any  )		->  int:







											"""simple docstring"""




											_lowerCAmelCase  	=			TFDebertaVaModel.from_pretrained('kamalkraj/deberta-v2-xlarge'  )
											_lowerCAmelCase  	=			tf.constant([[0, 31_414, 232, 328, 740, 1_140, 12_695, 69, 46_078, 1_588, 2]]  )
											_lowerCAmelCase  	=			tf.constant([[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]  )
											_lowerCAmelCase  	=			model(UpperCAmelCase_				,     attention_mask=UpperCAmelCase_  )[0]

											_lowerCAmelCase  	=			tf.constant(
											    [[[0.2356, 0.1948, 0.0369], [-0.1063, 0.3586, -0.5152], [-0.6399, -0.0259, -0.2525]]]  )
											tf.debugging.assert_near(output[:, 1:4, 1:4]				,     UpperCAmelCase_				,     atol=1E-4  )






