




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	:       List[str]     =	logging.get_logger(__name__)  # pylint: disable=invalid-name

__lowerCAmelCase	:       List[str]     =	'\n    Examples:\n        ```py\n        >>> from diffusers import KandinskyV22Pipeline, KandinskyV22PriorPipeline\n        >>> import torch\n\n        >>> pipe_prior = KandinskyV22PriorPipeline.from_pretrained("kandinsky-community/kandinsky-2-2-prior")\n        >>> pipe_prior.to("cuda")\n        >>> prompt = "red cat, 4k photo"\n        >>> out = pipe_prior(prompt)\n        >>> image_emb = out.image_embeds\n        >>> zero_image_emb = out.negative_image_embeds\n        >>> pipe = KandinskyV22Pipeline.from_pretrained("kandinsky-community/kandinsky-2-2-decoder")\n        >>> pipe.to("cuda")\n        >>> image = pipe(\n        ...     image_embeds=image_emb,\n        ...     negative_image_embeds=zero_image_emb,\n        ...     height=768,\n        ...     width=768,\n        ...     num_inference_steps=50,\n        ... ).images\n        >>> image[0].save("cat.png")\n        ```\n'




def     __magic_name__       (				A	:      Optional[int],						A	:      Optional[Any],						A	:      Tuple=8     ):






			'''simple docstring'''







			a					=    height // scale_factor**2
			if height % scale_factor**2 != 0:
						new_height += 1
			a					=    width // scale_factor**2
			if width % scale_factor**2 != 0:
						new_width += 1
			return new_height * scale_factor, new_width * scale_factor






