






"""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,
)


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

lowerCamelCase__           =	"""
    Examples:
        ```py
        >>> from diffusers import KandinskyV22Pipeline, KandinskyV22PriorPipeline
        >>> import torch

        >>> pipe_prior = KandinskyV22PriorPipeline.from_pretrained(\"kandinsky-community/kandinsky-2-2-prior\")
        >>> pipe_prior.to(\"cuda\")
        >>> prompt = \"red cat, 4k photo\"
        >>> out = pipe_prior(prompt)
        >>> image_emb = out.image_embeds
        >>> zero_image_emb = out.negative_image_embeds
        >>> pipe = KandinskyV22Pipeline.from_pretrained(\"kandinsky-community/kandinsky-2-2-decoder\")
        >>> pipe.to(\"cuda\")
        >>> image = pipe(
        ...     image_embeds=image_emb,
        ...     negative_image_embeds=zero_image_emb,
        ...     height=768,
        ...     width=768,
        ...     num_inference_steps=50,
        ... ).images
        >>> image[0].save(\"cat.png\")
        ```
"""
def 					__lowerCAmelCase       (_UpperCamelCase ,						_UpperCamelCase ,						_UpperCamelCase=8	):
	__lowerCAmelCase    :		List[Any]		    =   height // scale_factor**2
	if height % scale_factor**2 != 0:
		new_height += 1
	__lowerCAmelCase    :		str		    =   width // scale_factor**2
	if width % scale_factor**2 != 0:
		new_width += 1
	return new_height * scale_factor, new_width * scale_factor




class 				A__ (			__A):

		def __init__(   self ,	_SCREAMING_SNAKE_CASE ,	_SCREAMING_SNAKE_CASE ,	_SCREAMING_SNAKE_CASE ,	):
			super().__init__()

			self.register_modules(
			    unet=_SCREAMING_SNAKE_CASE ,	scheduler=_SCREAMING_SNAKE_CASE ,	movq=_SCREAMING_SNAKE_CASE ,	)
			__lowerCAmelCase    :		Union[str, Any]		    =   2 ** (len(self.movq.config.block_out_channels				) - 1)

		def 							__lowerCamelCase							(   self ,	_SCREAMING_SNAKE_CASE ,	_SCREAMING_SNAKE_CASE ,	_SCREAMING_SNAKE_CASE ,	_SCREAMING_SNAKE_CASE ,	_SCREAMING_SNAKE_CASE ,	_SCREAMING_SNAKE_CASE				):





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

			__lowerCAmelCase    :		str		    =   latents * scheduler.init_noise_sigma
			return latents

		def 							__lowerCamelCase							(   self ,	_SCREAMING_SNAKE_CASE=0				):





			if is_accelerate_available():
				from accelerate import cpu_offload
			else:
				raise ImportError('Please install accelerate via `pip install accelerate`'				)

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

			__lowerCAmelCase    :		Union[str, Any]		    =   [
			    self.unet,
			    self.movq,
			]
			for cpu_offloaded_model in models:
				if cpu_offloaded_model is not None:
					cpu_offload(_SCREAMING_SNAKE_CASE ,	_SCREAMING_SNAKE_CASE				)

		def 							__lowerCamelCase							(   self ,	_SCREAMING_SNAKE_CASE=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.'				)

			__lowerCAmelCase    :		List[str]		    =   torch.device(f"cuda:{gpu_id}"				)

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

			__lowerCAmelCase    :		List[str]		    =   None
			for cpu_offloaded_model in [self.unet, self.movq]:
				__lowerCAmelCase    :		List[str]		    =   cpu_offload_with_hook(_SCREAMING_SNAKE_CASE ,	_SCREAMING_SNAKE_CASE ,	prev_module_hook=_SCREAMING_SNAKE_CASE				)

			# We'll offload the last model manually.
			__lowerCAmelCase    :		List[str]		    =   hook

		@property
		# Copied from diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion.StableDiffusionPipeline._execution_device
		def 							__lowerCamelCase							(   self				):





			if not hasattr(self.unet ,	'_hf_hook'				):
				return self.device
			for module in self.unet.modules():
				if (
				    hasattr(_SCREAMING_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(_SCREAMING_SNAKE_CASE				)
		def __call__(   self ,	_SCREAMING_SNAKE_CASE ,	_SCREAMING_SNAKE_CASE ,	_SCREAMING_SNAKE_CASE = 5_12 ,	_SCREAMING_SNAKE_CASE = 5_12 ,	_SCREAMING_SNAKE_CASE = 1_00 ,	_SCREAMING_SNAKE_CASE = 4.0 ,	_SCREAMING_SNAKE_CASE = 1 ,	_SCREAMING_SNAKE_CASE = None ,	_SCREAMING_SNAKE_CASE = None ,	_SCREAMING_SNAKE_CASE = "pil" ,	_SCREAMING_SNAKE_CASE = True ,	):
			__lowerCAmelCase    :		List[Any]		    =   self._execution_device

			__lowerCAmelCase    :		Union[str, Any]		    =   guidance_scale > 1.0

			if isinstance(_SCREAMING_SNAKE_CASE ,	_SCREAMING_SNAKE_CASE				):
				__lowerCAmelCase    :		Any		    =   torch.cat(_SCREAMING_SNAKE_CASE ,	dim=0				)
			__lowerCAmelCase    :		Union[str, Any]		    =   image_embeds.shape[0] * num_images_per_prompt
			if isinstance(_SCREAMING_SNAKE_CASE ,	_SCREAMING_SNAKE_CASE				):
				__lowerCAmelCase    :		List[Any]		    =   torch.cat(_SCREAMING_SNAKE_CASE ,	dim=0				)

			if do_classifier_free_guidance:
				__lowerCAmelCase    :		List[str]		    =   image_embeds.repeat_interleave(_SCREAMING_SNAKE_CASE ,	dim=0				)
				__lowerCAmelCase    :		Dict		    =   negative_image_embeds.repeat_interleave(_SCREAMING_SNAKE_CASE ,	dim=0				)

			__lowerCAmelCase    :		Union[str, Any]		    =   torch.cat([negative_image_embeds, image_embeds] ,	dim=0				).to(dtype=self.unet.dtype ,	device=_SCREAMING_SNAKE_CASE				)

			self.scheduler.set_timesteps(_SCREAMING_SNAKE_CASE ,	device=_SCREAMING_SNAKE_CASE				)
			__lowerCAmelCase    :		Union[str, Any]		    =   self.scheduler.timesteps

			__lowerCAmelCase    :		Dict		    =   self.unet.config.in_channels

			__lowerCAmelCase    :		int		    =   downscale_height_and_width(_SCREAMING_SNAKE_CASE ,	_SCREAMING_SNAKE_CASE ,	self.movq_scale_factor				)

			# create initial latent
			__lowerCAmelCase    :		Optional[Any]		    =   self.prepare_latents(
			    (batch_size, num_channels_latents, height, width) ,	image_embeds.dtype ,	_SCREAMING_SNAKE_CASE ,	_SCREAMING_SNAKE_CASE ,	_SCREAMING_SNAKE_CASE ,	self.scheduler ,	)

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

				__lowerCAmelCase    :		Union[str, Any]		    =   {'image_embeds': image_embeds}
				__lowerCAmelCase    :		Union[str, Any]		    =   self.unet(
				    sample=_SCREAMING_SNAKE_CASE ,	timestep=_SCREAMING_SNAKE_CASE ,	encoder_hidden_states=_SCREAMING_SNAKE_CASE ,	added_cond_kwargs=_SCREAMING_SNAKE_CASE ,	return_dict=_SCREAMING_SNAKE_CASE ,	)[0]

				if do_classifier_free_guidance:
					__lowerCAmelCase    :		List[Any]		    =   noise_pred.split(latents.shape[1] ,	dim=1				)
					__lowerCAmelCase    :		Dict		    =   noise_pred.chunk(2				)
					__lowerCAmelCase    :		Tuple		    =   variance_pred.chunk(2				)
					__lowerCAmelCase    :		int		    =   noise_pred_uncond + guidance_scale * (noise_pred_text - noise_pred_uncond)
					__lowerCAmelCase    :		List[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"]
				):
					__lowerCAmelCase    :		Union[str, Any]		    =   noise_pred.split(latents.shape[1] ,	dim=1				)

				# compute the previous noisy sample x_t -> x_t-1
				__lowerCAmelCase    :		Optional[int]		    =   self.scheduler.step(
				    _SCREAMING_SNAKE_CASE ,	_SCREAMING_SNAKE_CASE ,	_SCREAMING_SNAKE_CASE ,	generator=_SCREAMING_SNAKE_CASE ,	)[0]
			# post-processing
			__lowerCAmelCase    :		Optional[int]		    =   self.movq.decode(_SCREAMING_SNAKE_CASE ,	force_not_quantize=_SCREAMING_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"]:
				__lowerCAmelCase    :		Optional[int]		    =   image * 0.5 + 0.5
				__lowerCAmelCase    :		Optional[int]		    =   image.clamp(0 ,	1				)
				__lowerCAmelCase    :		Union[str, Any]		    =   image.cpu().permute(0 ,	2 ,	3 ,	1				).float().numpy()

			if output_type == "pil":
				__lowerCAmelCase    :		Dict		    =   self.numpy_to_pil(_SCREAMING_SNAKE_CASE				)

			if not return_dict:
				return (image,)

			return ImagePipelineOutput(images=_SCREAMING_SNAKE_CASE				)

"""simple docstring"""







import inspect
import unittest

from transformers import RegNetConfig
from transformers.file_utils import cached_property, is_torch_available, is_vision_available
from transformers.testing_utils import require_torch, require_vision, slow, torch_device

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 RegNetForImageClassification, RegNetModel
							from transformers.models.regnet.modeling_regnet import REGNET_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
							from PIL import Image

							from transformers import AutoImageProcessor




class 				A__ :

		def __init__(   self ,	_SCREAMING_SNAKE_CASE ,	_SCREAMING_SNAKE_CASE=3 ,	_SCREAMING_SNAKE_CASE=32 ,	_SCREAMING_SNAKE_CASE=3 ,	_SCREAMING_SNAKE_CASE=10 ,	_SCREAMING_SNAKE_CASE=[10, 20, 30, 40] ,	_SCREAMING_SNAKE_CASE=[1, 1, 2, 1] ,	_SCREAMING_SNAKE_CASE=True ,	_SCREAMING_SNAKE_CASE=True ,	_SCREAMING_SNAKE_CASE="relu" ,	_SCREAMING_SNAKE_CASE=3 ,	_SCREAMING_SNAKE_CASE=None ,	):
			__lowerCAmelCase    :		Optional[Any]		    =   parent
			__lowerCAmelCase    :		int		    =   batch_size
			__lowerCAmelCase    :		Union[str, Any]		    =   image_size
			__lowerCAmelCase    :		Optional[Any]		    =   num_channels
			__lowerCAmelCase    :		List[Any]		    =   embeddings_size
			__lowerCAmelCase    :		Dict		    =   hidden_sizes
			__lowerCAmelCase    :		Optional[int]		    =   depths
			__lowerCAmelCase    :		Optional[Any]		    =   is_training
			__lowerCAmelCase    :		int		    =   use_labels
			__lowerCAmelCase    :		List[Any]		    =   hidden_act
			__lowerCAmelCase    :		Optional[Any]		    =   num_labels
			__lowerCAmelCase    :		List[str]		    =   scope
			__lowerCAmelCase    :		Optional[Any]		    =   len(_SCREAMING_SNAKE_CASE				)

		def 							__lowerCamelCase							(   self				):
			__lowerCAmelCase    :		Optional[Any]		    =   floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]				)

			__lowerCAmelCase    :		List[str]		    =   None
			if self.use_labels:
				__lowerCAmelCase    :		Tuple		    =   ids_tensor([self.batch_size] ,	self.num_labels				)

			__lowerCAmelCase    :		int		    =   self.get_config()

			return config, pixel_values, labels

		def 							__lowerCamelCase							(   self				):
			return RegNetConfig(
			    num_channels=self.num_channels ,	embeddings_size=self.embeddings_size ,	hidden_sizes=self.hidden_sizes ,	depths=self.depths ,	hidden_act=self.hidden_act ,	num_labels=self.num_labels ,	)

		def 							__lowerCamelCase							(   self ,	_SCREAMING_SNAKE_CASE ,	_SCREAMING_SNAKE_CASE ,	_SCREAMING_SNAKE_CASE				):
			__lowerCAmelCase    :		Any		    =   RegNetModel(config=_SCREAMING_SNAKE_CASE				)
			model.to(_SCREAMING_SNAKE_CASE				)
			model.eval()
			__lowerCAmelCase    :		Any		    =   model(_SCREAMING_SNAKE_CASE				)
			# expected last hidden states: B, C, H // 32, W // 32
			self.parent.assertEqual(
			    result.last_hidden_state.shape ,	(self.batch_size, self.hidden_sizes[-1], self.image_size // 32, self.image_size // 32) ,	)

		def 							__lowerCamelCase							(   self ,	_SCREAMING_SNAKE_CASE ,	_SCREAMING_SNAKE_CASE ,	_SCREAMING_SNAKE_CASE				):
			__lowerCAmelCase    :		Optional[Any]		    =   self.num_labels
			__lowerCAmelCase    :		str		    =   RegNetForImageClassification(_SCREAMING_SNAKE_CASE				)
			model.to(_SCREAMING_SNAKE_CASE				)
			model.eval()
			__lowerCAmelCase    :		Any		    =   model(_SCREAMING_SNAKE_CASE ,	labels=_SCREAMING_SNAKE_CASE				)
			self.parent.assertEqual(result.logits.shape ,	(self.batch_size, self.num_labels)				)







		def 							__lowerCamelCase							(   self				):
			__lowerCAmelCase    :		Optional[Any]		    =   self.prepare_config_and_inputs()
			__lowerCAmelCase    ,     __lowerCAmelCase    ,     __lowerCAmelCase    :		Any		    =   config_and_inputs
			__lowerCAmelCase    :		List[str]		    =   {'pixel_values': pixel_values}
			return config, inputs_dict




@require_torch
class 				A__ (			_lowerCamelCase ,  _lowerCamelCase ,  unittest.TestCase):
		A_		: List[str]            =			(RegNetModel, RegNetForImageClassification) if is_torch_available() else ()
		A_		: List[Any]            =			(
		    {'feature-extraction': RegNetModel, 'image-classification': RegNetForImageClassification}
		    if is_torch_available()
		    else {}
		)

		A_		: Dict            =			False
		A_		: str            =			False
		A_		: int            =			False
		A_		: Union[str, Any]            =			False

		def 							__lowerCamelCase							(   self				):
			__lowerCAmelCase    :		List[str]		    =   RegNetModelTester(self				)
			__lowerCAmelCase    :		int		    =   ConfigTester(self ,	config_class=_SCREAMING_SNAKE_CASE ,	has_text_modality=_SCREAMING_SNAKE_CASE				)

		def 							__lowerCamelCase							(   self				):
			self.create_and_test_config_common_properties()
			self.config_tester.create_and_test_config_to_json_string()
			self.config_tester.create_and_test_config_to_json_file()
			self.config_tester.create_and_test_config_from_and_save_pretrained()
			self.config_tester.create_and_test_config_with_num_labels()
			self.config_tester.check_config_can_be_init_without_params()
			self.config_tester.check_config_arguments_init()

		def 							__lowerCamelCase							(   self				):
			return

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

		@unittest.skip(reason='RegNet does not support input and output embeddings'				)
		def 							__lowerCamelCase							(   self				):
			pass

		def 							__lowerCamelCase							(   self				):
			__lowerCAmelCase    ,     __lowerCAmelCase    :		List[Any]		    =   self.model_tester.prepare_config_and_inputs_for_common()

			for model_class in self.all_model_classes:
				__lowerCAmelCase    :		Optional[int]		    =   model_class(_SCREAMING_SNAKE_CASE				)
				__lowerCAmelCase    :		Dict		    =   inspect.signature(model.forward				)
				# signature.parameters is an OrderedDict => so arg_names order is deterministic
				__lowerCAmelCase    :		Tuple		    =   [*signature.parameters.keys()]

				__lowerCAmelCase    :		Optional[int]		    =   ['pixel_values']
				self.assertListEqual(arg_names[:1] ,	_SCREAMING_SNAKE_CASE				)

		def 							__lowerCamelCase							(   self				):
			__lowerCAmelCase    :		Optional[Any]		    =   self.model_tester.prepare_config_and_inputs()
			self.model_tester.create_and_check_model(*_SCREAMING_SNAKE_CASE				)

		def 							__lowerCamelCase							(   self				):
			__lowerCAmelCase    ,     __lowerCAmelCase    :		List[str]		    =   self.model_tester.prepare_config_and_inputs_for_common()

			for model_class in self.all_model_classes:
				__lowerCAmelCase    :		Union[str, Any]		    =   model_class(config=_SCREAMING_SNAKE_CASE				)
				for name, module in model.named_modules():
					if isinstance(_SCREAMING_SNAKE_CASE ,	(nn.BatchNormad, nn.GroupNorm)				):
						self.assertTrue(
						    torch.all(module.weight == 1				) ,	msg=f"Parameter {name} of model {model_class} seems not properly initialized" ,	)
						self.assertTrue(
						    torch.all(module.bias == 0				) ,	msg=f"Parameter {name} of model {model_class} seems not properly initialized" ,	)

		def 							__lowerCamelCase							(   self				):
			def check_hidden_states_output(_SCREAMING_SNAKE_CASE ,	_SCREAMING_SNAKE_CASE ,	_SCREAMING_SNAKE_CASE				):
				__lowerCAmelCase    :		Any		    =   model_class(_SCREAMING_SNAKE_CASE				)
				model.to(_SCREAMING_SNAKE_CASE				)
				model.eval()

				with torch.no_grad():
					__lowerCAmelCase    :		List[str]		    =   model(**self._prepare_for_class(_SCREAMING_SNAKE_CASE ,	_SCREAMING_SNAKE_CASE				)				)

				__lowerCAmelCase    :		Any		    =   outputs.encoder_hidden_states if config.is_encoder_decoder else outputs.hidden_states

				__lowerCAmelCase    :		List[str]		    =   self.model_tester.num_stages
				self.assertEqual(len(_SCREAMING_SNAKE_CASE				) ,	expected_num_stages + 1				)

				# RegNet's feature maps are of shape (batch_size, num_channels, height, width)
				self.assertListEqual(
				    list(hidden_states[0].shape[-2:]				) ,	[self.model_tester.image_size // 2, self.model_tester.image_size // 2] ,	)

			__lowerCAmelCase    ,     __lowerCAmelCase    :		Dict		    =   self.model_tester.prepare_config_and_inputs_for_common()
			__lowerCAmelCase    :		List[Any]		    =   ['basic', 'bottleneck']
			for model_class in self.all_model_classes:
				for layer_type in layers_type:
					__lowerCAmelCase    :		List[Any]		    =   layer_type
					__lowerCAmelCase    :		Tuple		    =   True
					check_hidden_states_output(_SCREAMING_SNAKE_CASE ,	_SCREAMING_SNAKE_CASE ,	_SCREAMING_SNAKE_CASE				)

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

					check_hidden_states_output(_SCREAMING_SNAKE_CASE ,	_SCREAMING_SNAKE_CASE ,	_SCREAMING_SNAKE_CASE				)

		def 							__lowerCamelCase							(   self				):
			__lowerCAmelCase    :		List[Any]		    =   self.model_tester.prepare_config_and_inputs()
			self.model_tester.create_and_check_for_image_classification(*_SCREAMING_SNAKE_CASE				)







		@slow
		def 							__lowerCamelCase							(   self				):
			for model_name in REGNET_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
				__lowerCAmelCase    :		Dict		    =   RegNetModel.from_pretrained(_SCREAMING_SNAKE_CASE				)
				self.assertIsNotNone(_SCREAMING_SNAKE_CASE				)



def 					__lowerCAmelCase       ():
	__lowerCAmelCase    :		str		    =   Image.open('./tests/fixtures/tests_samples/COCO/000000039769.png'	)
	return image




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

		@cached_property
		def 							__lowerCamelCase							(   self				):
			return (
			    AutoImageProcessor.from_pretrained(REGNET_PRETRAINED_MODEL_ARCHIVE_LIST[0]				)
			    if is_vision_available()
			    else None
			)







		@slow
		def 							__lowerCamelCase							(   self				):
			__lowerCAmelCase    :		List[str]		    =   RegNetForImageClassification.from_pretrained(REGNET_PRETRAINED_MODEL_ARCHIVE_LIST[0]				).to(_SCREAMING_SNAKE_CASE				)

			__lowerCAmelCase    :		str		    =   self.default_image_processor
			__lowerCAmelCase    :		Any		    =   prepare_img()
			__lowerCAmelCase    :		Any		    =   image_processor(images=_SCREAMING_SNAKE_CASE ,	return_tensors='pt'				).to(_SCREAMING_SNAKE_CASE				)

			# forward pass
			with torch.no_grad():
				__lowerCAmelCase    :		List[str]		    =   model(**_SCREAMING_SNAKE_CASE				)

			# verify the logits
			__lowerCAmelCase    :		Union[str, Any]		    =   torch.Size((1, 10_00)				)
			self.assertEqual(outputs.logits.shape ,	_SCREAMING_SNAKE_CASE				)

			__lowerCAmelCase    :		Optional[int]		    =   torch.tensor([-0.4180, -1.5051, -3.4836]				).to(_SCREAMING_SNAKE_CASE				)

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