



import inspect
import unittest

import numpy as np

from tests.test_modeling_common import floats_tensor
from transformers import MaskaFormerConfig, is_torch_available, is_vision_available
from transformers.testing_utils import require_torch, require_torch_multi_gpu, require_vision, slow, torch_device
from transformers.utils import cached_property

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
   import torch

   from transformers import MaskaFormerForUniversalSegmentation, MaskaFormerModel

   if is_vision_available():
      from transformers import MaskaFormerImageProcessor

if is_vision_available():
   from PIL import Image



class      _UpperCAmelCase      :




     def __init__(					self			,    a__			,    a__=2			,    a__=True			,    a__=False			,    a__=1_0			,    a__=3			,    a__=3_2 * 8			,    a__=3_2 * 8			,    a__=4			,    a__=6_4			,    ):
         A__					=       parent
         A__					=       batch_size
         A__					=       is_training
         A__					=       use_auxiliary_loss
         A__					=       num_queries
         A__					=       num_channels
         A__					=       min_size
         A__					=       max_size
         A__					=       num_labels
         A__					=       hidden_dim
         A__					=       hidden_dim




     def 		snake_case_		(					self):
         A__					=       floats_tensor([self.batch_size, self.num_channels, self.min_size, self.max_size]).to(
             a__)

         A__					=       torch.ones([self.batch_size, self.min_size, self.max_size]			,    device=a__)

         A__					=       (
             torch.rand([self.batch_size, self.num_labels, self.min_size, self.max_size]			,    device=a__) > 0.5
         ).float()
         A__					=       (torch.rand((self.batch_size, self.num_labels)			,    device=a__) > 0.5).long()

         A__					=       self.get_config()
         return config, pixel_values, pixel_mask, mask_labels, class_labels




     def 		snake_case_		(					self):
         A__					=       MaskaFormerConfig(
             hidden_size=self.hidden_dim			,    )
         A__					=       self.num_queries
         A__					=       self.num_labels

         A__					=       [1, 1, 1, 1]
         A__					=       self.num_channels

         A__					=       6_4
         A__					=       1_2_8
         A__					=       self.hidden_dim
         A__					=       self.hidden_dim
         A__					=       self.hidden_dim
         return config




     def 		snake_case_		(					self):
         A__			,						A__			,						A__			,						A__			,						A__					=       self.prepare_config_and_inputs()
         A__					=       {'''pixel_values''': pixel_values, '''pixel_mask''': pixel_mask}
         return config, inputs_dict




     def 		snake_case_		(					self			,    a__			,    a__):
         A__					=       output.encoder_hidden_states
         A__					=       output.pixel_decoder_hidden_states
         A__					=       output.transformer_decoder_hidden_states

         self.parent.assertTrue(len(a__)			,    len(config.backbone_config.depths))
         self.parent.assertTrue(len(a__)			,    len(config.backbone_config.depths))
         self.parent.assertTrue(len(a__)			,    config.decoder_layers)




     def 		snake_case_		(					self			,    a__			,    a__			,    a__			,    a__=False):
         with torch.no_grad():
             A__					=       MaskaFormerModel(config=a__)
             model.to(a__)
             model.eval()

             A__					=       model(pixel_values=a__			,    pixel_mask=a__)
             A__					=       model(a__			,    output_hidden_states=a__)

         self.parent.assertEqual(
             output.transformer_decoder_last_hidden_state.shape			,    (self.batch_size, self.num_queries, self.hidden_dim)			,    )
         # let's ensure the other two hidden state exists
         self.parent.assertTrue(output.pixel_decoder_last_hidden_state is not None)
         self.parent.assertTrue(output.encoder_last_hidden_state is not None)

         if output_hidden_states:
             self.check_output_hidden_state(a__			,    a__)




     def 		snake_case_		(					self			,    a__			,    a__			,    a__			,    a__			,    a__):
         A__					=       MaskaFormerForUniversalSegmentation(config=a__)
         model.to(a__)
         model.eval()

         def comm_check_on_output(a__):
             # let's still check that all the required stuff is there
             self.parent.assertTrue(result.transformer_decoder_last_hidden_state is not None)
             self.parent.assertTrue(result.pixel_decoder_last_hidden_state is not None)
             self.parent.assertTrue(result.encoder_last_hidden_state is not None)
             # okay, now we need to check the logits shape
             # due to the encoder compression, masks have a //4 spatial size
             self.parent.assertEqual(
                 result.masks_queries_logits.shape			,    (self.batch_size, self.num_queries, self.min_size // 4, self.max_size // 4)			,    )
             # + 1 for null class
             self.parent.assertEqual(
                 result.class_queries_logits.shape			,    (self.batch_size, self.num_queries, self.num_labels + 1))

         with torch.no_grad():
             A__					=       model(pixel_values=a__			,    pixel_mask=a__)
             A__					=       model(a__)

             comm_check_on_output(a__)

             A__					=       model(
                 pixel_values=a__			,    pixel_mask=a__			,    mask_labels=a__			,    class_labels=a__)

         comm_check_on_output(a__)

         self.parent.assertTrue(result.loss is not None)
         self.parent.assertEqual(result.loss.shape			,    torch.Size([1]))







@require_torch
class      _UpperCAmelCase      (							A__      ,   A__      ,   unittest.TestCase  ):
     UpperCamelCase__		     =					(MaskaFormerModel, MaskaFormerForUniversalSegmentation) if is_torch_available() else ()
     UpperCamelCase__		     =					{'''feature-extraction''': MaskaFormerModel} if is_torch_available() else {}

     UpperCamelCase__		     =					False
     UpperCamelCase__		     =					False
     UpperCamelCase__		     =					False
     UpperCamelCase__		     =					False




     def 		snake_case_		(					self):
         A__					=       MaskaFormerModelTester(self)
         A__					=       ConfigTester(self			,    config_class=a__			,    has_text_modality=a__)




     def 		snake_case_		(					self):
         self.config_tester.run_common_tests()




     def 		snake_case_		(					self):
         A__			,						A__					=       self.model_tester.prepare_config_and_inputs_for_common()
         self.model_tester.create_and_check_maskaformer_model(a__			,    **a__			,    output_hidden_states=a__)




     def 		snake_case_		(					self):
         A__					=       self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_maskaformer_instance_segmentation_head_model(*a__)




     @unittest.skip(reason='''Mask2Former does not use inputs_embeds''')
     def 		snake_case_		(					self):
         pass




     @unittest.skip(reason='''Mask2Former does not have a get_input_embeddings method''')
     def 		snake_case_		(					self):
         pass




     @unittest.skip(reason='''Mask2Former is not a generative model''')
     def 		snake_case_		(					self):
         pass




     @unittest.skip(reason='''Mask2Former does not use token embeddings''')
     def 		snake_case_		(					self):
         pass




     @require_torch_multi_gpu
     @unittest.skip(
         reason='''Mask2Former has some layers using `add_module` which doesn\'t work well with `nn.DataParallel`''')
     def 		snake_case_		(					self):
         pass




     @unittest.skip('''Will be fixed soon by reducing the size of the model used for common tests.''')
     def 		snake_case_		(					self):
         pass




     def 		snake_case_		(					self):
         A__			,						A__					=       self.model_tester.prepare_config_and_inputs_for_common()

         for model_class in self.all_model_classes:
             A__					=       model_class(a__)
             A__					=       inspect.signature(model.forward)
             # signature.parameters is an OrderedDict => so arg_names order is deterministic
             A__					=       [*signature.parameters.keys()]

             A__					=       ['''pixel_values''']
             self.assertListEqual(arg_names[:1]			,    a__)




     @slow
     def 		snake_case_		(					self):
         for model_name in ["facebook/mask2former-swin-small-coco-instance"]:
             A__					=       MaskaFormerModel.from_pretrained(a__)
             self.assertIsNotNone(a__)




     def 		snake_case_		(					self):
         A__					=       (self.model_tester.min_size,) * 2
         A__					=       {
             '''pixel_values''': torch.randn((2, 3, *size)			,    device=a__),
             '''mask_labels''': torch.randn((2, 1_0, *size)			,    device=a__),
             '''class_labels''': torch.zeros(2			,    1_0			,    device=a__).long(),
         }
         A__					=       self.model_tester.get_config()

         A__					=       MaskaFormerForUniversalSegmentation(a__).to(a__)
         A__					=       model(**a__)
         self.assertTrue(outputs.loss is not None)




     def 		snake_case_		(					self):
         A__			,						A__					=       self.model_tester.prepare_config_and_inputs_for_common()
         self.model_tester.create_and_check_maskaformer_model(a__			,    **a__			,    output_hidden_states=a__)




     def 		snake_case_		(					self):
         A__			,						A__					=       self.model_tester.prepare_config_and_inputs_for_common()

         for model_class in self.all_model_classes:
             A__					=       model_class(a__).to(a__)
             A__					=       model(**a__			,    output_attentions=a__)
             self.assertTrue(outputs.attentions is not None)




     def 		snake_case_		(					self):
         if not self.model_tester.is_training:
             return

         A__					=       self.all_model_classes[1]
         A__			,						A__			,						A__			,						A__			,						A__					=       self.model_tester.prepare_config_and_inputs()

         A__					=       model_class(a__)
         model.to(a__)
         model.train()

         A__					=       model(a__			,    mask_labels=a__			,    class_labels=a__).loss
         loss.backward()




     def 		snake_case_		(					self):
         A__					=       self.all_model_classes[1]
         A__			,						A__			,						A__			,						A__			,						A__					=       self.model_tester.prepare_config_and_inputs()
         A__					=       True
         A__					=       True

         A__					=       model_class(a__).to(a__)
         model.train()

         A__					=       model(a__			,    mask_labels=a__			,    class_labels=a__)

         A__					=       outputs.encoder_hidden_states[0]
         encoder_hidden_states.retain_grad()

         A__					=       outputs.pixel_decoder_hidden_states[0]
         pixel_decoder_hidden_states.retain_grad()

         A__					=       outputs.transformer_decoder_hidden_states[0]
         transformer_decoder_hidden_states.retain_grad()

         A__					=       outputs.attentions[0]
         attentions.retain_grad()

         outputs.loss.backward(retain_graph=a__)

         self.assertIsNotNone(encoder_hidden_states.grad)
         self.assertIsNotNone(pixel_decoder_hidden_states.grad)
         self.assertIsNotNone(transformer_decoder_hidden_states.grad)
         self.assertIsNotNone(attentions.grad)







_lowercase    	=		1E-4



def 		lowerCAmelCase__     (       )->	Union[str, Any]:
    A__					=       Image.open('''./tests/fixtures/tests_samples/COCO/000000039769.png'''						)
    return image



@require_vision
@slow
class      _UpperCAmelCase      (							unittest.TestCase  ):




     @cached_property
     def 		snake_case_		(					self):
         return "facebook/mask2former-swin-small-coco-instance"




     @cached_property
     def 		snake_case_		(					self):
         return MaskaFormerImageProcessor.from_pretrained(self.model_checkpoints) if is_vision_available() else None




     def 		snake_case_		(					self):
         A__					=       MaskaFormerModel.from_pretrained(self.model_checkpoints).to(a__)
         A__					=       self.default_image_processor
         A__					=       prepare_img()
         A__					=       image_processor(a__			,    return_tensors='''pt''').to(a__)
         A__					=       inputs['''pixel_values'''].shape
         # check size is divisible by 32
         self.assertTrue((inputs_shape[-1] % 3_2) == 0 and (inputs_shape[-2] % 3_2) == 0)
         # check size
         self.assertEqual(a__			,    (1, 3, 3_8_4, 3_8_4))

         with torch.no_grad():
             A__					=       model(**a__)

         A__					=       torch.tensor(
             [[-0.2_7_9_0, -1.0_7_1_7, -1.1_6_6_8], [-0.5_1_2_8, -0.3_1_2_8, -0.4_9_8_7], [-0.5_8_3_2, 0.1_9_7_1, -0.0_1_9_7]]).to(a__)
         self.assertTrue(
             torch.allclose(
                 outputs.encoder_last_hidden_state[0, 0, :3, :3]			,    a__			,    atol=a__))

         A__					=       torch.tensor(
             [[0.8_9_7_3, 1.1_8_4_7, 1.1_7_7_6], [1.1_9_3_4, 1.5_0_4_0, 1.5_1_2_8], [1.1_1_5_3, 1.4_4_8_6, 1.4_9_5_1]]).to(a__)
         self.assertTrue(
             torch.allclose(
                 outputs.pixel_decoder_last_hidden_state[0, 0, :3, :3]			,    a__			,    atol=a__))

         A__					=       torch.tensor(
             [[2.1_1_5_2, 1.7_0_0_0, -0.8_6_0_3], [1.5_8_0_8, 1.8_0_0_4, -0.9_3_5_3], [1.6_0_4_3, 1.7_4_9_5, -0.5_9_9_9]]).to(a__)
         self.assertTrue(
             torch.allclose(
                 outputs.transformer_decoder_last_hidden_state[0, :3, :3]			,    a__			,    atol=a__))




     def 		snake_case_		(					self):
         A__					=       MaskaFormerForUniversalSegmentation.from_pretrained(self.model_checkpoints).to(a__).eval()
         A__					=       self.default_image_processor
         A__					=       prepare_img()
         A__					=       image_processor(a__			,    return_tensors='''pt''').to(a__)
         A__					=       inputs['''pixel_values'''].shape
         # check size is divisible by 32
         self.assertTrue((inputs_shape[-1] % 3_2) == 0 and (inputs_shape[-2] % 3_2) == 0)
         # check size
         self.assertEqual(a__			,    (1, 3, 3_8_4, 3_8_4))

         with torch.no_grad():
             A__					=       model(**a__)
         # masks_queries_logits
         A__					=       outputs.masks_queries_logits
         self.assertEqual(
             masks_queries_logits.shape			,    (1, model.config.num_queries, inputs_shape[-2] // 4, inputs_shape[-1] // 4))
         A__					=       [
             [-8.7_8_3_9, -9.0_0_5_6, -8.8_1_2_1],
             [-7.4_1_0_4, -7.0_3_1_3, -6.5_4_0_1],
             [-6.6_1_0_5, -6.3_4_2_7, -6.4_6_7_5],
         ]
         A__					=       torch.tensor(a__).to(a__)
         self.assertTrue(torch.allclose(masks_queries_logits[0, 0, :3, :3]			,    a__			,    atol=a__))
         # class_queries_logits
         A__					=       outputs.class_queries_logits
         self.assertEqual(class_queries_logits.shape			,    (1, model.config.num_queries, model.config.num_labels + 1))
         A__					=       torch.tensor(
             [
                 [1.8_3_2_4, -8.0_8_3_5, -4.1_9_2_2],
                 [0.8_4_5_0, -9.0_0_5_0, -3.6_0_5_3],
                 [0.3_0_4_5, -7.7_2_9_3, -3.0_2_7_5],
             ]).to(a__)
         self.assertTrue(torch.allclose(outputs.class_queries_logits[0, :3, :3]			,    a__			,    atol=a__))




     def 		snake_case_		(					self):
         A__					=       MaskaFormerForUniversalSegmentation.from_pretrained(self.model_checkpoints).to(a__).eval()
         A__					=       self.default_image_processor

         A__					=       image_processor(
             [np.zeros((3, 8_0_0, 1_3_3_3)), np.zeros((3, 8_0_0, 1_3_3_3))]			,    segmentation_maps=[np.zeros((3_8_4, 3_8_4)).astype(np.floataa), np.zeros((3_8_4, 3_8_4)).astype(np.floataa)]			,    return_tensors='''pt'''			,    )

         A__					=       inputs['''pixel_values'''].to(a__)
         A__					=       [el.to(a__) for el in inputs['''mask_labels''']]
         A__					=       [el.to(a__) for el in inputs['''class_labels''']]

         with torch.no_grad():
             A__					=       model(**a__)

         self.assertTrue(outputs.loss is not None)





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




     def __init__(					self			,    a__			,    a__=1_3			,    a__=7			,    a__=True			,    a__=True			,    a__=True			,    a__=True			,    a__=9_9			,    a__=3_2			,    a__=2			,    a__=4			,    a__=3_7			,    a__="gelu"			,    a__=0.1			,    a__=0.1			,    a__=5_1_2			,    a__=1_6			,    a__=2			,    a__=0.0_2			,    a__=False			,    a__=True			,    a__="None"			,    a__=3			,    a__=4			,    a__=None			,    ):
         A__					=       parent
         A__					=       batch_size
         A__					=       seq_length
         A__					=       is_training
         A__					=       use_input_mask
         A__					=       use_token_type_ids
         A__					=       use_labels
         A__					=       vocab_size
         A__					=       hidden_size
         A__					=       num_hidden_layers
         A__					=       num_attention_heads
         A__					=       intermediate_size
         A__					=       hidden_act
         A__					=       hidden_dropout_prob
         A__					=       attention_probs_dropout_prob
         A__					=       max_position_embeddings
         A__					=       type_vocab_size
         A__					=       type_sequence_label_size
         A__					=       initializer_range
         A__					=       num_labels
         A__					=       num_choices
         A__					=       relative_attention
         A__					=       position_biased_input
         A__					=       pos_att_type
         A__					=       scope




     def 		snake_case_		(					self):
         A__					=       ids_tensor([self.batch_size, self.seq_length]			,    self.vocab_size)

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

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

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

         A__					=       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=a__			,    )

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




     def 		snake_case_		(					self			,    a__			,    a__			,    a__			,    a__			,    a__			,    a__			,    a__):
         A__					=       TFDebertaVaModel(config=a__)
         A__					=       {'''input_ids''': input_ids, '''attention_mask''': input_mask, '''token_type_ids''': token_type_ids}

         A__					=       [input_ids, input_mask]
         A__					=       model(a__)

         A__					=       model(a__)

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




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




     def 		snake_case_		(					self			,    a__			,    a__			,    a__			,    a__			,    a__			,    a__			,    a__):
         A__					=       self.num_labels
         A__					=       TFDebertaVaForSequenceClassification(config=a__)
         A__					=       {
             '''input_ids''': input_ids,
             '''attention_mask''': input_mask,
             '''token_type_ids''': token_type_ids,
         }

         A__					=       model(a__)
         self.parent.assertEqual(result.logits.shape			,    (self.batch_size, self.num_labels))




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




     def 		snake_case_		(					self			,    a__			,    a__			,    a__			,    a__			,    a__			,    a__			,    a__):
         A__					=       TFDebertaVaForQuestionAnswering(config=a__)
         A__					=       {
             '''input_ids''': input_ids,
             '''attention_mask''': input_mask,
             '''token_type_ids''': token_type_ids,
         }

         A__					=       model(a__)
         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):
         A__					=       self.prepare_config_and_inputs()
         (
             (
             A__
         )			,						(
             A__
         )			,						(
             A__
         )			,						(
             A__
         )			,						(
             A__
         )			,						(
             A__
         )			,						(
             A__
         )			,						
         )					=       config_and_inputs
         A__					=       {'''input_ids''': input_ids, '''token_type_ids''': token_type_ids, '''attention_mask''': input_mask}
         return config, inputs_dict







@require_tf
class      _UpperCAmelCase      (							A__      ,   A__      ,   unittest.TestCase  ):
     UpperCamelCase__		     =					(
         (
             TFDebertaVaModel,
             TFDebertaVaForMaskedLM,
             TFDebertaVaForQuestionAnswering,
             TFDebertaVaForSequenceClassification,
             TFDebertaVaForTokenClassification,
         )
         if is_tf_available()
         else ()
     )
     UpperCamelCase__		     =					(
         {
             '''feature-extraction''': TFDebertaVaModel,
             '''fill-mask''': TFDebertaVaForMaskedLM,
             '''question-answering''': TFDebertaVaForQuestionAnswering,
             '''text-classification''': TFDebertaVaForSequenceClassification,
             '''token-classification''': TFDebertaVaForTokenClassification,
             '''zero-shot''': TFDebertaVaForSequenceClassification,
         }
         if is_tf_available()
         else {}
     )

     UpperCamelCase__		     =					False
     UpperCamelCase__		     =					False




     def 		snake_case_		(					self):
         A__					=       TFDebertaVaModelTester(self)
         A__					=       ConfigTester(self			,    config_class=a__			,    hidden_size=3_7)




     def 		snake_case_		(					self):
         self.config_tester.run_common_tests()




     def 		snake_case_		(					self):
         A__					=       self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_model(*a__)




     def 		snake_case_		(					self):
         A__					=       self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_for_masked_lm(*a__)




     def 		snake_case_		(					self):
         A__					=       self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_for_question_answering(*a__)




     def 		snake_case_		(					self):
         A__					=       self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_for_sequence_classification(*a__)




     def 		snake_case_		(					self):
         A__					=       self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_for_token_classification(*a__)




     @slow
     def 		snake_case_		(					self):
         A__					=       TFDebertaVaModel.from_pretrained('''kamalkraj/deberta-v2-xlarge''')
         self.assertIsNotNone(a__)







@require_tf
class      _UpperCAmelCase      (							unittest.TestCase  ):




     @unittest.skip(reason='''Model not available yet''')
     def 		snake_case_		(					self):
         pass




     @slow
     def 		snake_case_		(					self):
         A__					=       TFDebertaVaModel.from_pretrained('''kamalkraj/deberta-v2-xlarge''')
         A__					=       tf.constant([[0, 3_1_4_1_4, 2_3_2, 3_2_8, 7_4_0, 1_1_4_0, 1_2_6_9_5, 6_9, 4_6_0_7_8, 1_5_8_8, 2]])
         A__					=       tf.constant([[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]])
         A__					=       model(a__			,    attention_mask=a__)[0]

         A__					=       tf.constant(
             [[[0.2_3_5_6, 0.1_9_4_8, 0.0_3_6_9], [-0.1_0_6_3, 0.3_5_8_6, -0.5_1_5_2], [-0.6_3_9_9, -0.0_2_5_9, -0.2_5_2_5]]])
         tf.debugging.assert_near(output[:, 1:4, 1:4]			,    a__			,    atol=1e-4)
