


import json
import os
import shutil
import tempfile
import unittest

import numpy as np
import pytest

from transformers import MgpstrTokenizer
from transformers.models.mgp_str.tokenization_mgp_str import VOCAB_FILES_NAMES
from transformers.testing_utils import require_torch, require_vision
from transformers.utils import IMAGE_PROCESSOR_NAME, is_torch_available, is_vision_available


if is_torch_available():
			import torch


if is_vision_available():
			from PIL import Image

			from transformers import MgpstrProcessor, ViTImageProcessor




@require_torch
@require_vision
class    UpperCAmelCase					(       unittest.TestCase    ):
			lowercase						= ViTImageProcessor if is_vision_available() else None




			@property
			def   lowerCamelCase_					(						self							:		str						):







						"""simple docstring"""







						return self.image_processor_tester.prepare_image_processor_dict()




			def   lowerCamelCase_					(						self							:		Optional[int]						):







						"""simple docstring"""







						UpperCamelCase         =					(3, 3_2, 1_2_8)
						UpperCamelCase         =					tempfile.mkdtemp()

						# fmt: off
						UpperCamelCase         =					["""[GO]""", """[s]""", """0""", """1""", """2""", """3""", """4""", """5""", """6""", """7""", """8""", """9""", """a""", """b""", """c""", """d""", """e""", """f""", """g""", """h""", """i""", """j""", """k""", """l""", """m""", """n""", """o""", """p""", """q""", """r""", """s""", """t""", """u""", """v""", """w""", """x""", """y""", """z"""]
						# fmt: on
						UpperCamelCase         =					dict(zip(__magic_name__       ,       range(len(__magic_name__						)						)						)						)

						UpperCamelCase         =					os.path.join(self.tmpdirname       ,       VOCAB_FILES_NAMES["""vocab_file"""]						)
						with open(self.vocab_file       ,       """w"""       ,       encoding="""utf-8"""						) as fp:
									fp.write(json.dumps(__magic_name__						) + """\n"""						)

						UpperCamelCase         =					{
						    """do_normalize""": False,
						    """do_resize""": True,
						    """image_processor_type""": """ViTImageProcessor""",
						    """resample""": 3,
						    """size""": {"""height""": 3_2, """width""": 1_2_8},
						}
						UpperCamelCase         =					os.path.join(self.tmpdirname       ,       __magic_name__						)
						with open(self.image_processor_file       ,       """w"""       ,       encoding="""utf-8"""						) as fp:
									json.dump(__magic_name__       ,       __magic_name__						)




			def   lowerCamelCase_					(						self							:		int       ,       **__magic_name__							:		Optional[Any]						):







						"""simple docstring"""







						return MgpstrTokenizer.from_pretrained(self.tmpdirname       ,       **__magic_name__						)




			def   lowerCamelCase_					(						self							:		List[str]       ,       **__magic_name__							:		Optional[int]						):







						"""simple docstring"""







						return ViTImageProcessor.from_pretrained(self.tmpdirname       ,       **__magic_name__						)




			def   lowerCamelCase_					(						self							:		Optional[int]						):







						"""simple docstring"""







						shutil.rmtree(self.tmpdirname						)




			def   lowerCamelCase_					(						self							:		Tuple						):







						"""simple docstring"""







						UpperCamelCase         =					np.random.randint(2_5_5       ,       size=(3, 3_0, 4_0_0)       ,       dtype=np.uinta						)

						UpperCamelCase         =					Image.fromarray(np.moveaxis(__magic_name__       ,       0       ,       -1						)						)

						return image_input




			def   lowerCamelCase_					(						self							:		str						):







						"""simple docstring"""







						UpperCamelCase         =					self.get_tokenizer()
						UpperCamelCase         =					self.get_image_processor()

						UpperCamelCase         =					MgpstrProcessor(tokenizer=__magic_name__       ,       image_processor=__magic_name__						)
						processor.save_pretrained(self.tmpdirname						)
						UpperCamelCase         =					MgpstrProcessor.from_pretrained(self.tmpdirname       ,       use_fast=__magic_name__						)

						self.assertEqual(processor.char_tokenizer.get_vocab()       ,       tokenizer.get_vocab()						)
						self.assertIsInstance(processor.char_tokenizer       ,       __magic_name__						)

						self.assertEqual(processor.image_processor.to_json_string()       ,       image_processor.to_json_string()						)
						self.assertIsInstance(processor.image_processor       ,       __magic_name__						)




			def   lowerCamelCase_					(						self							:		Dict						):







						"""simple docstring"""







						UpperCamelCase         =					self.get_tokenizer()
						UpperCamelCase         =					self.get_image_processor()

						UpperCamelCase         =					MgpstrProcessor(tokenizer=__magic_name__       ,       image_processor=__magic_name__						)
						processor.save_pretrained(self.tmpdirname						)

						UpperCamelCase         =					self.get_tokenizer(bos_token="""(BOS)"""       ,       eos_token="""(EOS)"""						)
						UpperCamelCase         =					self.get_image_processor(do_normalize=__magic_name__       ,       padding_value=1.0						)

						UpperCamelCase         =					MgpstrProcessor.from_pretrained(
						    self.tmpdirname       ,       bos_token="""(BOS)"""       ,       eos_token="""(EOS)"""       ,       do_normalize=__magic_name__       ,       padding_value=1.0						)

						self.assertEqual(processor.char_tokenizer.get_vocab()       ,       tokenizer_add_kwargs.get_vocab()						)
						self.assertIsInstance(processor.char_tokenizer       ,       __magic_name__						)

						self.assertEqual(processor.image_processor.to_json_string()       ,       image_processor_add_kwargs.to_json_string()						)
						self.assertIsInstance(processor.image_processor       ,       __magic_name__						)




			def   lowerCamelCase_					(						self							:		Optional[int]						):







						"""simple docstring"""







						UpperCamelCase         =					self.get_image_processor()
						UpperCamelCase         =					self.get_tokenizer()

						UpperCamelCase         =					MgpstrProcessor(tokenizer=__magic_name__       ,       image_processor=__magic_name__						)

						UpperCamelCase         =					self.prepare_image_inputs()

						UpperCamelCase         =					image_processor(__magic_name__       ,       return_tensors="""np"""						)
						UpperCamelCase         =					processor(images=__magic_name__       ,       return_tensors="""np"""						)

						for key in input_image_proc.keys():
									self.assertAlmostEqual(input_image_proc[key].sum()       ,       input_processor[key].sum()       ,       delta=1e-2						)




			def   lowerCamelCase_					(						self							:		List[Any]						):







						"""simple docstring"""







						UpperCamelCase         =					self.get_image_processor()
						UpperCamelCase         =					self.get_tokenizer()

						UpperCamelCase         =					MgpstrProcessor(tokenizer=__magic_name__       ,       image_processor=__magic_name__						)

						UpperCamelCase         =					"""test"""

						UpperCamelCase         =					processor(text=__magic_name__						)

						UpperCamelCase         =					tokenizer(__magic_name__						)
						for key in encoded_tok.keys():
									self.assertListEqual(encoded_tok[key]       ,       encoded_processor[key]						)




			def   lowerCamelCase_					(						self							:		Optional[Any]						):







						"""simple docstring"""







						UpperCamelCase         =					self.get_image_processor()
						UpperCamelCase         =					self.get_tokenizer()

						UpperCamelCase         =					MgpstrProcessor(tokenizer=__magic_name__       ,       image_processor=__magic_name__						)

						UpperCamelCase         =					"""test"""
						UpperCamelCase         =					self.prepare_image_inputs()

						UpperCamelCase         =					processor(text=__magic_name__       ,       images=__magic_name__						)

						self.assertListEqual(list(inputs.keys()						)       ,       ["""pixel_values""", """labels"""]						)

						# test if it raises when no input is passed
						with pytest.raises(__magic_name__						):
									processor()




			def   lowerCamelCase_					(						self							:		Dict						):







						"""simple docstring"""







						UpperCamelCase         =					self.get_image_processor()
						UpperCamelCase         =					self.get_tokenizer()

						UpperCamelCase         =					MgpstrProcessor(tokenizer=__magic_name__       ,       image_processor=__magic_name__						)

						UpperCamelCase         =					[[1, 4, 5, 8, 1, 0, 8], [3, 4, 3, 1, 1, 8, 9], [3, 4, 3, 1, 1, 8, 9]]

						UpperCamelCase         =					processor.char_decode(__magic_name__						)
						UpperCamelCase         =					tokenizer.batch_decode(__magic_name__						)
						UpperCamelCase         =					[seq.replace(""" """       ,       """"""						) for seq in decoded_tok]

						self.assertListEqual(__magic_name__       ,       __magic_name__						)




			def   lowerCamelCase_					(						self							:		int						):







						"""simple docstring"""







						UpperCamelCase         =					self.get_image_processor()
						UpperCamelCase         =					self.get_tokenizer()

						UpperCamelCase         =					MgpstrProcessor(tokenizer=__magic_name__       ,       image_processor=__magic_name__						)

						UpperCamelCase         =					None
						UpperCamelCase         =					self.prepare_image_inputs()

						UpperCamelCase         =					processor(text=__magic_name__       ,       images=__magic_name__						)

						self.assertListEqual(list(inputs.keys()						)       ,       processor.model_input_names						)





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







						"""simple docstring"""







						UpperCamelCase         =					self.get_image_processor()
						UpperCamelCase         =					self.get_tokenizer()

						UpperCamelCase         =					MgpstrProcessor(tokenizer=__magic_name__       ,       image_processor=__magic_name__						)

						UpperCamelCase         =					torch.randn(1       ,       2_7       ,       3_8						)
						UpperCamelCase         =					torch.randn(1       ,       2_7       ,       5_0_2_5_7						)
						UpperCamelCase         =					torch.randn(1       ,       2_7       ,       3_0_5_2_2						)

						UpperCamelCase         =					processor.batch_decode([char_input, bpe_input, wp_input]						)

						self.assertListEqual(list(results.keys()						)       ,       ["""generated_text""", """scores""", """char_preds""", """bpe_preds""", """wp_preds"""]						)








