



'''simple docstring'''





from typing import List, Optional, Union

import torch

from ...models import UNetaDConditionModel, VQModel
from ...pipelines import DiffusionPipeline
from ...pipelines.pipeline_utils import ImagePipelineOutput
from ...schedulers import DDPMScheduler
from ...utils import (
    is_accelerate_available,
    is_accelerate_version,
    logging,
    randn_tensor,
    replace_example_docstring,
)


__a  			=						logging.get_logger(__name__)  # pylint: disable=invalid-name

__a  			=						"\n    Examples:\n        ```py\n        >>> import torch\n        >>> import numpy as np\n\n        >>> from diffusers import KandinskyV22PriorPipeline, KandinskyV22ControlnetPipeline\n        >>> from transformers import pipeline\n        >>> from diffusers.utils import load_image\n\n\n        >>> def make_hint(image, depth_estimator):\n        ...     image = depth_estimator(image)[\"depth\"]\n        ...     image = np.array(image)\n        ...     image = image[:, :, None]\n        ...     image = np.concatenate([image, image, image], axis=2)\n        ...     detected_map = torch.from_numpy(image).float() / 255.0\n        ...     hint = detected_map.permute(2, 0, 1)\n        ...     return hint\n\n\n        >>> depth_estimator = pipeline(\"depth-estimation\")\n\n        >>> pipe_prior = KandinskyV22PriorPipeline.from_pretrained(\n        ...     \"kandinsky-community/kandinsky-2-2-prior\", torch_dtype=torch.float16\n        ... )\n        >>> pipe_prior = pipe_prior.to(\"cuda\")\n\n        >>> pipe = KandinskyV22ControlnetPipeline.from_pretrained(\n        ...     \"kandinsky-community/kandinsky-2-2-controlnet-depth\", torch_dtype=torch.float16\n        ... )\n        >>> pipe = pipe.to(\"cuda\")\n\n\n        >>> img = load_image(\n        ...     \"https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main\"\n        ...     \"/kandinsky/cat.png\"\n        ... ).resize((768, 768))\n\n        >>> hint = make_hint(img, depth_estimator).unsqueeze(0).half().to(\"cuda\")\n\n        >>> prompt = \"A robot, 4k photo\"\n        >>> negative_prior_prompt = \"lowres, text, error, cropped, worst quality, low quality, jpeg artifacts, ugly, duplicate, morbid, mutilated, out of frame, extra fingers, mutated hands, poorly drawn hands, poorly drawn face, mutation, deformed, blurry, dehydrated, bad anatomy, bad proportions, extra limbs, cloned face, disfigured, gross proportions, malformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long neck, username, watermark, signature\"\n\n        >>> generator = torch.Generator(device=\"cuda\").manual_seed(43)\n\n        >>> image_emb, zero_image_emb = pipe_prior(\n        ...     prompt=prompt, negative_prompt=negative_prior_prompt, generator=generator\n        ... ).to_tuple()\n\n        >>> images = pipe(\n        ...     image_embeds=image_emb,\n        ...     negative_image_embeds=zero_image_emb,\n        ...     hint=hint,\n        ...     num_inference_steps=50,\n        ...     generator=generator,\n        ...     height=768,\n        ...     width=768,\n        ... ).images\n\n        >>> images[0].save(\"robot_cat.png\")\n        ```\n"





def 		__snake_case(							_lowerCAmelCase	,  _lowerCAmelCase	,  _lowerCAmelCase=8						)						->					Any:
      snake_case__    :       Optional[int]       		= height // scale_factor**2
      if height % scale_factor**2 != 0:
            new_height += 1
      snake_case__    :       Optional[Any]       		= width // scale_factor**2
      if width % scale_factor**2 != 0:
            new_width += 1
      return new_height * scale_factor, new_width * scale_factor







