'''simple docstring'''





import gc
import random
import unittest

import numpy as np
import torch
from transformers import CLIPImageProcessor, CLIPVisionConfig, CLIPVisionModel

from diffusers import HeunDiscreteScheduler, PriorTransformer, ShapEImgaImgPipeline
from diffusers.pipelines.shap_e import ShapERenderer
from diffusers.utils import floats_tensor, load_image, load_numpy, slow
from diffusers.utils.testing_utils import require_torch_gpu, torch_device

from ..test_pipelines_common import PipelineTesterMixin, assert_mean_pixel_difference




class 		SCREAMING_SNAKE_CASE  (       SCREAMING_SNAKE_CASE ,			unittest.TestCase						):







				'''simple docstring'''
				UpperCAmelCase__					      =				ShapEImgaImgPipeline
				UpperCAmelCase__					      =				['''image''']
				UpperCAmelCase__					      =				['''image''']
				UpperCAmelCase__					      =				[
				    '''num_images_per_prompt''',
				    '''num_inference_steps''',
				    '''generator''',
				    '''latents''',
				    '''guidance_scale''',
				    '''frame_size''',
				    '''output_type''',
				    '''return_dict''',
				]
				UpperCAmelCase__					      =				False





				@property
				def 			snake_case__					(    self       :    Optional[int]       )				->List[Any]:


										'''simple docstring'''




										return 32





				@property
				def 			snake_case__					(    self       :    str       )				->Dict:


										'''simple docstring'''




										return 32





				@property
				def 			snake_case__					(    self       :    Any       )				->Tuple:


										'''simple docstring'''




										return self.time_input_dim * 4





				@property
				def 			snake_case__					(    self       :    str       )				->Optional[int]:


										'''simple docstring'''




										return 8





				@property
				def 			snake_case__					(    self       :    Optional[int]       )				->int:


										'''simple docstring'''




										torch.manual_seed(0       )
										_UpperCamelCase      :      Optional[Any]       =    CLIPVisionConfig(
										    hidden_size=self.text_embedder_hidden_size							,		image_size=64							,		projection_dim=self.text_embedder_hidden_size							,		intermediate_size=37							,		num_attention_heads=4							,		num_channels=3							,		num_hidden_layers=5							,		patch_size=1							,		)

										_UpperCamelCase      :      List[Any]       =    CLIPVisionModel(lowercase__       )
										return model





				@property
				def 			snake_case__					(    self       :    Optional[Any]       )				->str:


										'''simple docstring'''




										_UpperCamelCase      :      Optional[int]       =    CLIPImageProcessor(
										    crop_size=224							,		do_center_crop=lowercase__							,		do_normalize=lowercase__							,		do_resize=lowercase__							,		image_mean=[0.4_8_1_4_5_4_6_6, 0.4_5_7_8_2_7_5, 0.4_0_8_2_1_0_7_3]							,		image_std=[0.2_6_8_6_2_9_5_4, 0.2_6_1_3_0_2_5_8, 0.2_7_5_7_7_7_1_1]							,		resample=3							,		size=224							,		)

										return image_processor





				@property
				def 			snake_case__					(    self       :    int       )				->Dict:


										'''simple docstring'''




										torch.manual_seed(0       )

										_UpperCamelCase      :      List[Any]       =    {
										    "num_attention_heads": 2,
										    "attention_head_dim": 16,
										    "embedding_dim": self.time_input_dim,
										    "num_embeddings": 32,
										    "embedding_proj_dim": self.text_embedder_hidden_size,
										    "time_embed_dim": self.time_embed_dim,
										    "num_layers": 1,
										    "clip_embed_dim": self.time_input_dim * 2,
										    "additional_embeddings": 0,
										    "time_embed_act_fn": "gelu",
										    "norm_in_type": "layer",
										    "embedding_proj_norm_type": "layer",
										    "encoder_hid_proj_type": None,
										    "added_emb_type": None,
										}

										_UpperCamelCase      :      str       =    PriorTransformer(**lowercase__       )
										return model





				@property
				def 			snake_case__					(    self       :    int       )				->Tuple:


										'''simple docstring'''




										torch.manual_seed(0       )

										_UpperCamelCase      :      int       =    {
										    "param_shapes": (
										        (self.renderer_dim, 93),
										        (self.renderer_dim, 8),
										        (self.renderer_dim, 8),
										        (self.renderer_dim, 8),
										    ),
										    "d_latent": self.time_input_dim,
										    "d_hidden": self.renderer_dim,
										    "n_output": 12,
										    "background": (
										        0.1,
										        0.1,
										        0.1,
										    ),
										}
										_UpperCamelCase      :      Optional[Any]       =    ShapERenderer(**lowercase__       )
										return model





				def 			snake_case__					(    self       :    List[Any]       )				->Tuple:


										'''simple docstring'''




										_UpperCamelCase      :      int       =    self.dummy_prior
										_UpperCamelCase      :      Dict       =    self.dummy_image_encoder
										_UpperCamelCase      :      Tuple       =    self.dummy_image_processor
										_UpperCamelCase      :      Optional[Any]       =    self.dummy_renderer

										_UpperCamelCase      :      Optional[Any]       =    HeunDiscreteScheduler(
										    beta_schedule="exp"							,		num_train_timesteps=1_024							,		prediction_type="sample"							,		use_karras_sigmas=lowercase__							,		clip_sample=lowercase__							,		clip_sample_range=1.0							,		)
										_UpperCamelCase      :      Union[str, Any]       =    {
										    "prior": prior,
										    "image_encoder": image_encoder,
										    "image_processor": image_processor,
										    "renderer": renderer,
										    "scheduler": scheduler,
										}

										return components





				def 			snake_case__					(    self       :    int							,		lowercase__       :    List[str]							,		lowercase__       :    Optional[Any]=0       )				->Dict:


										'''simple docstring'''




										_UpperCamelCase      :      List[Any]       =    floats_tensor((1, 3, 64, 64)							,		rng=random.Random(lowercase__       )       ).to(lowercase__       )

										if str(lowercase__       ).startswith("mps"       ):
																_UpperCamelCase      :      Any       =    torch.manual_seed(lowercase__       )
										else:
																_UpperCamelCase      :      List[Any]       =    torch.Generator(device=lowercase__       ).manual_seed(lowercase__       )
										_UpperCamelCase      :      List[str]       =    {
										    "image": input_image,
										    "generator": generator,
										    "num_inference_steps": 1,
										    "frame_size": 32,
										    "output_type": "np",
										}
										return inputs





				def 			snake_case__					(    self       :    Dict       )				->int:


										'''simple docstring'''




										_UpperCamelCase      :      Optional[Any]       =    "cpu"

										_UpperCamelCase      :      int       =    self.get_dummy_components()

										_UpperCamelCase      :      List[Any]       =    self.pipeline_class(**lowercase__       )
										_UpperCamelCase      :      List[str]       =    pipe.to(lowercase__       )

										pipe.set_progress_bar_config(disable=lowercase__       )

										_UpperCamelCase      :      List[Any]       =    pipe(**self.get_dummy_inputs(lowercase__       )       )
										_UpperCamelCase      :      Any       =    output.images[0]
										_UpperCamelCase      :      str       =    image[0, -3:, -3:, -1]

										assert image.shape == (20, 32, 32, 3)

										_UpperCamelCase      :      Dict       =    np.array(
										    [
										        0.0_0_0_3_9_2_1_6,
										        0.0_0_0_3_9_2_1_6,
										        0.0_0_0_3_9_2_1_6,
										        0.0_0_0_3_9_2_1_6,
										        0.0_0_0_3_9_2_1_6,
										        0.0_0_0_3_9_2_1_6,
										        0.0_0_0_3_9_2_1_6,
										        0.0_0_0_3_9_2_1_6,
										        0.0_0_0_3_9_2_1_6,
										    ]       )

										assert np.abs(image_slice.flatten() - expected_slice       ).max() < 1e-2





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


										'''simple docstring'''




										self._test_inference_batch_consistent(batch_sizes=[1, 2]       )





				def 			snake_case__					(    self       :    int       )				->Any:


										'''simple docstring'''




										_UpperCamelCase      :      List[str]       =    torch_device == "cpu"
										_UpperCamelCase      :      Optional[int]       =    True
										self._test_inference_batch_single_identical(
										    batch_size=2							,		test_max_difference=lowercase__							,		relax_max_difference=lowercase__							,		)







				def 			snake_case__					(    self       :    Any       )				->int:


										'''simple docstring'''




										_UpperCamelCase      :      Tuple       =    self.get_dummy_components()
										_UpperCamelCase      :      Any       =    self.pipeline_class(**lowercase__       )
										_UpperCamelCase      :      Any       =    pipe.to(lowercase__       )
										pipe.set_progress_bar_config(disable=lowercase__       )

										_UpperCamelCase      :      List[str]       =    1
										_UpperCamelCase      :      str       =    2

										_UpperCamelCase      :      str       =    self.get_dummy_inputs(lowercase__       )

										for key in inputs.keys():
																if key in self.batch_params:
																						_UpperCamelCase      :      Optional[int]       =    batch_size * [inputs[key]]

										_UpperCamelCase      :      Optional[int]       =    pipe(**lowercase__							,		num_images_per_prompt=lowercase__       )[0]

										assert images.shape[0] == batch_size * num_images_per_prompt





