




from dataclasses import dataclass
from typing import Dict, Optional, Union

import torch
import torch.nn.functional as F
from torch import nn

from ..configuration_utils import ConfigMixin, register_to_config
from ..utils import BaseOutput
from .attention import BasicTransformerBlock
from .attention_processor import AttentionProcessor, AttnProcessor
from .embeddings import TimestepEmbedding, Timesteps
from .modeling_utils import ModelMixin







@dataclass
class 				lowerCAmelCase_       (					lowerCamelCase_							):
				__a     :       torch.FloatTensor







class 				lowerCAmelCase_       (					lowerCamelCase_						,     lowerCamelCase_							):






				@register_to_config
				def __init__(			self      ,snake_case__ = 32      ,snake_case__ = 64      ,snake_case__ = 20      ,snake_case__ = 768      ,snake_case__=77      ,snake_case__=4      ,snake_case__ = 0.0      ,snake_case__ = "silu"      ,snake_case__ = None      ,snake_case__ = None      ,snake_case__ = "linear"      ,snake_case__ = "prd"      ,snake_case__ = None      ,snake_case__ = None      ,snake_case__ = None      ,):
							super().__init__()
							SCREAMING_SNAKE_CASE_   : Any					  =      num_attention_heads
							SCREAMING_SNAKE_CASE_   : str					  =      attention_head_dim
							SCREAMING_SNAKE_CASE_   : Dict					  =      num_attention_heads * attention_head_dim
							SCREAMING_SNAKE_CASE_   : str					  =      additional_embeddings

							SCREAMING_SNAKE_CASE_   : str					  =      time_embed_dim or inner_dim
							SCREAMING_SNAKE_CASE_   : int					  =      embedding_proj_dim or embedding_dim
							SCREAMING_SNAKE_CASE_   : str					  =      clip_embed_dim or embedding_dim

							SCREAMING_SNAKE_CASE_   : Tuple					  =      Timesteps(snake_case__      ,snake_case__      ,0 )
							SCREAMING_SNAKE_CASE_   : Optional[int]					  =      TimestepEmbedding(snake_case__      ,snake_case__      ,out_dim=snake_case__      ,act_fn=snake_case__ )

							SCREAMING_SNAKE_CASE_   : int					  =      nn.Linear(snake_case__      ,snake_case__ )

							if embedding_proj_norm_type is None:
										SCREAMING_SNAKE_CASE_   : int					  =      None
							elif embedding_proj_norm_type == "layer":
										SCREAMING_SNAKE_CASE_   : List[Any]					  =      nn.LayerNorm(snake_case__ )
							else:
										raise ValueError(F'unsupported embedding_proj_norm_type: {embedding_proj_norm_type}' )

							SCREAMING_SNAKE_CASE_   : Optional[int]					  =      nn.Linear(snake_case__      ,snake_case__ )

							if encoder_hid_proj_type is None:
										SCREAMING_SNAKE_CASE_   : Tuple					  =      None
							elif encoder_hid_proj_type == "linear":
										SCREAMING_SNAKE_CASE_   : str					  =      nn.Linear(snake_case__      ,snake_case__ )
							else:
										raise ValueError(F'unsupported encoder_hid_proj_type: {encoder_hid_proj_type}' )

							SCREAMING_SNAKE_CASE_   : List[Any]					  =      nn.Parameter(torch.zeros(1      ,num_embeddings + additional_embeddings      ,snake_case__ ) )

							if added_emb_type == "prd":
										SCREAMING_SNAKE_CASE_   : str					  =      nn.Parameter(torch.zeros(1      ,1      ,snake_case__ ) )
							elif added_emb_type is None:
										SCREAMING_SNAKE_CASE_   : Union[str, Any]					  =      None
							else:
										raise ValueError(
										    F'`added_emb_type`: {added_emb_type} is not supported. Make sure to choose one of `\'prd\'` or `None`.' )

							SCREAMING_SNAKE_CASE_   : Tuple					  =      nn.ModuleList(
							    [
							        BasicTransformerBlock(
							            snake_case__      ,snake_case__      ,snake_case__      ,dropout=snake_case__      ,activation_fn='gelu'      ,attention_bias=snake_case__      ,)
							        for d in range(snake_case__ )
							    ] )

							if norm_in_type == "layer":
										SCREAMING_SNAKE_CASE_   : Dict					  =      nn.LayerNorm(snake_case__ )
							elif norm_in_type is None:
										SCREAMING_SNAKE_CASE_   : str					  =      None
							else:
										raise ValueError(F'Unsupported norm_in_type: {norm_in_type}.' )

							SCREAMING_SNAKE_CASE_   : int					  =      nn.LayerNorm(snake_case__ )

							SCREAMING_SNAKE_CASE_   : int					  =      nn.Linear(snake_case__      ,snake_case__ )

							SCREAMING_SNAKE_CASE_   : Optional[Any]					  =      torch.full(
							    [num_embeddings + additional_embeddings, num_embeddings + additional_embeddings]      ,-10000.0 )
							causal_attention_mask.triu_(1 )
							SCREAMING_SNAKE_CASE_   : Tuple					  =      causal_attention_mask[None, ...]
							self.register_buffer('causal_attention_mask'      ,snake_case__      ,persistent=snake_case__ )

							SCREAMING_SNAKE_CASE_   : Optional[Any]					  =      nn.Parameter(torch.zeros(1      ,snake_case__ ) )
							SCREAMING_SNAKE_CASE_   : Tuple					  =      nn.Parameter(torch.zeros(1      ,snake_case__ ) )






				@property
				# Copied from diffusers.models.unet_2d_condition.UNet2DConditionModel.attn_processors
				def 		snake_case	(			self ):
							SCREAMING_SNAKE_CASE_   : Dict					  =      {}

							def fn_recursive_add_processors(snake_case__      ,snake_case__      ,snake_case__ ):
										if hasattr(snake_case__      ,'set_processor' ):
													SCREAMING_SNAKE_CASE_   : Optional[Any]					  =      module.processor

										for sub_name, child in module.named_children():
													fn_recursive_add_processors(F'{name}.{sub_name}'      ,snake_case__      ,snake_case__ )

										return processors

							for name, module in self.named_children():
										fn_recursive_add_processors(snake_case__      ,snake_case__      ,snake_case__ )

							return processors






				def 		snake_case	(			self      ,snake_case__ ):
							SCREAMING_SNAKE_CASE_   : Optional[Any]					  =      len(self.attn_processors.keys() )

							if isinstance(snake_case__      ,snake_case__ ) and len(snake_case__ ) != count:
										raise ValueError(
										    F'A dict of processors was passed, but the number of processors {len(snake_case__ )} does not match the'
										    F' number of attention layers: {count}. Please make sure to pass {count} processor classes.' )

							def fn_recursive_attn_processor(snake_case__      ,snake_case__      ,snake_case__ ):
										if hasattr(snake_case__      ,'set_processor' ):
													if not isinstance(snake_case__      ,snake_case__ ):
																module.set_processor(snake_case__ )
													else:
																module.set_processor(processor.pop(F'{name}.processor' ) )

										for sub_name, child in module.named_children():
													fn_recursive_attn_processor(F'{name}.{sub_name}'      ,snake_case__      ,snake_case__ )

							for name, module in self.named_children():
										fn_recursive_attn_processor(snake_case__      ,snake_case__      ,snake_case__ )






				def 		snake_case	(			self ):
							self.set_attn_processor(AttnProcessor() )






				def 		snake_case	(			self      ,snake_case__      ,snake_case__      ,snake_case__      ,snake_case__ = None      ,snake_case__ = None      ,snake_case__ = True      ,):
							SCREAMING_SNAKE_CASE_   : Any					  =      hidden_states.shape[0]

							SCREAMING_SNAKE_CASE_   : List[str]					  =      timestep
							if not torch.is_tensor(snake_case__ ):
										SCREAMING_SNAKE_CASE_   : Dict					  =      torch.tensor([timesteps]      ,dtype=torch.long      ,device=hidden_states.device )
							elif torch.is_tensor(snake_case__ ) and len(timesteps.shape ) == 0:
										SCREAMING_SNAKE_CASE_   : Optional[int]					  =      timesteps[None].to(hidden_states.device )

							# broadcast to batch dimension in a way that's compatible with ONNX/Core ML
							SCREAMING_SNAKE_CASE_   : Any					  =      timesteps * torch.ones(snake_case__      ,dtype=timesteps.dtype      ,device=timesteps.device )

							SCREAMING_SNAKE_CASE_   : Optional[Any]					  =      self.time_proj(snake_case__ )

							# timesteps does not contain any weights and will always return f32 tensors
							# but time_embedding might be fp16, so we need to cast here.
							SCREAMING_SNAKE_CASE_   : int					  =      timesteps_projected.to(dtype=self.dtype )
							SCREAMING_SNAKE_CASE_   : Any					  =      self.time_embedding(snake_case__ )

							if self.embedding_proj_norm is not None:
										SCREAMING_SNAKE_CASE_   : List[str]					  =      self.embedding_proj_norm(snake_case__ )

							SCREAMING_SNAKE_CASE_   : Optional[int]					  =      self.embedding_proj(snake_case__ )
							if self.encoder_hidden_states_proj is not None and encoder_hidden_states is not None:
										SCREAMING_SNAKE_CASE_   : Union[str, Any]					  =      self.encoder_hidden_states_proj(snake_case__ )
							elif self.encoder_hidden_states_proj is not None and encoder_hidden_states is None:
										raise ValueError('`encoder_hidden_states_proj` requires `encoder_hidden_states` to be set' )

							SCREAMING_SNAKE_CASE_   : List[str]					  =      self.proj_in(snake_case__ )

							SCREAMING_SNAKE_CASE_   : Union[str, Any]					  =      self.positional_embedding.to(hidden_states.dtype )

							SCREAMING_SNAKE_CASE_   : Any					  =      []
							SCREAMING_SNAKE_CASE_   : List[Any]					  =      0

							if encoder_hidden_states is not None:
										additional_embeds.append(snake_case__ )
										additional_embeddings_len += encoder_hidden_states.shape[1]

							if len(proj_embeddings.shape ) == 2:
										SCREAMING_SNAKE_CASE_   : Optional[Any]					  =      proj_embeddings[:, None, :]

							if len(hidden_states.shape ) == 2:
										SCREAMING_SNAKE_CASE_   : List[Any]					  =      hidden_states[:, None, :]

							SCREAMING_SNAKE_CASE_   : int					  =      additional_embeds + [
							    proj_embeddings,
							    time_embeddings[:, None, :],
							    hidden_states,
							]

							if self.prd_embedding is not None:
										SCREAMING_SNAKE_CASE_   : Any					  =      self.prd_embedding.to(hidden_states.dtype ).expand(snake_case__      ,-1      ,-1 )
										additional_embeds.append(snake_case__ )

							SCREAMING_SNAKE_CASE_   : str					  =      torch.cat(
							    snake_case__      ,dim=1      ,)

							# Allow positional_embedding to not include the `addtional_embeddings` and instead pad it with zeros for these additional tokens
							SCREAMING_SNAKE_CASE_   : List[Any]					  =      additional_embeddings_len + proj_embeddings.shape[1] + 1
							if positional_embeddings.shape[1] < hidden_states.shape[1]:
										SCREAMING_SNAKE_CASE_   : Optional[Any]					  =      F.pad(
										    snake_case__      ,(
										        0,
										        0,
										        additional_embeddings_len,
										        self.prd_embedding.shape[1] if self.prd_embedding is not None else 0,
										    )      ,value=0.0      ,)

							SCREAMING_SNAKE_CASE_   : int					  =      hidden_states + positional_embeddings

							if attention_mask is not None:
										SCREAMING_SNAKE_CASE_   : int					  =      (1 - attention_mask.to(hidden_states.dtype )) * -10000.0
										SCREAMING_SNAKE_CASE_   : List[Any]					  =      F.pad(snake_case__      ,(0, self.additional_embeddings)      ,value=0.0 )
										SCREAMING_SNAKE_CASE_   : Union[str, Any]					  =      (attention_mask[:, None, :] + self.causal_attention_mask).to(hidden_states.dtype )
										SCREAMING_SNAKE_CASE_   : int					  =      attention_mask.repeat_interleave(self.config.num_attention_heads      ,dim=0 )

							if self.norm_in is not None:
										SCREAMING_SNAKE_CASE_   : List[str]					  =      self.norm_in(snake_case__ )

							for block in self.transformer_blocks:
										SCREAMING_SNAKE_CASE_   : Union[str, Any]					  =      block(snake_case__      ,attention_mask=snake_case__ )

							SCREAMING_SNAKE_CASE_   : List[str]					  =      self.norm_out(snake_case__ )

							if self.prd_embedding is not None:
										SCREAMING_SNAKE_CASE_   : str					  =      hidden_states[:, -1]
							else:
										SCREAMING_SNAKE_CASE_   : Optional[int]					  =      hidden_states[:, additional_embeddings_len:]

							SCREAMING_SNAKE_CASE_   : str					  =      self.proj_to_clip_embeddings(snake_case__ )

							if not return_dict:
										return (predicted_image_embedding,)

							return PriorTransformerOutput(predicted_image_embedding=snake_case__ )






				def 		snake_case	(			self      ,snake_case__ ):
							SCREAMING_SNAKE_CASE_   : Optional[Any]					  =      (prior_latents * self.clip_std) + self.clip_mean
							return prior_latents










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 	__lowerCAmelCase      :





   def __init__(			self       ,      snake_case       ,      snake_case=13       ,      snake_case=7       ,      snake_case=True       ,      snake_case=True       ,      snake_case=True       ,      snake_case=True       ,      snake_case=99       ,      snake_case=32       ,      snake_case=2       ,      snake_case=4       ,      snake_case=37       ,      snake_case="gelu"       ,      snake_case=0.1       ,      snake_case=0.1       ,      snake_case=512       ,      snake_case=16       ,      snake_case=2       ,      snake_case=0.02       ,      snake_case=False       ,      snake_case=True       ,      snake_case="None"       ,      snake_case=3       ,      snake_case=4       ,      snake_case=None       ,      )					->	int:
      """simple docstring"""





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





   def 						_snake_case			(			self   )					->	Tuple:
      """simple docstring"""





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

      a__						:    Union[str, Any]   		=	None
      if self.use_input_mask:
         a__						:    Any   		=	random_attention_mask([self.batch_size, self.seq_length]   )

      a__						:    Optional[Any]   		=	None
      if self.use_token_type_ids:
         a__						:    str   		=	ids_tensor([self.batch_size, self.seq_length]       ,      self.type_vocab_size   )

      a__						:    Dict   		=	None
      a__						:    List[Any]   		=	None
      a__						:    Dict   		=	None
      if self.use_labels:
         a__						:    List[Any]   		=	ids_tensor([self.batch_size]       ,      self.type_sequence_label_size   )
         a__						:    List[str]   		=	ids_tensor([self.batch_size, self.seq_length]       ,      self.num_labels   )

      a__						:    List[str]   		=	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=snake_case       ,      )

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





   def 						_snake_case			(			self       ,      snake_case       ,      snake_case       ,      snake_case       ,      snake_case       ,      snake_case       ,      snake_case       ,      snake_case   )					->	List[Any]:
      """simple docstring"""





      a__						:    Dict   		=	TFDebertaVaModel(config=snake_case   )
      a__						:    Union[str, Any]   		=	{"input_ids": input_ids, "attention_mask": input_mask, "token_type_ids": token_type_ids}

      a__						:    Union[str, Any]   		=	[input_ids, input_mask]
      a__						:    Any   		=	model(snake_case   )

      a__						:    Optional[Any]   		=	model(snake_case   )

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





   def 						_snake_case			(			self       ,      snake_case       ,      snake_case       ,      snake_case       ,      snake_case       ,      snake_case       ,      snake_case       ,      snake_case   )					->	Any:
      """simple docstring"""





      a__						:    Optional[Any]   		=	TFDebertaVaForMaskedLM(config=snake_case   )
      a__						:    Optional[Any]   		=	{
          "input_ids": input_ids,
          "attention_mask": input_mask,
          "token_type_ids": token_type_ids,
      }
      a__						:    List[str]   		=	model(snake_case   )
      self.parent.assertEqual(result.logits.shape       ,      (self.batch_size, self.seq_length, self.vocab_size)   )





   def 						_snake_case			(			self       ,      snake_case       ,      snake_case       ,      snake_case       ,      snake_case       ,      snake_case       ,      snake_case       ,      snake_case   )					->	Optional[Any]:
      """simple docstring"""





      a__						:    List[Any]   		=	self.num_labels
      a__						:    int   		=	TFDebertaVaForSequenceClassification(config=snake_case   )
      a__						:    Optional[Any]   		=	{
          "input_ids": input_ids,
          "attention_mask": input_mask,
          "token_type_ids": token_type_ids,
      }

      a__						:    int   		=	model(snake_case   )
      self.parent.assertEqual(result.logits.shape       ,      (self.batch_size, self.num_labels)   )





   def 						_snake_case			(			self       ,      snake_case       ,      snake_case       ,      snake_case       ,      snake_case       ,      snake_case       ,      snake_case       ,      snake_case   )					->	Dict:
      """simple docstring"""





      a__						:    Dict   		=	self.num_labels
      a__						:    str   		=	TFDebertaVaForTokenClassification(config=snake_case   )
      a__						:    Dict   		=	{
          "input_ids": input_ids,
          "attention_mask": input_mask,
          "token_type_ids": token_type_ids,
      }
      a__						:    Tuple   		=	model(snake_case   )
      self.parent.assertEqual(result.logits.shape       ,      (self.batch_size, self.seq_length, self.num_labels)   )





   def 						_snake_case			(			self       ,      snake_case       ,      snake_case       ,      snake_case       ,      snake_case       ,      snake_case       ,      snake_case       ,      snake_case   )					->	List[str]:
      """simple docstring"""





      a__						:    Union[str, Any]   		=	TFDebertaVaForQuestionAnswering(config=snake_case   )
      a__						:    Optional[int]   		=	{
          "input_ids": input_ids,
          "attention_mask": input_mask,
          "token_type_ids": token_type_ids,
      }

      a__						:    List[Any]   		=	model(snake_case   )
      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   )					->	List[str]:
      """simple docstring"""





      a__						:    List[str]   		=	self.prepare_config_and_inputs()
      (
          (
          a__
      )		,  (
          a__
      )		,  (
          a__
      )		,  (
          a__
      )		,  (
          a__
      )		,  (
          a__
      )		,  (
          a__
      )		,  
      )						:    int   		=	config_and_inputs
      a__						:    Any   		=	{"input_ids": input_ids, "token_type_ids": token_type_ids, "attention_mask": input_mask}
      return config, inputs_dict