class        UpperCAmelCase_			(			_a      ):
    """simple docstring"""







    def __init__(       self   :	Union[str, Any]					,	snake_case_   :	UNetaDConditionModel					,	snake_case_   :	DDPMScheduler					,	snake_case_   :	VQModel					,	):
          super().__init__()

          self.register_modules(
              unet=snake_case_					,	scheduler=snake_case_					,	movq=snake_case_					,	)
          snake_case__    :       Dict       		= 2 ** (len(self.movq.config.block_out_channels		) - 1)




    def lowerCamelCase			(       self   :	int					,	snake_case_   :	Optional[int]					,	snake_case_   :	Optional[Any]					,	snake_case_   :	int					,	snake_case_   :	Any					,	snake_case_   :	Optional[int]					,	snake_case_   :	Tuple		):
          if latents is None:
                snake_case__    :       Optional[Any]       		= randn_tensor(snake_case_					,	generator=snake_case_					,	device=snake_case_					,	dtype=snake_case_		)
          else:
                if latents.shape != shape:
                      raise ValueError(f"Unexpected latents shape, got {latents.shape}, expected {shape}"		)
                snake_case__    :       Any       		= latents.to(snake_case_		)

          snake_case__    :       Dict       		= latents * scheduler.init_noise_sigma
          return latents




    def lowerCamelCase			(       self   :	Union[str, Any]					,	snake_case_   :	Dict=0		):
          if is_accelerate_available():
                from accelerate import cpu_offload
          else:
                raise ImportError("""Please install accelerate via `pip install accelerate`"""		)

          snake_case__    :       Union[str, Any]       		= torch.device(f"cuda:{gpu_id}"		)

          snake_case__    :       List[Any]       		= [
              self.unet,
              self.movq,
          ]
          for cpu_offloaded_model in models:
                if cpu_offloaded_model is not None:
                      cpu_offload(snake_case_					,	snake_case_		)




    def lowerCamelCase			(       self   :	List[str]					,	snake_case_   :	Dict=0		):
          if is_accelerate_available() and is_accelerate_version(""">="""					,	"""0.17.0.dev0"""		):
                from accelerate import cpu_offload_with_hook
          else:
                raise ImportError("""`enable_model_cpu_offload` requires `accelerate v0.17.0` or higher."""		)

          snake_case__    :       Optional[int]       		= torch.device(f"cuda:{gpu_id}"		)

          if self.device.type != "cpu":
                self.to("""cpu"""					,	silence_dtype_warnings=snake_case_		)
                torch.cuda.empty_cache()  # otherwise we don't see the memory savings (but they probably exist)

          snake_case__    :       Union[str, Any]       		= None
          for cpu_offloaded_model in [self.unet, self.movq]:
                snake_case__		,							snake_case__    :       Optional[int]       		= cpu_offload_with_hook(snake_case_					,	snake_case_					,	prev_module_hook=snake_case_		)

          # We'll offload the last model manually.
          snake_case__    :       Dict       		= hook




    @property
    # Copied from diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion.StableDiffusionPipeline._execution_device
    def lowerCamelCase			(       self   :	Any		):
          if not hasattr(self.unet					,	"""_hf_hook"""		):
                return self.device
          for module in self.unet.modules():
                if (
                    hasattr(snake_case_					,	"""_hf_hook"""		)
                    and hasattr(module._hf_hook					,	"""execution_device"""		)
                    and module._hf_hook.execution_device is not None
                ):
                      return torch.device(module._hf_hook.execution_device		)
          return self.device




    @torch.no_grad()
    @replace_example_docstring(snake_case_		)
    def __call__(       self   :	Optional[int]					,	snake_case_   :	Union[torch.FloatTensor, List[torch.FloatTensor]]					,	snake_case_   :	Union[torch.FloatTensor, List[torch.FloatTensor]]					,	snake_case_   :	torch.FloatTensor					,	snake_case_   :	int = 512					,	snake_case_   :	int = 512					,	snake_case_   :	int = 100					,	snake_case_   :	float = 4.0					,	snake_case_   :	int = 1					,	snake_case_   :	Optional[Union[torch.Generator, List[torch.Generator]]] = None					,	snake_case_   :	Optional[torch.FloatTensor] = None					,	snake_case_   :	Optional[str] = "pil"					,	snake_case_   :	bool = True					,	):
          snake_case__    :       Optional[Any]       		= self._execution_device

          snake_case__    :       int       		= guidance_scale > 1.0

          if isinstance(snake_case_					,	snake_case_		):
                snake_case__    :       List[Any]       		= torch.cat(snake_case_					,	dim=0		)
          if isinstance(snake_case_					,	snake_case_		):
                snake_case__    :       Tuple       		= torch.cat(snake_case_					,	dim=0		)
          if isinstance(snake_case_					,	snake_case_		):
                snake_case__    :       List[Any]       		= torch.cat(snake_case_					,	dim=0		)

          snake_case__    :       Dict       		= image_embeds.shape[0] * num_images_per_prompt

          if do_classifier_free_guidance:
                snake_case__    :       int       		= image_embeds.repeat_interleave(snake_case_					,	dim=0		)
                snake_case__    :       List[Any]       		= negative_image_embeds.repeat_interleave(snake_case_					,	dim=0		)
                snake_case__    :       Any       		= hint.repeat_interleave(snake_case_					,	dim=0		)

          snake_case__    :       Union[str, Any]       		= torch.cat([negative_image_embeds, image_embeds]					,	dim=0		).to(dtype=self.unet.dtype					,	device=snake_case_		)
          snake_case__    :       int       		= torch.cat([hint, hint]					,	dim=0		).to(dtype=self.unet.dtype					,	device=snake_case_		)
          self.scheduler.set_timesteps(snake_case_					,	device=snake_case_		)
          snake_case__    :       str       		= self.scheduler.timesteps

          snake_case__    :       Optional[int]       		= self.movq.config.latent_channels

          snake_case__		,							snake_case__    :       int       		= downscale_height_and_width(snake_case_					,	snake_case_					,	self.movq_scale_factor		)

          # create initial latent
          snake_case__    :       Tuple       		= self.prepare_latents(
              (batch_size, num_channels_latents, height, width)					,	image_embeds.dtype					,	snake_case_					,	snake_case_					,	snake_case_					,	self.scheduler					,	)

          for i, t in enumerate(self.progress_bar(snake_case_		)		):
                # expand the latents if we are doing classifier free guidance
                snake_case__    :       int       		= torch.cat([latents] * 2		) if do_classifier_free_guidance else latents

                snake_case__    :       Dict       		= {"""image_embeds""": image_embeds, """hint""": hint}
                snake_case__    :       List[Any]       		= self.unet(
                    sample=snake_case_					,	timestep=snake_case_					,	encoder_hidden_states=snake_case_					,	added_cond_kwargs=snake_case_					,	return_dict=snake_case_					,	)[0]

                if do_classifier_free_guidance:
                      snake_case__		,							snake_case__    :       str       		= noise_pred.split(latents.shape[1]					,	dim=1		)
                      snake_case__		,							snake_case__    :       Optional[Any]       		= noise_pred.chunk(2		)
                      snake_case__		,							snake_case__    :       Any       		= variance_pred.chunk(2		)
                      snake_case__    :       int       		= noise_pred_uncond + guidance_scale * (noise_pred_text - noise_pred_uncond)
                      snake_case__    :       Optional[Any]       		= torch.cat([noise_pred, variance_pred_text]					,	dim=1		)

                if not (
                    hasattr(self.scheduler.config					,	"""variance_type"""		)
                    and self.scheduler.config.variance_type in ["learned", "learned_range"]
                ):
                      snake_case__		,							snake_case__    :       Any       		= noise_pred.split(latents.shape[1]					,	dim=1		)

                # compute the previous noisy sample x_t -> x_t-1
                snake_case__    :       Dict       		= self.scheduler.step(
                    snake_case_					,	snake_case_					,	snake_case_					,	generator=snake_case_					,	)[0]
          # post-processing
          snake_case__    :       int       		= self.movq.decode(snake_case_					,	force_not_quantize=snake_case_		)["""sample"""]

          if output_type not in ["pt", "np", "pil"]:
                raise ValueError(f"Only the output types `pt`, `pil` and `np` are supported not output_type={output_type}"		)

          if output_type in ["np", "pil"]:
                snake_case__    :       Tuple       		= image * 0.5 + 0.5
                snake_case__    :       List[Any]       		= image.clamp(0					,	1		)
                snake_case__    :       Tuple       		= image.cpu().permute(0					,	2					,	3					,	1		).float().numpy()

          if output_type == "pil":
                snake_case__    :       int       		= self.numpy_to_pil(snake_case_		)

          if not return_dict:
                return (image,)

          return ImagePipelineOutput(images=snake_case_		)