import unittest

from transformers import BertGenerationConfig, is_torch_available
from transformers.testing_utils import require_torch, slow, torch_device

from ...generation.test_utils import GenerationTesterMixin
from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
			import torch

			from transformers import BertGenerationDecoder, BertGenerationEncoder




class    UpperCAmelCase					:




			def __init__(						self							:		Union[str, Any]       ,       __magic_name__							:		List[Any]       ,       __magic_name__							:		str=1_3       ,       __magic_name__							:		str=7       ,       __magic_name__							:		Optional[Any]=True       ,       __magic_name__							:		Optional[Any]=True       ,       __magic_name__							:		Tuple=9_9       ,       __magic_name__							:		List[str]=3_2       ,       __magic_name__							:		List[str]=5       ,       __magic_name__							:		int=4       ,       __magic_name__							:		Union[str, Any]=3_7       ,       __magic_name__							:		List[Any]="gelu"       ,       __magic_name__							:		Any=0.1       ,       __magic_name__							:		Union[str, Any]=0.1       ,       __magic_name__							:		List[Any]=5_0       ,       __magic_name__							:		Tuple=0.02       ,       __magic_name__							:		Optional[int]=True       ,       __magic_name__							:		Optional[Any]=None       ,       ):







						"""simple docstring"""







						UpperCamelCase         =					parent
						UpperCamelCase         =					batch_size
						UpperCamelCase         =					seq_length
						UpperCamelCase         =					is_training
						UpperCamelCase         =					use_input_mask
						UpperCamelCase         =					vocab_size
						UpperCamelCase         =					hidden_size
						UpperCamelCase         =					num_hidden_layers
						UpperCamelCase         =					num_attention_heads
						UpperCamelCase         =					intermediate_size
						UpperCamelCase         =					hidden_act
						UpperCamelCase         =					hidden_dropout_prob
						UpperCamelCase         =					attention_probs_dropout_prob
						UpperCamelCase         =					max_position_embeddings
						UpperCamelCase         =					initializer_range
						UpperCamelCase         =					use_labels
						UpperCamelCase         =					scope




			def   lowerCamelCase_					(						self							:		Optional[int]						):







						"""simple docstring"""







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

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

						if self.use_labels:
									UpperCamelCase         =					ids_tensor([self.batch_size, self.seq_length]       ,       self.vocab_size						)

						UpperCamelCase         =					self.get_config()

						return config, input_ids, input_mask, token_labels




			def   lowerCamelCase_					(						self							:		str						):







						"""simple docstring"""







						return BertGenerationConfig(
						    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       ,       is_decoder=__magic_name__       ,       initializer_range=self.initializer_range       ,       )




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







						"""simple docstring"""







						(
						    (
						    UpperCamelCase
						)  ,  (
						    UpperCamelCase
						)  ,  (
						    UpperCamelCase
						)  ,  (
						    UpperCamelCase
						)  ,  
						)         =					self.prepare_config_and_inputs()

						UpperCamelCase         =					True
						UpperCamelCase         =					floats_tensor([self.batch_size, self.seq_length, self.hidden_size]						)
						UpperCamelCase         =					ids_tensor([self.batch_size, self.seq_length]       ,       vocab_size=2						)

						return (
						    config,
						    input_ids,
						    input_mask,
						    token_labels,
						    encoder_hidden_states,
						    encoder_attention_mask,
						)




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







						"""simple docstring"""







						UpperCamelCase         =					BertGenerationEncoder(config=__magic_name__						)
						model.to(__magic_name__						)
						model.eval()
						UpperCamelCase         =					model(__magic_name__       ,       attention_mask=__magic_name__						)
						UpperCamelCase         =					model(__magic_name__						)
						self.parent.assertEqual(result.last_hidden_state.shape       ,       (self.batch_size, self.seq_length, self.hidden_size)						)




			def   lowerCamelCase_					(						self							:		Optional[int]       ,       __magic_name__							:		Dict       ,       __magic_name__							:		str       ,       __magic_name__							:		Union[str, Any]       ,       __magic_name__							:		List[str]       ,       __magic_name__							:		Optional[Any]       ,       __magic_name__							:		Tuple       ,       **__magic_name__							:		Union[str, Any]       ,       ):







						"""simple docstring"""







						UpperCamelCase         =					True
						UpperCamelCase         =					BertGenerationEncoder(config=__magic_name__						)
						model.to(__magic_name__						)
						model.eval()
						UpperCamelCase         =					model(
						    __magic_name__       ,       attention_mask=__magic_name__       ,       encoder_hidden_states=__magic_name__       ,       encoder_attention_mask=__magic_name__       ,       )
						UpperCamelCase         =					model(
						    __magic_name__       ,       attention_mask=__magic_name__       ,       encoder_hidden_states=__magic_name__       ,       )
						self.parent.assertEqual(result.last_hidden_state.shape       ,       (self.batch_size, self.seq_length, self.hidden_size)						)




			def   lowerCamelCase_					(						self							:		Optional[int]       ,       __magic_name__							:		Optional[Any]       ,       __magic_name__							:		str       ,       __magic_name__							:		List[str]       ,       __magic_name__							:		Optional[int]       ,       __magic_name__							:		str       ,       __magic_name__							:		Union[str, Any]       ,       **__magic_name__							:		Dict       ,       ):







						"""simple docstring"""







						UpperCamelCase         =					True
						UpperCamelCase         =					True
						UpperCamelCase         =					BertGenerationDecoder(config=__magic_name__						).to(__magic_name__						).eval()

						# first forward pass
						UpperCamelCase         =					model(
						    __magic_name__       ,       attention_mask=__magic_name__       ,       encoder_hidden_states=__magic_name__       ,       encoder_attention_mask=__magic_name__       ,       use_cache=__magic_name__       ,       )
						UpperCamelCase         =					outputs.past_key_values

						# create hypothetical multiple next token and extent to next_input_ids
						UpperCamelCase         =					ids_tensor((self.batch_size, 3)       ,       config.vocab_size						)
						UpperCamelCase         =					ids_tensor((self.batch_size, 3)       ,       vocab_size=2						)

						# append to next input_ids and
						UpperCamelCase         =					torch.cat([input_ids, next_tokens]       ,       dim=-1						)
						UpperCamelCase         =					torch.cat([input_mask, next_mask]       ,       dim=-1						)

						UpperCamelCase         =					model(
						    __magic_name__       ,       attention_mask=__magic_name__       ,       encoder_hidden_states=__magic_name__       ,       encoder_attention_mask=__magic_name__       ,       output_hidden_states=__magic_name__       ,       )["""hidden_states"""][0]
						UpperCamelCase         =					model(
						    __magic_name__       ,       attention_mask=__magic_name__       ,       encoder_hidden_states=__magic_name__       ,       encoder_attention_mask=__magic_name__       ,       past_key_values=__magic_name__       ,       output_hidden_states=__magic_name__       ,       )["""hidden_states"""][0]

						# select random slice
						UpperCamelCase         =					ids_tensor((1,)       ,       output_from_past.shape[-1]						).item()
						UpperCamelCase         =					output_from_no_past[:, -3:, random_slice_idx].detach()
						UpperCamelCase         =					output_from_past[:, :, random_slice_idx].detach()

						self.parent.assertTrue(output_from_past_slice.shape[1] == next_tokens.shape[1]						)

						# test that outputs are equal for slice
						self.parent.assertTrue(torch.allclose(__magic_name__       ,       __magic_name__       ,       atol=1e-3						)						)




			def   lowerCamelCase_					(						self							:		int       ,       __magic_name__							:		Any       ,       __magic_name__							:		List[str]       ,       __magic_name__							:		Union[str, Any]       ,       __magic_name__							:		List[Any]       ,       *__magic_name__							:		Optional[Any]       ,       ):







						"""simple docstring"""







						UpperCamelCase         =					BertGenerationDecoder(__magic_name__						)
						model.to(__magic_name__						)
						model.eval()
						UpperCamelCase         =					model(__magic_name__       ,       attention_mask=__magic_name__       ,       labels=__magic_name__						)
						self.parent.assertEqual(result.logits.shape       ,       (self.batch_size, self.seq_length, self.vocab_size)						)





			def   lowerCamelCase_					(						self							:		List[Any]						):







						"""simple docstring"""







						UpperCamelCase  ,  UpperCamelCase  ,  UpperCamelCase  ,  UpperCamelCase         =					self.prepare_config_and_inputs()
						UpperCamelCase         =					{"""input_ids""": input_ids, """attention_mask""": input_mask}
						return config, inputs_dict