@require_tf
class 	__lowerCAmelCase      (       _UpperCamelCase		,_UpperCamelCase		,unittest.TestCase	):
   _UpperCamelCase			:    int  		=					(
       (
           TFDebertaVaModel,
           TFDebertaVaForMaskedLM,
           TFDebertaVaForQuestionAnswering,
           TFDebertaVaForSequenceClassification,
           TFDebertaVaForTokenClassification,
       )
       if is_tf_available()
       else ()
   )
   _UpperCamelCase			:    List[str]  		=					(
       {
           """feature-extraction""": TFDebertaVaModel,
           """fill-mask""": TFDebertaVaForMaskedLM,
           """question-answering""": TFDebertaVaForQuestionAnswering,
           """text-classification""": TFDebertaVaForSequenceClassification,
           """token-classification""": TFDebertaVaForTokenClassification,
           """zero-shot""": TFDebertaVaForSequenceClassification,
       }
       if is_tf_available()
       else {}
   )

   _UpperCamelCase			:    str  		=					False
   _UpperCamelCase			:    List[str]  		=					False





   def 						_snake_case			(			self   )					->	Dict:
      """simple docstring"""





      a__						:    Any   		=	TFDebertaVaModelTester(self   )
      a__						:    int   		=	ConfigTester(self       ,      config_class=snake_case       ,      hidden_size=37   )





   def 						_snake_case			(			self   )					->	Union[str, Any]:
      """simple docstring"""





      self.config_tester.run_common_tests()





   def 						_snake_case			(			self   )					->	Any:
      """simple docstring"""





      a__						:    Dict   		=	self.model_tester.prepare_config_and_inputs()
      self.model_tester.create_and_check_model(*snake_case   )





   def 						_snake_case			(			self   )					->	str:
      """simple docstring"""





      a__						:    List[str]   		=	self.model_tester.prepare_config_and_inputs()
      self.model_tester.create_and_check_for_masked_lm(*snake_case   )





   def 						_snake_case			(			self   )					->	List[Any]:
      """simple docstring"""





      a__						:    Tuple   		=	self.model_tester.prepare_config_and_inputs()
      self.model_tester.create_and_check_for_question_answering(*snake_case   )





   def 						_snake_case			(			self   )					->	List[Any]:
      """simple docstring"""





      a__						:    Any   		=	self.model_tester.prepare_config_and_inputs()
      self.model_tester.create_and_check_for_sequence_classification(*snake_case   )





   def 						_snake_case			(			self   )					->	List[Any]:
      """simple docstring"""





      a__						:    int   		=	self.model_tester.prepare_config_and_inputs()
      self.model_tester.create_and_check_for_token_classification(*snake_case   )





   @slow
   def 						_snake_case			(			self   )					->	List[str]:
      """simple docstring"""





      a__						:    Tuple   		=	TFDebertaVaModel.from_pretrained("kamalkraj/deberta-v2-xlarge"   )
      self.assertIsNotNone(snake_case   )







@require_tf
class 	__lowerCAmelCase      (       unittest.TestCase	):





   @unittest.skip(reason="Model not available yet"   )
   def 						_snake_case			(			self   )					->	Dict:
      """simple docstring"""





      pass





   @slow
   def 						_snake_case			(			self   )					->	List[Any]:
      """simple docstring"""





      a__						:    Optional[Any]   		=	TFDebertaVaModel.from_pretrained("kamalkraj/deberta-v2-xlarge"   )
      a__						:    Any   		=	tf.constant([[0, 31_414, 232, 328, 740, 1_140, 12_695, 69, 46_078, 1_588, 2]]   )
      a__						:    List[str]   		=	tf.constant([[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]   )
      a__						:    Tuple   		=	model(snake_case       ,      attention_mask=snake_case   )[0]

      a__						:    List[Any]   		=	tf.constant(
          [[[0.2_356, 0.1_948, 0.0_369], [-0.1_063, 0.3_586, -0.5_152], [-0.6_399, -0.0_259, -0.2_525]]]   )
      tf.debugging.assert_near(output[:, 1:4, 1:4]       ,      snake_case       ,      atol=1E-4   )