'''simple docstring'''





import copy
import inspect
import unittest

from transformers import PretrainedConfig, SwiftFormerConfig
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 SwiftFormerForImageClassification, SwiftFormerModel
       from transformers.models.swiftformer.modeling_swiftformer import SWIFTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
       from PIL import Image

       from transformers import ViTImageProcessor







class        UpperCAmelCase_			:
    """simple docstring"""







    def __init__(       self   :	Any					,	snake_case_   :	List[Any]					,	snake_case_   :	Union[str, Any]=13					,	snake_case_   :	Optional[int]=3					,	snake_case_   :	List[Any]=True					,	snake_case_   :	Dict=True					,	snake_case_   :	Optional[Any]=0.1					,	snake_case_   :	Tuple=0.1					,	snake_case_   :	Dict=224					,	snake_case_   :	Dict=1_000					,	snake_case_   :	Tuple=[3, 3, 6, 4]					,	snake_case_   :	Tuple=[48, 56, 112, 220]					,	):
          snake_case__    :       str       		= parent
          snake_case__    :       Dict       		= batch_size
          snake_case__    :       Dict       		= num_channels
          snake_case__    :       Any       		= is_training
          snake_case__    :       Union[str, Any]       		= use_labels
          snake_case__    :       Tuple       		= hidden_dropout_prob
          snake_case__    :       Optional[int]       		= attention_probs_dropout_prob
          snake_case__    :       List[str]       		= num_labels
          snake_case__    :       Any       		= image_size
          snake_case__    :       str       		= layer_depths
          snake_case__    :       Union[str, Any]       		= embed_dims




    def lowerCamelCase			(       self   :	Tuple		):
          snake_case__    :       List[Any]       		= floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]		)

          snake_case__    :       int       		= None
          if self.use_labels:
                snake_case__    :       List[Any]       		= ids_tensor([self.batch_size]					,	self.num_labels		)

          snake_case__    :       List[str]       		= self.get_config()

          return config, pixel_values, labels




    def lowerCamelCase			(       self   :	str		):
          return SwiftFormerConfig(
              depths=self.layer_depths					,	embed_dims=self.embed_dims					,	mlp_ratio=4					,	downsamples=[True, True, True, True]					,	hidden_act="""gelu"""					,	num_labels=self.num_labels					,	down_patch_size=3					,	down_stride=2					,	down_pad=1					,	drop_rate=0.0					,	drop_path_rate=0.0					,	use_layer_scale=snake_case_					,	layer_scale_init_value=1E-5					,	)




    def lowerCamelCase			(       self   :	Optional[int]					,	snake_case_   :	Any					,	snake_case_   :	Union[str, Any]					,	snake_case_   :	List[str]		):
          snake_case__    :       Dict       		= SwiftFormerModel(config=snake_case_		)
          model.to(snake_case_		)
          model.eval()
          snake_case__    :       List[str]       		= model(snake_case_		)
          self.parent.assertEqual(result.last_hidden_state.shape					,	(self.batch_size, self.embed_dims[-1], 7, 7)		)




    def lowerCamelCase			(       self   :	List[Any]					,	snake_case_   :	Tuple					,	snake_case_   :	Optional[int]					,	snake_case_   :	Optional[int]		):
          snake_case__    :       Optional[int]       		= self.num_labels
          snake_case__    :       Union[str, Any]       		= SwiftFormerForImageClassification(snake_case_		)
          model.to(snake_case_		)
          model.eval()
          snake_case__    :       Optional[Any]       		= model(snake_case_					,	labels=snake_case_		)
          self.parent.assertEqual(result.logits.shape					,	(self.batch_size, self.num_labels)		)

          snake_case__    :       Union[str, Any]       		= SwiftFormerForImageClassification(snake_case_		)
          model.to(snake_case_		)
          model.eval()

          snake_case__    :       List[Any]       		= floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]		)
          snake_case__    :       Any       		= model(snake_case_		)
          self.parent.assertEqual(result.logits.shape					,	(self.batch_size, self.num_labels)		)




    def lowerCamelCase			(       self   :	List[Any]		):
          ((snake_case__)		,							(snake_case__)		,							(snake_case__))    :       Union[str, Any]       		= self.prepare_config_and_inputs()
          snake_case__    :       int       		= {"""pixel_values""": pixel_values}
          return config, inputs_dict