@slow
@require_torch_gpu
class 		SCREAMING_SNAKE_CASE  (       unittest.TestCase						):







				'''simple docstring'''





				def 			snake_case__					(    self       :    Optional[Any]       )				->Optional[Any]:


										'''simple docstring'''




										super().tearDown()
										gc.collect()
										torch.cuda.empty_cache()







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


										'''simple docstring'''




										_UpperCamelCase      :      int       =    load_image(
										    "https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main" "/shap_e/corgi.png"       )
										_UpperCamelCase      :      Optional[int]       =    load_numpy(
										    "https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main"
										    "/shap_e/test_shap_e_img2img_out.npy"       )
										_UpperCamelCase      :      List[Any]       =    ShapEImgaImgPipeline.from_pretrained("openai/shap-e-img2img"       )
										_UpperCamelCase      :      List[str]       =    pipe.to(lowercase__       )
										pipe.set_progress_bar_config(disable=lowercase__       )

										_UpperCamelCase      :      Union[str, Any]       =    torch.Generator(device=lowercase__       ).manual_seed(0       )

										_UpperCamelCase      :      Union[str, Any]       =    pipe(
										    lowercase__							,		generator=lowercase__							,		guidance_scale=3.0							,		num_inference_steps=64							,		frame_size=64							,		output_type="np"							,		).images[0]

										assert images.shape == (20, 64, 64, 3)

										assert_mean_pixel_difference(lowercase__							,		lowercase__       )