@require_torch
class    UpperCAmelCase					(       __snake_case      , __snake_case      , __snake_case      , unittest.TestCase    ):
			lowercase						= (BertGenerationEncoder, BertGenerationDecoder) if is_torch_available() else ()
			lowercase						= (BertGenerationDecoder,) if is_torch_available() else ()
			lowercase						= (
			    {"""feature-extraction""": BertGenerationEncoder, """text-generation""": BertGenerationDecoder}
			    if is_torch_available()
			    else {}
			)




			def   lowerCamelCase_					(						self							:		Tuple						):







						"""simple docstring"""







						UpperCamelCase         =					BertGenerationEncoderTester(self						)
						UpperCamelCase         =					ConfigTester(self       ,       config_class=__magic_name__       ,       hidden_size=3_7						)




			def   lowerCamelCase_					(						self							:		Optional[int]						):







						"""simple docstring"""







						self.config_tester.run_common_tests()




			def   lowerCamelCase_					(						self							:		Any						):







						"""simple docstring"""







						UpperCamelCase         =					self.model_tester.prepare_config_and_inputs()
						self.model_tester.create_and_check_model(*__magic_name__						)




			def   lowerCamelCase_					(						self							:		List[str]						):







						"""simple docstring"""







						UpperCamelCase  ,  UpperCamelCase  ,  UpperCamelCase  ,  UpperCamelCase         =					self.model_tester.prepare_config_and_inputs()
						UpperCamelCase         =					"""bert"""
						self.model_tester.create_and_check_model(__magic_name__       ,       __magic_name__       ,       __magic_name__       ,       __magic_name__						)




			def   lowerCamelCase_					(						self							:		Tuple						):







						"""simple docstring"""







						UpperCamelCase         =					self.model_tester.prepare_config_and_inputs_for_decoder()
						self.model_tester.create_and_check_model_as_decoder(*__magic_name__						)




			def   lowerCamelCase_					(						self							:		List[Any]						):







						"""simple docstring"""







						UpperCamelCase         =					self.model_tester.prepare_config_and_inputs_for_decoder()
						self.model_tester.create_and_check_decoder_model_past_large_inputs(*__magic_name__						)




			def   lowerCamelCase_					(						self							:		Dict						):







						"""simple docstring"""







						(
						    (
						    UpperCamelCase
						)  ,  (
						    UpperCamelCase
						)  ,  (
						    UpperCamelCase
						)  ,  (
						    UpperCamelCase
						)  ,  (
						    UpperCamelCase
						)  ,  (
						    UpperCamelCase
						)  ,  
						)         =					self.model_tester.prepare_config_and_inputs_for_decoder()

						UpperCamelCase         =					None

						self.model_tester.create_and_check_model_as_decoder(
						    __magic_name__       ,       __magic_name__       ,       __magic_name__       ,       __magic_name__       ,       __magic_name__       ,       __magic_name__       ,       )




			def   lowerCamelCase_					(						self							:		str						):







						"""simple docstring"""







						UpperCamelCase         =					self.model_tester.prepare_config_and_inputs_for_decoder()
						self.model_tester.create_and_check_for_causal_lm(*__magic_name__						)





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







						"""simple docstring"""







						UpperCamelCase         =					BertGenerationEncoder.from_pretrained("""google/bert_for_seq_generation_L-24_bbc_encoder"""						)
						self.assertIsNotNone(__magic_name__						)