class 					snake_case__							(_UpperCamelCase     ):
				"""simple docstring"""



				def __init__(   self       :  int      ,   __lowerCamelCase       :  UNetaDConditionModel      ,   __lowerCamelCase       :  DDPMScheduler      ,   __lowerCamelCase       :  VQModel      ,   )      ->  List[str]:
							super().__init__()

							self.register_modules(
							    unet=__lowerCamelCase      ,   scheduler=__lowerCamelCase      ,   movq=__lowerCamelCase      ,   )
							a					=    2 ** (len(self.movq.config.block_out_channels							) - 1)





				def 							__UpperCAmelCase							(   self       :  Any      ,   __lowerCamelCase       :  Optional[int]      ,   __lowerCamelCase       :  List[Any]      ,   __lowerCamelCase       :  Tuple      ,   __lowerCamelCase       :  Dict      ,   __lowerCamelCase       :  List[str]      ,   __lowerCamelCase       :  List[str]							)      ->  Tuple:
							if latents is None:
										a					=    randn_tensor(__lowerCamelCase      ,   generator=__lowerCamelCase      ,   device=__lowerCamelCase      ,   dtype=__lowerCamelCase							)
							else:
										if latents.shape != shape:
													raise ValueError(f"""Unexpected latents shape, got {latents.shape}, expected {shape}"""							)
										a					=    latents.to(__lowerCamelCase							)

							a					=    latents * scheduler.init_noise_sigma
							return latents





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

							a					=    torch.device(f"""cuda:{gpu_id}"""							)

							a					=    [
							    self.unet,
							    self.movq,
							]
							for cpu_offloaded_model in models:
										if cpu_offloaded_model is not None:
													cpu_offload(__lowerCamelCase      ,   __lowerCamelCase							)





				def 							__UpperCAmelCase							(   self       :  Optional[int]      ,   __lowerCamelCase       :  Any=0							)      ->  str:
							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."							)

							a					=    torch.device(f"""cuda:{gpu_id}"""							)

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

							a					=    None
							for cpu_offloaded_model in [self.unet, self.movq]:
										a					,	a					=    cpu_offload_with_hook(__lowerCamelCase      ,   __lowerCamelCase      ,   prev_module_hook=__lowerCamelCase							)

							# We'll offload the last model manually.
							a					=    hook





				@property
				# Copied from diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion.StableDiffusionPipeline._execution_device
				def 							__UpperCAmelCase							(   self       :  List[str]							)      ->  List[str]:
							if not hasattr(self.unet      ,   "_hf_hook"							):
										return self.device
							for module in self.unet.modules():
										if (
										    hasattr(__lowerCamelCase      ,   "_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(__lowerCamelCase							)
				def __call__(   self       :  Union[str, Any]      ,   __lowerCamelCase       :  Union[torch.FloatTensor, List[torch.FloatTensor]]      ,   __lowerCamelCase       :  Union[torch.FloatTensor, List[torch.FloatTensor]]      ,   __lowerCamelCase       :  int = 5_12      ,   __lowerCamelCase       :  int = 5_12      ,   __lowerCamelCase       :  int = 1_00      ,   __lowerCamelCase       :  float = 4.0      ,   __lowerCamelCase       :  int = 1      ,   __lowerCamelCase       :  Optional[Union[torch.Generator, List[torch.Generator]]] = None      ,   __lowerCamelCase       :  Optional[torch.FloatTensor] = None      ,   __lowerCamelCase       :  Optional[str] = "pil"      ,   __lowerCamelCase       :  bool = True      ,   )      ->  Union[str, Any]:
							a					=    self._execution_device

							a					=    guidance_scale > 1.0

							if isinstance(__lowerCamelCase      ,   __lowerCamelCase							):
										a					=    torch.cat(__lowerCamelCase      ,   dim=0							)
							a					=    image_embeds.shape[0] * num_images_per_prompt
							if isinstance(__lowerCamelCase      ,   __lowerCamelCase							):
										a					=    torch.cat(__lowerCamelCase      ,   dim=0							)

							if do_classifier_free_guidance:
										a					=    image_embeds.repeat_interleave(__lowerCamelCase      ,   dim=0							)
										a					=    negative_image_embeds.repeat_interleave(__lowerCamelCase      ,   dim=0							)

							a					=    torch.cat([negative_image_embeds, image_embeds]      ,   dim=0							).to(dtype=self.unet.dtype      ,   device=__lowerCamelCase							)

							self.scheduler.set_timesteps(__lowerCamelCase      ,   device=__lowerCamelCase							)
							a					=    self.scheduler.timesteps

							a					=    self.unet.config.in_channels

							a					,	a					=    downscale_height_and_width(__lowerCamelCase      ,   __lowerCamelCase      ,   self.movq_scale_factor							)

							# create initial latent
							a					=    self.prepare_latents(
							    (batch_size, num_channels_latents, height, width)      ,   image_embeds.dtype      ,   __lowerCamelCase      ,   __lowerCamelCase      ,   __lowerCamelCase      ,   self.scheduler      ,   )

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

										a					=    {"image_embeds": image_embeds}
										a					=    self.unet(
										    sample=__lowerCamelCase      ,   timestep=__lowerCamelCase      ,   encoder_hidden_states=__lowerCamelCase      ,   added_cond_kwargs=__lowerCamelCase      ,   return_dict=__lowerCamelCase      ,   )[0]

										if do_classifier_free_guidance:
													a					,	a					=    noise_pred.split(latents.shape[1]      ,   dim=1							)
													a					,	a					=    noise_pred.chunk(2							)
													a					,	a					=    variance_pred.chunk(2							)
													a					=    noise_pred_uncond + guidance_scale * (noise_pred_text - noise_pred_uncond)
													a					=    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"]
										):
													a					,	a					=    noise_pred.split(latents.shape[1]      ,   dim=1							)

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

							if output_type == "pil":
										a					=    self.numpy_to_pil(__lowerCamelCase							)

							if not return_dict:
										return (image,)

							return ImagePipelineOutput(images=__lowerCamelCase							)












import json
import pathlib
import unittest

import numpy as np

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

from ...test_image_processing_common import ImageProcessingSavingTestMixin, prepare_image_inputs


if is_torch_available():
		import torch

if is_vision_available():
		from PIL import Image

		from transformers import DetaImageProcessor




class 					snake_case__							(unittest.TestCase     ):
				"""simple docstring"""



				def __init__(   self       :  Dict      ,   __lowerCamelCase       :  Any      ,   __lowerCamelCase       :  Any=7      ,   __lowerCamelCase       :  List[Any]=3      ,   __lowerCamelCase       :  int=30      ,   __lowerCamelCase       :  int=4_00      ,   __lowerCamelCase       :  Dict=True      ,   __lowerCamelCase       :  Tuple=None      ,   __lowerCamelCase       :  Optional[int]=True      ,   __lowerCamelCase       :  Optional[Any]=[0.5, 0.5, 0.5]      ,   __lowerCamelCase       :  Optional[Any]=[0.5, 0.5, 0.5]      ,   __lowerCamelCase       :  Dict=True      ,   __lowerCamelCase       :  List[str]=1 / 2_55      ,   __lowerCamelCase       :  Optional[int]=True      ,   )      ->  str:
							# by setting size["longest_edge"] > max_resolution we're effectively not testing this :p
							a					=    size if size is not None else {"shortest_edge": 18, "longest_edge": 13_33}
							a					=    parent
							a					=    batch_size
							a					=    num_channels
							a					=    min_resolution
							a					=    max_resolution
							a					=    do_resize
							a					=    size
							a					=    do_normalize
							a					=    image_mean
							a					=    image_std
							a					=    do_rescale
							a					=    rescale_factor
							a					=    do_pad





				def 							__UpperCAmelCase							(   self       :  List[Any]							)      ->  Any:
							return {
							    "do_resize": self.do_resize,
							    "size": self.size,
							    "do_normalize": self.do_normalize,
							    "image_mean": self.image_mean,
							    "image_std": self.image_std,
							    "do_rescale": self.do_rescale,
							    "rescale_factor": self.rescale_factor,
							    "do_pad": self.do_pad,
							}





				def 							__UpperCAmelCase							(   self       :  Union[str, Any]      ,   __lowerCamelCase       :  Any      ,   __lowerCamelCase       :  str=False							)      ->  List[str]:
							if not batched:
										a					=    image_inputs[0]
										if isinstance(__lowerCamelCase      ,   Image.Image							):
													a					,	a					=    image.size
										else:
													a					,	a					=    image.shape[1], image.shape[2]
										if w < h:
													a					=    int(self.size["shortest_edge"] * h / w							)
													a					=    self.size["shortest_edge"]
										elif w > h:
													a					=    self.size["shortest_edge"]
													a					=    int(self.size["shortest_edge"] * w / h							)
										else:
													a					=    self.size["shortest_edge"]
													a					=    self.size["shortest_edge"]

							else:
										a					=    []
										for image in image_inputs:
													a					,	a					=    self.get_expected_values([image]							)
													expected_values.append((expected_height, expected_width)							)
										a					=    max(__lowerCamelCase      ,   key=lambda __lowerCamelCase							: item[0]							)[0]
										a					=    max(__lowerCamelCase      ,   key=lambda __lowerCamelCase							: item[1]							)[1]

							return expected_height, expected_width




@require_torch
@require_vision
class 					snake_case__							(_UpperCamelCase					, unittest.TestCase     ):
				"""simple docstring"""



				SCREAMING_SNAKE_CASE_ :							Tuple											=      DetaImageProcessor if is_vision_available() else None





				def 							__UpperCAmelCase							(   self       :  Union[str, Any]							)      ->  List[Any]:
							a					=    DetaImageProcessingTester(self							)





				@property
				def 							__UpperCAmelCase							(   self       :  List[Any]							)      ->  Optional[Any]:
							return self.image_processor_tester.prepare_image_processor_dict()





				def 							__UpperCAmelCase							(   self       :  Optional[int]							)      ->  Tuple:
							a					=    self.image_processing_class(**self.image_processor_dict							)
							self.assertTrue(hasattr(__lowerCamelCase      ,   "image_mean"							)							)
							self.assertTrue(hasattr(__lowerCamelCase      ,   "image_std"							)							)
							self.assertTrue(hasattr(__lowerCamelCase      ,   "do_normalize"							)							)
							self.assertTrue(hasattr(__lowerCamelCase      ,   "do_resize"							)							)
							self.assertTrue(hasattr(__lowerCamelCase      ,   "do_rescale"							)							)
							self.assertTrue(hasattr(__lowerCamelCase      ,   "do_pad"							)							)
							self.assertTrue(hasattr(__lowerCamelCase      ,   "size"							)							)





				def 							__UpperCAmelCase							(   self       :  List[str]							)      ->  Union[str, Any]:
							a					=    self.image_processing_class.from_dict(self.image_processor_dict							)
							self.assertEqual(image_processor.size      ,   {"shortest_edge": 18, "longest_edge": 13_33}							)
							self.assertEqual(image_processor.do_pad      ,   __lowerCamelCase							)





				def 							__UpperCAmelCase							(   self       :  Any							)      ->  int:
							pass





				def 							__UpperCAmelCase							(   self       :  Any							)      ->  Any:
							# Initialize image_processing
							a					=    self.image_processing_class(**self.image_processor_dict							)
							# create random PIL images
							a					=    prepare_image_inputs(self.image_processor_tester      ,   equal_resolution=__lowerCamelCase							)
							for image in image_inputs:
										self.assertIsInstance(__lowerCamelCase      ,   Image.Image							)

							# Test not batched input
							a					=    image_processing(image_inputs[0]      ,   return_tensors="pt"							).pixel_values

							a					,	a					=    self.image_processor_tester.get_expected_values(__lowerCamelCase							)

							self.assertEqual(
							    encoded_images.shape      ,   (1, self.image_processor_tester.num_channels, expected_height, expected_width)      ,   )

							# Test batched
							a					,	a					=    self.image_processor_tester.get_expected_values(__lowerCamelCase      ,   batched=__lowerCamelCase							)

							a					=    image_processing(__lowerCamelCase      ,   return_tensors="pt"							).pixel_values
							self.assertEqual(
							    encoded_images.shape      ,   (
							        self.image_processor_tester.batch_size,
							        self.image_processor_tester.num_channels,
							        expected_height,
							        expected_width,
							    )      ,   )





				def 							__UpperCAmelCase							(   self       :  Union[str, Any]							)      ->  Optional[Any]:
							# Initialize image_processing
							a					=    self.image_processing_class(**self.image_processor_dict							)
							# create random numpy tensors
							a					=    prepare_image_inputs(self.image_processor_tester      ,   equal_resolution=__lowerCamelCase      ,   numpify=__lowerCamelCase							)
							for image in image_inputs:
										self.assertIsInstance(__lowerCamelCase      ,   np.ndarray							)

							# Test not batched input
							a					=    image_processing(image_inputs[0]      ,   return_tensors="pt"							).pixel_values

							a					,	a					=    self.image_processor_tester.get_expected_values(__lowerCamelCase							)

							self.assertEqual(
							    encoded_images.shape      ,   (1, self.image_processor_tester.num_channels, expected_height, expected_width)      ,   )

							# Test batched
							a					=    image_processing(__lowerCamelCase      ,   return_tensors="pt"							).pixel_values

							a					,	a					=    self.image_processor_tester.get_expected_values(__lowerCamelCase      ,   batched=__lowerCamelCase							)

							self.assertEqual(
							    encoded_images.shape      ,   (
							        self.image_processor_tester.batch_size,
							        self.image_processor_tester.num_channels,
							        expected_height,
							        expected_width,
							    )      ,   )





				def 							__UpperCAmelCase							(   self       :  Any							)      ->  List[str]:
							# Initialize image_processing
							a					=    self.image_processing_class(**self.image_processor_dict							)
							# create random PyTorch tensors
							a					=    prepare_image_inputs(self.image_processor_tester      ,   equal_resolution=__lowerCamelCase      ,   torchify=__lowerCamelCase							)
							for image in image_inputs:
										self.assertIsInstance(__lowerCamelCase      ,   torch.Tensor							)

							# Test not batched input
							a					=    image_processing(image_inputs[0]      ,   return_tensors="pt"							).pixel_values

							a					,	a					=    self.image_processor_tester.get_expected_values(__lowerCamelCase							)

							self.assertEqual(
							    encoded_images.shape      ,   (1, self.image_processor_tester.num_channels, expected_height, expected_width)      ,   )

							# Test batched
							a					=    image_processing(__lowerCamelCase      ,   return_tensors="pt"							).pixel_values

							a					,	a					=    self.image_processor_tester.get_expected_values(__lowerCamelCase      ,   batched=__lowerCamelCase							)

							self.assertEqual(
							    encoded_images.shape      ,   (
							        self.image_processor_tester.batch_size,
							        self.image_processor_tester.num_channels,
							        expected_height,
							        expected_width,
							    )      ,   )





				@slow
				def 							__UpperCAmelCase							(   self       :  Any							)      ->  List[Any]:
							# prepare image and target
							a					=    Image.open("./tests/fixtures/tests_samples/COCO/000000039769.png"							)
							with open("./tests/fixtures/tests_samples/COCO/coco_annotations.txt"      ,   "r"							) as f:
										a					=    json.loads(f.read()							)

							a					=    {"image_id": 3_97_69, "annotations": target}

							# encode them
							a					=    DetaImageProcessor()
							a					=    image_processing(images=__lowerCamelCase      ,   annotations=__lowerCamelCase      ,   return_tensors="pt"							)

							# verify pixel values
							a					=    torch.Size([1, 3, 8_00, 10_66]							)
							self.assertEqual(encoding["pixel_values"].shape      ,   __lowerCamelCase							)

							a					=    torch.tensor([0.2_796, 0.3_138, 0.3_481]							)
							self.assertTrue(torch.allclose(encoding["pixel_values"][0, 0, 0, :3]      ,   __lowerCamelCase      ,   atol=1e-4							)							)

							# verify area
							a					=    torch.tensor([5_887.9_600, 11_250.2_061, 489_353.8_438, 837_122.7_500, 147_967.5_156, 165_732.3_438]							)
							self.assertTrue(torch.allclose(encoding["labels"][0]["area"]      ,   __lowerCamelCase							)							)
							# verify boxes
							a					=    torch.Size([6, 4]							)
							self.assertEqual(encoding["labels"][0]["boxes"].shape      ,   __lowerCamelCase							)
							a					=    torch.tensor([0.5_503, 0.2_765, 0.0_604, 0.2_215]							)
							self.assertTrue(torch.allclose(encoding["labels"][0]["boxes"][0]      ,   __lowerCamelCase      ,   atol=1e-3							)							)
							# verify image_id
							a					=    torch.tensor([3_97_69]							)
							self.assertTrue(torch.allclose(encoding["labels"][0]["image_id"]      ,   __lowerCamelCase							)							)
							# verify is_crowd
							a					=    torch.tensor([0, 0, 0, 0, 0, 0]							)
							self.assertTrue(torch.allclose(encoding["labels"][0]["iscrowd"]      ,   __lowerCamelCase							)							)
							# verify class_labels
							a					=    torch.tensor([75, 75, 63, 65, 17, 17]							)
							self.assertTrue(torch.allclose(encoding["labels"][0]["class_labels"]      ,   __lowerCamelCase							)							)
							# verify orig_size
							a					=    torch.tensor([4_80, 6_40]							)
							self.assertTrue(torch.allclose(encoding["labels"][0]["orig_size"]      ,   __lowerCamelCase							)							)
							# verify size
							a					=    torch.tensor([8_00, 10_66]							)
							self.assertTrue(torch.allclose(encoding["labels"][0]["size"]      ,   __lowerCamelCase							)							)





				@slow
				def 							__UpperCAmelCase							(   self       :  Any							)      ->  Union[str, Any]:
							# prepare image, target and masks_path
							a					=    Image.open("./tests/fixtures/tests_samples/COCO/000000039769.png"							)
							with open("./tests/fixtures/tests_samples/COCO/coco_panoptic_annotations.txt"      ,   "r"							) as f:
										a					=    json.loads(f.read()							)

							a					=    {"file_name": "000000039769.png", "image_id": 3_97_69, "segments_info": target}

							a					=    pathlib.Path("./tests/fixtures/tests_samples/COCO/coco_panoptic"							)

							# encode them
							a					=    DetaImageProcessor(format="coco_panoptic"							)
							a					=    image_processing(images=__lowerCamelCase      ,   annotations=__lowerCamelCase      ,   masks_path=__lowerCamelCase      ,   return_tensors="pt"							)

							# verify pixel values
							a					=    torch.Size([1, 3, 8_00, 10_66]							)
							self.assertEqual(encoding["pixel_values"].shape      ,   __lowerCamelCase							)

							a					=    torch.tensor([0.2_796, 0.3_138, 0.3_481]							)
							self.assertTrue(torch.allclose(encoding["pixel_values"][0, 0, 0, :3]      ,   __lowerCamelCase      ,   atol=1e-4							)							)

							# verify area
							a					=    torch.tensor([147_979.6_875, 165_527.0_469, 484_638.5_938, 11_292.9_375, 5_879.6_562, 7_634.1_147]							)
							self.assertTrue(torch.allclose(encoding["labels"][0]["area"]      ,   __lowerCamelCase							)							)
							# verify boxes
							a					=    torch.Size([6, 4]							)
							self.assertEqual(encoding["labels"][0]["boxes"].shape      ,   __lowerCamelCase							)
							a					=    torch.tensor([0.2_625, 0.5_437, 0.4_688, 0.8_625]							)
							self.assertTrue(torch.allclose(encoding["labels"][0]["boxes"][0]      ,   __lowerCamelCase      ,   atol=1e-3							)							)
							# verify image_id
							a					=    torch.tensor([3_97_69]							)
							self.assertTrue(torch.allclose(encoding["labels"][0]["image_id"]      ,   __lowerCamelCase							)							)
							# verify is_crowd
							a					=    torch.tensor([0, 0, 0, 0, 0, 0]							)
							self.assertTrue(torch.allclose(encoding["labels"][0]["iscrowd"]      ,   __lowerCamelCase							)							)
							# verify class_labels
							a					=    torch.tensor([17, 17, 63, 75, 75, 93]							)
							self.assertTrue(torch.allclose(encoding["labels"][0]["class_labels"]      ,   __lowerCamelCase							)							)
							# verify masks
							a					=    82_28_73
							self.assertEqual(encoding["labels"][0]["masks"].sum().item()      ,   __lowerCamelCase							)
							# verify orig_size
							a					=    torch.tensor([4_80, 6_40]							)
							self.assertTrue(torch.allclose(encoding["labels"][0]["orig_size"]      ,   __lowerCamelCase							)							)
							# verify size
							a					=    torch.tensor([8_00, 10_66]							)
							self.assertTrue(torch.allclose(encoding["labels"][0]["size"]      ,   __lowerCamelCase							)							)