'''simple docstring'''


import inspect
import math
import tempfile
import unittest

import numpy as np

from transformers import ViTMAEConfig
from transformers.testing_utils import require_torch, require_vision, slow, torch_device
from transformers.utils import cached_property, is_torch_available, is_vision_available

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


if is_torch_available():
      import torch
      from torch import nn

      from transformers import ViTMAEForPreTraining, ViTMAEModel
      from transformers.models.vit.modeling_vit import VIT_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
      from PIL import Image

      from transformers import ViTImageProcessor







class 							__magic_name__	:

     """simple docstring"""






     def __init__(   self			,     lowerCamelCase			,     lowerCamelCase=13			,     lowerCamelCase=30			,     lowerCamelCase=2			,     lowerCamelCase=3			,     lowerCamelCase=True			,     lowerCamelCase=True			,     lowerCamelCase=32			,     lowerCamelCase=5			,     lowerCamelCase=4			,     lowerCamelCase=37			,     lowerCamelCase="gelu"			,     lowerCamelCase=0.1			,     lowerCamelCase=0.1			,     lowerCamelCase=10			,     lowerCamelCase=0.02			,     lowerCamelCase=3			,     lowerCamelCase=0.6			,     lowerCamelCase=None			,     ):


          '''simple docstring'''





          __A	:       Tuple      =							parent
          __A	:       Union[str, Any]      =							batch_size
          __A	:       List[Any]      =							image_size
          __A	:       Union[str, Any]      =							patch_size
          __A	:       List[Any]      =							num_channels
          __A	:       Optional[Any]      =							is_training
          __A	:       str      =							use_labels
          __A	:       Tuple      =							hidden_size
          __A	:       int      =							num_hidden_layers
          __A	:       Dict      =							num_attention_heads
          __A	:       List[Any]      =							intermediate_size
          __A	:       Tuple      =							hidden_act
          __A	:       Tuple      =							hidden_dropout_prob
          __A	:       str      =							attention_probs_dropout_prob
          __A	:       Optional[Any]      =							type_sequence_label_size
          __A	:       Union[str, Any]      =							initializer_range
          __A	:       Optional[Any]      =							mask_ratio
          __A	:       List[Any]      =							scope

          # in ViTMAE, the expected sequence length = (num_patches + 1) * (1 - config.mask_ratio), rounded above
          # (we add 1 for the [CLS] token)
          __A	:       Optional[int]      =							(image_size // patch_size) ** 2
          __A	:       List[Any]      =							int(math.ceil((1 - mask_ratio) * (num_patches + 1)		)		)


     def lowerCAmelCase__  (   self		):


          '''simple docstring'''





          __A	:       Optional[Any]      =							floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]		)

          __A	:       Tuple      =							None
          if self.use_labels:
               __A	:       Union[str, Any]      =							ids_tensor([self.batch_size]			,     self.type_sequence_label_size		)

          __A	:       Optional[int]      =							self.get_config()

          return config, pixel_values, labels


     def lowerCAmelCase__  (   self		):


          '''simple docstring'''





          return ViTMAEConfig(
              image_size=self.image_size			,     patch_size=self.patch_size			,     num_channels=self.num_channels			,     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			,     is_decoder=lowerCamelCase			,     initializer_range=self.initializer_range			,     mask_ratio=self.mask_ratio			,     )


     def lowerCAmelCase__  (   self			,     lowerCamelCase			,     lowerCamelCase			,     lowerCamelCase		):


          '''simple docstring'''





          __A	:       Optional[Any]      =							ViTMAEModel(config=lowerCamelCase		)
          model.to(lowerCamelCase		)
          model.eval()
          __A	:       List[Any]      =							model(lowerCamelCase		)
          self.parent.assertEqual(result.last_hidden_state.shape			,     (self.batch_size, self.seq_length, self.hidden_size)		)


     def lowerCAmelCase__  (   self			,     lowerCamelCase			,     lowerCamelCase			,     lowerCamelCase		):


          '''simple docstring'''





          __A	:       str      =							ViTMAEForPreTraining(lowerCamelCase		)
          model.to(lowerCamelCase		)
          model.eval()
          __A	:       Optional[Any]      =							model(lowerCamelCase		)
          __A	:       List[str]      =							(self.image_size // self.patch_size) ** 2
          __A	:       List[Any]      =							self.patch_size**2 * self.num_channels
          self.parent.assertEqual(result.logits.shape			,     (self.batch_size, num_patches, expected_num_channels)		)

          # test greyscale images
          __A	:       List[str]      =							1
          __A	:       str      =							ViTMAEForPreTraining(lowerCamelCase		)
          model.to(lowerCamelCase		)
          model.eval()
          __A	:       str      =							floats_tensor([self.batch_size, 1, self.image_size, self.image_size]		)
          __A	:       int      =							model(lowerCamelCase		)
          __A	:       Union[str, Any]      =							self.patch_size**2
          self.parent.assertEqual(result.logits.shape			,     (self.batch_size, num_patches, expected_num_channels)		)


     def lowerCAmelCase__  (   self		):


          '''simple docstring'''





          __A	:       List[str]      =							self.prepare_config_and_inputs()
          __A  ,__A  ,__A	:       List[Any]      =							config_and_inputs
          __A	:       Tuple      =							{"pixel_values": pixel_values}
          return config, inputs_dict







@require_torch
class 							__magic_name__	(       lowerCAmelCase    ,		lowerCAmelCase    ,		unittest.TestCase ):

     """simple docstring"""






     lowerCamelCase__       						=				(ViTMAEModel, ViTMAEForPreTraining) if is_torch_available() else ()
     lowerCamelCase__       						=				{'feature-extraction': ViTMAEModel} if is_torch_available() else {}

     lowerCamelCase__       						=				False
     lowerCamelCase__       						=				False
     lowerCamelCase__       						=				False
     lowerCamelCase__       						=				False


     def lowerCAmelCase__  (   self		):


          '''simple docstring'''





          __A	:       Union[str, Any]      =							ViTMAEModelTester(self		)
          __A	:       Tuple      =							ConfigTester(self			,     config_class=lowerCamelCase			,     has_text_modality=lowerCamelCase			,     hidden_size=37		)


     def lowerCAmelCase__  (   self		):


          '''simple docstring'''





          self.config_tester.run_common_tests()


     @unittest.skip(reason="ViTMAE does not use inputs_embeds"		)
     def lowerCAmelCase__  (   self		):


          '''simple docstring'''





          pass


     def lowerCAmelCase__  (   self		):


          '''simple docstring'''





          __A  ,__A	:       Optional[int]      =							self.model_tester.prepare_config_and_inputs_for_common()

          for model_class in self.all_model_classes:
               __A	:       List[Any]      =							model_class(lowerCamelCase		)
               self.assertIsInstance(model.get_input_embeddings()			,     (nn.Module)		)
               __A	:       str      =							model.get_output_embeddings()
               self.assertTrue(x is None or isinstance(lowerCamelCase			,     nn.Linear		)		)


     def lowerCAmelCase__  (   self		):


          '''simple docstring'''





          __A  ,__A	:       List[str]      =							self.model_tester.prepare_config_and_inputs_for_common()

          for model_class in self.all_model_classes:
               __A	:       int      =							model_class(lowerCamelCase		)
               __A	:       Union[str, Any]      =							inspect.signature(model.forward		)
               # signature.parameters is an OrderedDict => so arg_names order is deterministic
               __A	:       Optional[Any]      =							[*signature.parameters.keys()]

               __A	:       Any      =							["pixel_values"]
               self.assertListEqual(arg_names[:1]			,     lowerCamelCase		)


     def lowerCAmelCase__  (   self		):


          '''simple docstring'''





          __A	:       Optional[Any]      =							self.model_tester.prepare_config_and_inputs()
          self.model_tester.create_and_check_model(*lowerCamelCase		)


     def lowerCAmelCase__  (   self		):


          '''simple docstring'''





          __A	:       Union[str, Any]      =							self.model_tester.prepare_config_and_inputs()
          self.model_tester.create_and_check_for_pretraining(*lowerCamelCase		)


     def lowerCAmelCase__  (   self			,     lowerCamelCase			,     lowerCamelCase			,     lowerCamelCase		):


          '''simple docstring'''





          np.random.seed(2		)

          __A	:       Tuple      =							int((pt_model.config.image_size // pt_model.config.patch_size) ** 2		)
          __A	:       Optional[Any]      =							np.random.uniform(size=(self.model_tester.batch_size, num_patches)		)
          __A	:       Optional[Any]      =							torch.from_numpy(lowerCamelCase		)

          # Add `noise` argument.
          # PT inputs will be prepared in `super().check_pt_tf_models()` with this added `noise` argument
          __A	:       int      =							pt_noise

          super().check_pt_tf_models(lowerCamelCase			,     lowerCamelCase			,     lowerCamelCase		)


     def lowerCAmelCase__  (   self		):


          '''simple docstring'''





          __A  ,__A	:       List[str]      =							self.model_tester.prepare_config_and_inputs_for_common()

          for model_class in self.all_model_classes:
               __A	:       int      =							model_class(lowerCamelCase		)
               model.to(lowerCamelCase		)
               model.eval()
               # make random mask reproducible
               torch.manual_seed(2		)
               with torch.no_grad():
                    __A	:       List[str]      =							model(**self._prepare_for_class(lowerCamelCase			,     lowerCamelCase		)		)

               __A	:       Tuple      =							outputs[0].cpu().numpy()
               __A	:       List[Any]      =							0

               with tempfile.TemporaryDirectory() as tmpdirname:
                    model.save_pretrained(lowerCamelCase		)
                    __A	:       List[Any]      =							model_class.from_pretrained(lowerCamelCase		)
                    model.to(lowerCamelCase		)
                    # make random mask reproducible
                    torch.manual_seed(2		)
                    with torch.no_grad():
                         __A	:       Optional[Any]      =							model(**self._prepare_for_class(lowerCamelCase			,     lowerCamelCase		)		)

                    # Make sure we don't have nans
                    __A	:       List[Any]      =							after_outputs[0].cpu().numpy()
                    __A	:       List[str]      =							0
                    __A	:       int      =							np.amax(np.abs(out_a - out_a		)		)
                    self.assertLessEqual(lowerCamelCase			,     1E-5		)


     @unittest.skip(
         reason="ViTMAE returns a random mask + ids_restore in each forward pass. See test_save_load\n    to get deterministic results."		)
     def lowerCAmelCase__  (   self		):


          '''simple docstring'''





          pass


     @unittest.skip(
         reason="ViTMAE returns a random mask + ids_restore in each forward pass. See test_save_load\n    to get deterministic results."		)
     def lowerCAmelCase__  (   self		):


          '''simple docstring'''





          pass


     @unittest.skip(
         reason="ViTMAE returns a random mask + ids_restore in each forward pass. See test_save_load\n    to get deterministic results."		)
     def lowerCAmelCase__  (   self		):


          '''simple docstring'''





          pass


     @unittest.skip(reason="ViTMAE returns a random mask + ids_restore in each forward pass. See test_save_load"		)
     def lowerCAmelCase__  (   self		):


          '''simple docstring'''





          pass


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


          '''simple docstring'''





          pass


     @slow
     def lowerCAmelCase__  (   self		):


          '''simple docstring'''





          for model_name in VIT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
               __A	:       List[Any]      =							ViTMAEModel.from_pretrained(lowerCamelCase		)
               self.assertIsNotNone(lowerCamelCase		)


def 		_lowercase ():




     '''simple docstring'''





     __A	:       Union[str, Any]      =							Image.open("./tests/fixtures/tests_samples/COCO/000000039769.png"							)
     return image







@require_torch
@require_vision
class 							__magic_name__	(       unittest.TestCase ):

     """simple docstring"""






     @cached_property
     def lowerCAmelCase__  (   self		):


          '''simple docstring'''





          return ViTImageProcessor.from_pretrained("facebook/vit-mae-base"		) if is_vision_available() else None


     @slow
     def lowerCAmelCase__  (   self		):


          '''simple docstring'''





          np.random.seed(2		)

          __A	:       Dict      =							ViTMAEForPreTraining.from_pretrained("facebook/vit-mae-base"		).to(lowerCamelCase		)

          __A	:       str      =							self.default_image_processor
          __A	:       List[Any]      =							prepare_img()
          __A	:       Union[str, Any]      =							image_processor(images=lowerCamelCase			,     return_tensors="pt"		).to(lowerCamelCase		)

          # prepare a noise vector that will be also used for testing the TF model
          # (this way we can ensure that the PT and TF models operate on the same inputs)
          __A	:       Optional[Any]      =							ViTMAEConfig()
          __A	:       List[str]      =							int((vit_mae_config.image_size // vit_mae_config.patch_size) ** 2		)
          __A	:       Any      =							np.random.uniform(size=(1, num_patches)		)

          # forward pass
          with torch.no_grad():
               __A	:       str      =							model(**lowerCamelCase			,     noise=torch.from_numpy(lowerCamelCase		).to(device=lowerCamelCase		)		)

          # verify the logits
          __A	:       Union[str, Any]      =							torch.Size((1, 196, 768)		)
          self.assertEqual(outputs.logits.shape			,     lowerCamelCase		)

          __A	:       int      =							torch.tensor(
              [[-0.0548, -1.7023, -0.9325], [0.3721, -0.5670, -0.2233], [0.8235, -1.3878, -0.3524]]		)

          self.assertTrue(torch.allclose(outputs.logits[0, :3, :3]			,     expected_slice.to(lowerCamelCase		)			,     atol=1E-4		)		)