@require_torch
class    UpperCAmelCase					(       unittest.TestCase    ):




			@slow
			def   lowerCamelCase_					(						self							:		Tuple						):







						"""simple docstring"""







						UpperCamelCase         =					BertGenerationEncoder.from_pretrained("""google/bert_for_seq_generation_L-24_bbc_encoder"""						)
						UpperCamelCase         =					torch.tensor([[1_0_1, 7_5_9_2, 1_0_1_0, 2_0_2_6, 3_8_9_9, 2_0_0_3, 1_0_1_4_0, 1_0_2]]						)
						with torch.no_grad():
									UpperCamelCase         =					model(__magic_name__						)[0]
						UpperCamelCase         =					torch.Size([1, 8, 1_0_2_4]						)
						self.assertEqual(output.shape       ,       __magic_name__						)
						UpperCamelCase         =					torch.tensor(
						    [[[0.1_775, 0.0_083, -0.0_321], [1.6_002, 0.1_287, 0.3_912], [2.1_473, 0.5_791, 0.6_066]]]						)
						self.assertTrue(torch.allclose(output[:, :3, :3]       ,       __magic_name__       ,       atol=1e-4						)						)




@require_torch
class    UpperCAmelCase					(       unittest.TestCase    ):




			@slow
			def   lowerCamelCase_					(						self							:		int						):







						"""simple docstring"""







						UpperCamelCase         =					BertGenerationDecoder.from_pretrained("""google/bert_for_seq_generation_L-24_bbc_encoder"""						)
						UpperCamelCase         =					torch.tensor([[1_0_1, 7_5_9_2, 1_0_1_0, 2_0_2_6, 3_8_9_9, 2_0_0_3, 1_0_1_4_0, 1_0_2]]						)
						with torch.no_grad():
									UpperCamelCase         =					model(__magic_name__						)[0]
						UpperCamelCase         =					torch.Size([1, 8, 5_0_3_5_8]						)
						self.assertEqual(output.shape       ,       __magic_name__						)
						UpperCamelCase         =					torch.tensor(
						    [[[-0.5_788, -2.5_994, -3.7_054], [0.0_438, 4.7_997, 1.8_795], [1.5_862, 6.6_409, 4.4_638]]]						)
						self.assertTrue(torch.allclose(output[:, :3, :3]       ,       __magic_name__       ,       atol=1e-4						)						)




