



import unittest

from transformers import DebertaVaConfig, is_torch_available
from transformers.testing_utils import require_sentencepiece, require_tokenizers, require_torch, slow, torch_device

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


if is_torch_available():
			import torch

			from transformers import (
			    DebertaVaForMaskedLM,
			    DebertaVaForMultipleChoice,
			    DebertaVaForQuestionAnswering,
			    DebertaVaForSequenceClassification,
			    DebertaVaForTokenClassification,
			    DebertaVaModel,
			)
			from transformers.models.deberta_va.modeling_deberta_va import DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST


class 						lowercase    (							SCREAMING_SNAKE_CASE_):
						'''simple docstring'''


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



											'''simple docstring'''


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







						def       lowerCamelCase_				(  self    :				Union[str, Any]	):



											'''simple docstring'''


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

											SCREAMING_SNAKE_CASE							:     Optional[Any]						=				None
											if self.use_input_mask:
																SCREAMING_SNAKE_CASE							:     Union[str, Any]						=				ids_tensor([self.batch_size, self.seq_length]       ,	vocab_size=2	)

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

											SCREAMING_SNAKE_CASE							:     str						=				None
											SCREAMING_SNAKE_CASE							:     Union[str, Any]						=				None
											SCREAMING_SNAKE_CASE							:     List[Any]						=				None
											if self.use_labels:
																SCREAMING_SNAKE_CASE							:     List[str]						=				ids_tensor([self.batch_size]       ,	self.type_sequence_label_size	)
																SCREAMING_SNAKE_CASE							:     Tuple						=				ids_tensor([self.batch_size, self.seq_length]       ,	self.num_labels	)
																SCREAMING_SNAKE_CASE							:     Any						=				ids_tensor([self.batch_size]       ,	self.num_choices	)

											SCREAMING_SNAKE_CASE							:     int						=				self.get_config()

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







						def       lowerCamelCase_				(  self    :				Dict	):



											'''simple docstring'''


											return 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       ,	initializer_range=self.initializer_range       ,	relative_attention=self.relative_attention       ,	position_biased_input=self.position_biased_input       ,	pos_att_type=self.pos_att_type       ,	)







						def       lowerCamelCase_				(  self    :				Dict       ,	snake_case    :				List[Any]	):



											'''simple docstring'''


											self.parent.assertListEqual(list(result.loss.size()	)       ,	[]	)







						def       lowerCamelCase_				(  self    :				List[Any]       ,	snake_case    :				Any       ,	snake_case    :				List[Any]       ,	snake_case    :				str       ,	snake_case    :				Optional[int]       ,	snake_case    :				Any       ,	snake_case    :				int       ,	snake_case    :				Tuple	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     Optional[int]						=				DebertaVaModel(config=snake_case	)
											model.to(snake_case	)
											model.eval()
											SCREAMING_SNAKE_CASE							:     Tuple						=				model(snake_case       ,	attention_mask=snake_case       ,	token_type_ids=snake_case	)[0]
											SCREAMING_SNAKE_CASE							:     int						=				model(snake_case       ,	token_type_ids=snake_case	)[0]
											SCREAMING_SNAKE_CASE							:     Optional[Any]						=				model(snake_case	)[0]

											self.parent.assertListEqual(list(sequence_output.size()	)       ,	[self.batch_size, self.seq_length, self.hidden_size]	)







						def       lowerCamelCase_				(  self    :				str       ,	snake_case    :				Any       ,	snake_case    :				Dict       ,	snake_case    :				Any       ,	snake_case    :				Union[str, Any]       ,	snake_case    :				int       ,	snake_case    :				Union[str, Any]       ,	snake_case    :				Tuple	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     Any						=				DebertaVaForMaskedLM(config=snake_case	)
											model.to(snake_case	)
											model.eval()
											SCREAMING_SNAKE_CASE							:     str						=				model(snake_case       ,	attention_mask=snake_case       ,	token_type_ids=snake_case       ,	labels=snake_case	)

											self.parent.assertEqual(result.logits.shape       ,	(self.batch_size, self.seq_length, self.vocab_size)	)







						def       lowerCamelCase_				(  self    :				List[str]       ,	snake_case    :				Any       ,	snake_case    :				Optional[Any]       ,	snake_case    :				Tuple       ,	snake_case    :				List[str]       ,	snake_case    :				List[Any]       ,	snake_case    :				str       ,	snake_case    :				Optional[Any]	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     List[str]						=				self.num_labels
											SCREAMING_SNAKE_CASE							:     List[str]						=				DebertaVaForSequenceClassification(snake_case	)
											model.to(snake_case	)
											model.eval()
											SCREAMING_SNAKE_CASE							:     int						=				model(snake_case       ,	attention_mask=snake_case       ,	token_type_ids=snake_case       ,	labels=snake_case	)
											self.parent.assertListEqual(list(result.logits.size()	)       ,	[self.batch_size, self.num_labels]	)
											self.check_loss_output(snake_case	)







						def       lowerCamelCase_				(  self    :				str       ,	snake_case    :				str       ,	snake_case    :				Any       ,	snake_case    :				List[str]       ,	snake_case    :				Any       ,	snake_case    :				Optional[Any]       ,	snake_case    :				Tuple       ,	snake_case    :				int	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     Optional[Any]						=				self.num_labels
											SCREAMING_SNAKE_CASE							:     Optional[Any]						=				DebertaVaForTokenClassification(config=snake_case	)
											model.to(snake_case	)
											model.eval()
											SCREAMING_SNAKE_CASE							:     Dict						=				model(snake_case       ,	attention_mask=snake_case       ,	token_type_ids=snake_case       ,	labels=snake_case	)
											self.parent.assertEqual(result.logits.shape       ,	(self.batch_size, self.seq_length, self.num_labels)	)







						def       lowerCamelCase_				(  self    :				str       ,	snake_case    :				Any       ,	snake_case    :				Any       ,	snake_case    :				Union[str, Any]       ,	snake_case    :				str       ,	snake_case    :				int       ,	snake_case    :				int       ,	snake_case    :				List[Any]	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     Any						=				DebertaVaForQuestionAnswering(config=snake_case	)
											model.to(snake_case	)
											model.eval()
											SCREAMING_SNAKE_CASE							:     List[Any]						=				model(
											    snake_case       ,	attention_mask=snake_case       ,	token_type_ids=snake_case       ,	start_positions=snake_case       ,	end_positions=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       lowerCamelCase_				(  self    :				Union[str, Any]       ,	snake_case    :				Tuple       ,	snake_case    :				Any       ,	snake_case    :				Union[str, Any]       ,	snake_case    :				Optional[int]       ,	snake_case    :				Union[str, Any]       ,	snake_case    :				int       ,	snake_case    :				Dict	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     Optional[Any]						=				DebertaVaForMultipleChoice(config=snake_case	)
											model.to(snake_case	)
											model.eval()
											SCREAMING_SNAKE_CASE							:     int						=				input_ids.unsqueeze(1	).expand(-1       ,	self.num_choices       ,	-1	).contiguous()
											SCREAMING_SNAKE_CASE							:     Optional[int]						=				token_type_ids.unsqueeze(1	).expand(-1       ,	self.num_choices       ,	-1	).contiguous()
											SCREAMING_SNAKE_CASE							:     Dict						=				input_mask.unsqueeze(1	).expand(-1       ,	self.num_choices       ,	-1	).contiguous()
											SCREAMING_SNAKE_CASE							:     List[str]						=				model(
											    snake_case       ,	attention_mask=snake_case       ,	token_type_ids=snake_case       ,	labels=snake_case       ,	)
											self.parent.assertEqual(result.logits.shape       ,	(self.batch_size, self.num_choices)	)







						def       lowerCamelCase_				(  self    :				Any	):



											'''simple docstring'''


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


@require_torch
class 						lowercase    (							SCREAMING_SNAKE_CASE_      ,    SCREAMING_SNAKE_CASE_      ,    unittest.TestCase):
						'''simple docstring'''


						UpperCAmelCase			:		Tuple		=		(
						    (
						        DebertaVaModel,
						        DebertaVaForMaskedLM,
						        DebertaVaForSequenceClassification,
						        DebertaVaForTokenClassification,
						        DebertaVaForQuestionAnswering,
						        DebertaVaForMultipleChoice,
						    )
						    if is_torch_available()
						    else ()
						)
						UpperCAmelCase			:		Any		=		(
						    {
						        'feature-extraction': DebertaVaModel,
						        'fill-mask': DebertaVaForMaskedLM,
						        'question-answering': DebertaVaForQuestionAnswering,
						        'text-classification': DebertaVaForSequenceClassification,
						        'token-classification': DebertaVaForTokenClassification,
						        'zero-shot': DebertaVaForSequenceClassification,
						    }
						    if is_torch_available()
						    else {}
						)

						UpperCAmelCase			:		Optional[Any]		=		True
						UpperCAmelCase			:		Optional[int]		=		False
						UpperCAmelCase			:		Any		=		False
						UpperCAmelCase			:		Any		=		False
						UpperCAmelCase			:		Optional[Any]		=		False







						def       lowerCamelCase_				(  self    :				List[str]	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     Tuple						=				DebertaVaModelTester(self	)
											SCREAMING_SNAKE_CASE							:     Any						=				ConfigTester(self       ,	config_class=snake_case       ,	hidden_size=37	)







						def       lowerCamelCase_				(  self    :				Dict	):



											'''simple docstring'''


											self.config_tester.run_common_tests()







						def       lowerCamelCase_				(  self    :				Optional[int]	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     int						=				self.model_tester.prepare_config_and_inputs()
											self.model_tester.create_and_check_deberta_model(*snake_case	)







						def       lowerCamelCase_				(  self    :				List[str]	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     List[Any]						=				self.model_tester.prepare_config_and_inputs()
											self.model_tester.create_and_check_deberta_for_sequence_classification(*snake_case	)







						def       lowerCamelCase_				(  self    :				int	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     Dict						=				self.model_tester.prepare_config_and_inputs()
											self.model_tester.create_and_check_deberta_for_masked_lm(*snake_case	)







						def       lowerCamelCase_				(  self    :				Tuple	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     Any						=				self.model_tester.prepare_config_and_inputs()
											self.model_tester.create_and_check_deberta_for_question_answering(*snake_case	)







						def       lowerCamelCase_				(  self    :				int	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     Union[str, Any]						=				self.model_tester.prepare_config_and_inputs()
											self.model_tester.create_and_check_deberta_for_token_classification(*snake_case	)







						def       lowerCamelCase_				(  self    :				Optional[Any]	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     Tuple						=				self.model_tester.prepare_config_and_inputs()
											self.model_tester.create_and_check_deberta_for_multiple_choice(*snake_case	)







						@slow
						def       lowerCamelCase_				(  self    :				int	):



											'''simple docstring'''


											for model_name in DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
																SCREAMING_SNAKE_CASE							:     Dict						=				DebertaVaModel.from_pretrained(snake_case	)
																self.assertIsNotNone(snake_case	)


@require_torch
@require_sentencepiece
@require_tokenizers
class 						lowercase    (							unittest.TestCase):
						'''simple docstring'''


						@unittest.skip(reason='Model not available yet'	)
						def       lowerCamelCase_				(  self    :				List[Any]	):



											'''simple docstring'''


											pass







						@slow
						def       lowerCamelCase_				(  self    :				Optional[Any]	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     Dict						=				DebertaVaModel.from_pretrained('microsoft/deberta-v2-xlarge'	)

											SCREAMING_SNAKE_CASE							:     List[str]						=				torch.tensor([[0, 31414, 232, 328, 740, 1140, 12695, 69, 46078, 1588, 2]]	)
											SCREAMING_SNAKE_CASE							:     Any						=				torch.tensor([[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]	)
											with torch.no_grad():
																SCREAMING_SNAKE_CASE							:     List[Any]						=				model(snake_case       ,	attention_mask=snake_case	)[0]
											# compare the actual values for a slice.
											SCREAMING_SNAKE_CASE							:     List[str]						=				torch.tensor(
											    [[[0.2356, 0.1948, 0.0369], [-0.1063, 0.3586, -0.5152], [-0.6399, -0.0259, -0.2525]]]	)
											self.assertTrue(torch.allclose(output[:, 1:4, 1:4]       ,	snake_case       ,	atol=1E-4	)       ,	f'''{output[:, 1:4, 1:4]}'''	)




import unittest

import numpy as np

from transformers import DistilBertConfig, is_flax_available
from transformers.testing_utils import require_flax, slow

from ...test_modeling_flax_common import FlaxModelTesterMixin, ids_tensor, random_attention_mask


if is_flax_available():
			import jax.numpy as jnp

			from transformers.models.distilbert.modeling_flax_distilbert import (
			    FlaxDistilBertForMaskedLM,
			    FlaxDistilBertForMultipleChoice,
			    FlaxDistilBertForQuestionAnswering,
			    FlaxDistilBertForSequenceClassification,
			    FlaxDistilBertForTokenClassification,
			    FlaxDistilBertModel,
			)


class 						lowercase    (							unittest.TestCase):
						'''simple docstring'''


						def __init__(  self    :				int       ,	snake_case    :				Optional[Any]       ,	snake_case    :				Optional[Any]=13       ,	snake_case    :				str=7       ,	snake_case    :				Optional[Any]=True       ,	snake_case    :				int=True       ,	snake_case    :				str=True       ,	snake_case    :				List[str]=True       ,	snake_case    :				Optional[Any]=99       ,	snake_case    :				Optional[int]=32       ,	snake_case    :				Optional[int]=5       ,	snake_case    :				Optional[Any]=4       ,	snake_case    :				Optional[Any]=37       ,	snake_case    :				str="gelu"       ,	snake_case    :				List[str]=0.1       ,	snake_case    :				List[str]=0.1       ,	snake_case    :				int=512       ,	snake_case    :				Union[str, Any]=16       ,	snake_case    :				Optional[Any]=2       ,	snake_case    :				int=0.02       ,	snake_case    :				str=4       ,	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     Tuple						=				parent
											SCREAMING_SNAKE_CASE							:     str						=				batch_size
											SCREAMING_SNAKE_CASE							:     Union[str, Any]						=				seq_length
											SCREAMING_SNAKE_CASE							:     int						=				is_training
											SCREAMING_SNAKE_CASE							:     List[str]						=				use_attention_mask
											SCREAMING_SNAKE_CASE							:     Optional[Any]						=				use_token_type_ids
											SCREAMING_SNAKE_CASE							:     Optional[int]						=				use_labels
											SCREAMING_SNAKE_CASE							:     Optional[int]						=				vocab_size
											SCREAMING_SNAKE_CASE							:     Optional[int]						=				hidden_size
											SCREAMING_SNAKE_CASE							:     Any						=				num_hidden_layers
											SCREAMING_SNAKE_CASE							:     Tuple						=				num_attention_heads
											SCREAMING_SNAKE_CASE							:     Any						=				intermediate_size
											SCREAMING_SNAKE_CASE							:     Tuple						=				hidden_act
											SCREAMING_SNAKE_CASE							:     Optional[int]						=				hidden_dropout_prob
											SCREAMING_SNAKE_CASE							:     str						=				attention_probs_dropout_prob
											SCREAMING_SNAKE_CASE							:     Tuple						=				max_position_embeddings
											SCREAMING_SNAKE_CASE							:     Any						=				type_vocab_size
											SCREAMING_SNAKE_CASE							:     List[Any]						=				type_sequence_label_size
											SCREAMING_SNAKE_CASE							:     Tuple						=				initializer_range
											SCREAMING_SNAKE_CASE							:     List[str]						=				num_choices







						def       lowerCamelCase_				(  self    :				List[Any]	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     Optional[Any]						=				ids_tensor([self.batch_size, self.seq_length]       ,	self.vocab_size	)

											SCREAMING_SNAKE_CASE							:     Optional[int]						=				None
											if self.use_attention_mask:
																SCREAMING_SNAKE_CASE							:     Any						=				random_attention_mask([self.batch_size, self.seq_length]	)

											SCREAMING_SNAKE_CASE							:     Tuple						=				DistilBertConfig(
											    vocab_size=self.vocab_size       ,	dim=self.hidden_size       ,	n_layers=self.num_hidden_layers       ,	n_heads=self.num_attention_heads       ,	hidden_dim=self.intermediate_size       ,	hidden_act=self.hidden_act       ,	dropout=self.hidden_dropout_prob       ,	attention_dropout=self.attention_probs_dropout_prob       ,	max_position_embeddings=self.max_position_embeddings       ,	initializer_range=self.initializer_range       ,	tie_weights_=snake_case       ,	)

											return config, input_ids, attention_mask







						def       lowerCamelCase_				(  self    :				int	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     Tuple						=				self.prepare_config_and_inputs()
											SCREAMING_SNAKE_CASE					,  SCREAMING_SNAKE_CASE					,  SCREAMING_SNAKE_CASE							:     Optional[int]						=				config_and_inputs
											SCREAMING_SNAKE_CASE							:     int						=				{'input_ids': input_ids, 'attention_mask': attention_mask}
											return config, inputs_dict


@require_flax
class 						lowercase    (							SCREAMING_SNAKE_CASE_      ,    unittest.TestCase):
						'''simple docstring'''


						UpperCAmelCase			:		int		=		(
						    (
						        FlaxDistilBertModel,
						        FlaxDistilBertForMaskedLM,
						        FlaxDistilBertForMultipleChoice,
						        FlaxDistilBertForQuestionAnswering,
						        FlaxDistilBertForSequenceClassification,
						        FlaxDistilBertForTokenClassification,
						        FlaxDistilBertForQuestionAnswering,
						    )
						    if is_flax_available()
						    else ()
						)







						def       lowerCamelCase_				(  self    :				Optional[int]	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     str						=				FlaxDistilBertModelTester(self	)







						@slow
						def       lowerCamelCase_				(  self    :				Any	):



											'''simple docstring'''


											for model_class_name in self.all_model_classes:
																SCREAMING_SNAKE_CASE							:     Dict						=				model_class_name.from_pretrained('distilbert-base-uncased'	)
																SCREAMING_SNAKE_CASE							:     Dict						=				model(np.ones((1, 1)	)	)
																self.assertIsNotNone(snake_case	)


@require_flax
class 						lowercase    (							unittest.TestCase):
						'''simple docstring'''


						@slow
						def       lowerCamelCase_				(  self    :				Tuple	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     List[Any]						=				FlaxDistilBertModel.from_pretrained('distilbert-base-uncased'	)
											SCREAMING_SNAKE_CASE							:     List[str]						=				np.array([[0, 345, 232, 328, 740, 140, 1695, 69, 6078, 1588, 2]]	)
											SCREAMING_SNAKE_CASE							:     Dict						=				np.array([[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]	)
											SCREAMING_SNAKE_CASE							:     str						=				model(snake_case       ,	attention_mask=snake_case	)[0]
											SCREAMING_SNAKE_CASE							:     int						=				(1, 11, 768)
											self.assertEqual(output.shape       ,	snake_case	)
											SCREAMING_SNAKE_CASE							:     Optional[int]						=				np.array([[[-0.1639, 0.3299, 0.1648], [-0.1746, 0.3289, 0.1710], [-0.1884, 0.3357, 0.1810]]]	)

											self.assertTrue(jnp.allclose(output[:, 1:4, 1:4]       ,	snake_case       ,	atol=1E-4	)	)