@require_torch
class        UpperCAmelCase_			(			_a						,						_a						,						unittest.TestCase      ):
    """simple docstring"""







    lowercase   =						(SwiftFormerModel, SwiftFormerForImageClassification) if is_torch_available() else ()
    lowercase   =						(
        {"feature-extraction": SwiftFormerModel, "image-classification": SwiftFormerForImageClassification}
        if is_torch_available()
        else {}
    )

    lowercase   =						False
    lowercase   =						False
    lowercase   =						False
    lowercase   =						False
    lowercase   =						False




    def lowerCamelCase			(       self   :	Tuple		):
          snake_case__    :       Optional[Any]       		= SwiftFormerModelTester(self		)
          snake_case__    :       Union[str, Any]       		= ConfigTester(
              self					,	config_class=snake_case_					,	has_text_modality=snake_case_					,	hidden_size=37					,	num_attention_heads=12					,	num_hidden_layers=12					,	)




    def lowerCamelCase			(       self   :	Optional[int]		):
          self.config_tester.run_common_tests()




    @unittest.skip(reason="""SwiftFormer does not use inputs_embeds"""		)
    def lowerCamelCase			(       self   :	Optional[Any]		):
          pass




    def lowerCamelCase			(       self   :	Union[str, Any]		):
          snake_case__		,							snake_case__    :       Any       		= self.model_tester.prepare_config_and_inputs_for_common()

          for model_class in self.all_model_classes:
                snake_case__    :       Optional[int]       		= model_class(snake_case_		)
                snake_case__    :       Any       		= model.get_output_embeddings()
                self.assertTrue(x is None or isinstance(snake_case_					,	nn.Linear		)		)




    def lowerCamelCase			(       self   :	List[str]		):
          snake_case__		,							snake_case__    :       Dict       		= self.model_tester.prepare_config_and_inputs_for_common()

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

                snake_case__    :       Optional[int]       		= ["""pixel_values"""]
                self.assertListEqual(arg_names[:1]					,	snake_case_		)




    def lowerCamelCase			(       self   :	List[Any]		):
          snake_case__    :       List[str]       		= self.model_tester.prepare_config_and_inputs()
          self.model_tester.create_and_check_model(*snake_case_		)




    def lowerCamelCase			(       self   :	Tuple		):
          snake_case__    :       Any       		= self.model_tester.prepare_config_and_inputs()
          self.model_tester.create_and_check_for_image_classification(*snake_case_		)




    @slow
    def lowerCamelCase			(       self   :	List[str]		):
          for model_name in SWIFTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
                snake_case__    :       Union[str, Any]       		= SwiftFormerModel.from_pretrained(snake_case_		)
                self.assertIsNotNone(snake_case_		)




    @unittest.skip(reason="""SwiftFormer does not output attentions"""		)
    def lowerCamelCase			(       self   :	Union[str, Any]		):
          pass




    def lowerCamelCase			(       self   :	List[Any]		):
          def check_hidden_states_output(snake_case_   :	str					,	snake_case_   :	Tuple					,	snake_case_   :	List[Any]		):
                snake_case__    :       Optional[Any]       		= model_class(snake_case_		)
                model.to(snake_case_		)
                model.eval()

                with torch.no_grad():
                      snake_case__    :       Tuple       		= model(**self._prepare_for_class(snake_case_					,	snake_case_		)		)

                snake_case__    :       Optional[Any]       		= outputs.hidden_states

                snake_case__    :       List[Any]       		= 8
                self.assertEqual(len(snake_case_		)					,	snake_case_		)  # TODO

                # SwiftFormer's feature maps are of shape (batch_size, embed_dims, height, width)
                # with the width and height being successively divided by 2, after every 2 blocks
                for i in range(len(snake_case_		)		):
                      self.assertEqual(
                          hidden_states[i].shape					,	torch.Size(
                              [
                                  self.model_tester.batch_size,
                                  self.model_tester.embed_dims[i // 2],
                                  (self.model_tester.image_size // 4) // 2 ** (i // 2),
                                  (self.model_tester.image_size // 4) // 2 ** (i // 2),
                              ]		)					,	)

          snake_case__		,							snake_case__    :       int       		= self.model_tester.prepare_config_and_inputs_for_common()

          for model_class in self.all_model_classes:
                snake_case__    :       Any       		= True
                check_hidden_states_output(snake_case_					,	snake_case_					,	snake_case_		)

                # check that output_hidden_states also work using config
                del inputs_dict["output_hidden_states"]
                snake_case__    :       str       		= True

                check_hidden_states_output(snake_case_					,	snake_case_					,	snake_case_		)




    def lowerCamelCase			(       self   :	Optional[Any]		):
          def _config_zero_init(snake_case_   :	Optional[Any]		):
                snake_case__    :       Union[str, Any]       		= copy.deepcopy(snake_case_		)
                for key in configs_no_init.__dict__.keys():
                      if "_range" in key or "_std" in key or "initializer_factor" in key or "layer_scale" in key:
                            setattr(snake_case_					,	snake_case_					,	1E-1_0		)
                      if isinstance(getattr(snake_case_					,	snake_case_					,	snake_case_		)					,	snake_case_		):
                            snake_case__    :       List[str]       		= _config_zero_init(getattr(snake_case_					,	snake_case_		)		)
                            setattr(snake_case_					,	snake_case_					,	snake_case_		)
                return configs_no_init

          snake_case__		,							snake_case__    :       Tuple       		= self.model_tester.prepare_config_and_inputs_for_common()

          snake_case__    :       List[str]       		= _config_zero_init(snake_case_		)
          for model_class in self.all_model_classes:
                snake_case__    :       Optional[int]       		= model_class(config=snake_case_		)
                for name, param in model.named_parameters():
                      if param.requires_grad:
                            self.assertIn(
                                ((param.data.mean() * 1E9) / 1E9).round().item()					,	[0.0, 1.0]					,	msg=f"Parameter {name} of model {model_class} seems not properly initialized"					,	)




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





def 		__snake_case(							)						->					Optional[int]:
      snake_case__    :       Optional[int]       		= Image.open("""./tests/fixtures/tests_samples/COCO/000000039769.png"""						)
      return image







@require_torch
@require_vision
class        UpperCAmelCase_			(			unittest.TestCase      ):
    """simple docstring"""







    @cached_property
    def lowerCamelCase			(       self   :	List[str]		):
          return ViTImageProcessor.from_pretrained("""MBZUAI/swiftformer-xs"""		) if is_vision_available() else None




    @slow
    def lowerCamelCase			(       self   :	List[Any]		):
          snake_case__    :       str       		= SwiftFormerForImageClassification.from_pretrained("""MBZUAI/swiftformer-xs"""		).to(snake_case_		)

          snake_case__    :       Dict       		= self.default_image_processor
          snake_case__    :       Optional[Any]       		= prepare_img()
          snake_case__    :       Union[str, Any]       		= image_processor(images=snake_case_					,	return_tensors="""pt"""		).to(snake_case_		)

          # forward pass
          with torch.no_grad():
                snake_case__    :       Dict       		= model(**snake_case_		)

          # verify the logits
          snake_case__    :       int       		= torch.Size((1, 1_000)		)
          self.assertEqual(outputs.logits.shape					,	snake_case_		)

          snake_case__    :       int       		= torch.tensor([[-2.1_7_0_3E0_0, 2.1_1_0_7E0_0, -2.0_8_1_1E0_0]]		).to(snake_case_		)
          self.assertTrue(torch.allclose(outputs.logits[0, :3]					,	snake_case_					,	atol=1E-4		)		)
