
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 DeformableDetrImageProcessor





class 	_lowerCAmelCase					(	unittest.TestCase       ):




				def __init__(					self				,				_UpperCamelCase				,				_UpperCamelCase=7				,				_UpperCamelCase=3				,				_UpperCamelCase=30				,				_UpperCamelCase=400				,				_UpperCamelCase=True				,				_UpperCamelCase=None				,				_UpperCamelCase=True				,				_UpperCamelCase=[0.5, 0.5, 0.5]				,				_UpperCamelCase=[0.5, 0.5, 0.5]				,				_UpperCamelCase=True				,				_UpperCamelCase=1 / 255				,				_UpperCamelCase=True				,				)				->      Optional[int]:
							# by setting size["longest_edge"] > max_resolution we're effectively not testing this :p
							lowerCAmelCase_						=	size if size is not None else {"shortest_edge": 18, "longest_edge": 1_333}
							lowerCAmelCase_						=	parent
							lowerCAmelCase_						=	batch_size
							lowerCAmelCase_						=	num_channels
							lowerCAmelCase_						=	min_resolution
							lowerCAmelCase_						=	max_resolution
							lowerCAmelCase_						=	do_resize
							lowerCAmelCase_						=	size
							lowerCAmelCase_						=	do_normalize
							lowerCAmelCase_						=	image_mean
							lowerCAmelCase_						=	image_std
							lowerCAmelCase_						=	do_rescale
							lowerCAmelCase_						=	rescale_factor
							lowerCAmelCase_						=	do_pad




				def      __a						(					self     )				->      Union[str, 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      __a						(					self				,				_UpperCamelCase				,				_UpperCamelCase=False     )				->      Optional[int]:
							if not batched:
										lowerCAmelCase_						=	image_inputs[0]
										if isinstance(_UpperCamelCase				,				Image.Image     ):
													lowerCAmelCase_	,  lowerCAmelCase_						=	image.size
										else:
													lowerCAmelCase_	,  lowerCAmelCase_						=	image.shape[1], image.shape[2]
										if w < h:
													lowerCAmelCase_						=	int(self.size["shortest_edge"] * h / w     )
													lowerCAmelCase_						=	self.size["shortest_edge"]
										elif w > h:
													lowerCAmelCase_						=	self.size["shortest_edge"]
													lowerCAmelCase_						=	int(self.size["shortest_edge"] * w / h     )
										else:
													lowerCAmelCase_						=	self.size["shortest_edge"]
													lowerCAmelCase_						=	self.size["shortest_edge"]

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

							return expected_height, expected_width





@require_torch
@require_vision
class 	_lowerCAmelCase					(	__a					,      unittest.TestCase       ):
				_lowercase					=DeformableDetrImageProcessor if is_vision_available() else None




				def      __a						(					self     )				->      Dict:
							lowerCAmelCase_						=	DeformableDetrImageProcessingTester(self     )




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




				def      __a						(					self     )				->      List[Any]:
							lowerCAmelCase_						=	self.image_processing_class(**self.image_processor_dict     )
							self.assertTrue(hasattr(_UpperCamelCase				,				"image_mean"     )     )
							self.assertTrue(hasattr(_UpperCamelCase				,				"image_std"     )     )
							self.assertTrue(hasattr(_UpperCamelCase				,				"do_normalize"     )     )
							self.assertTrue(hasattr(_UpperCamelCase				,				"do_resize"     )     )
							self.assertTrue(hasattr(_UpperCamelCase				,				"do_rescale"     )     )
							self.assertTrue(hasattr(_UpperCamelCase				,				"do_pad"     )     )
							self.assertTrue(hasattr(_UpperCamelCase				,				"size"     )     )




				def      __a						(					self     )				->      Optional[int]:
							lowerCAmelCase_						=	self.image_processing_class.from_dict(self.image_processor_dict     )
							self.assertEqual(image_processor.size				,				{"shortest_edge": 18, "longest_edge": 1_333}     )
							self.assertEqual(image_processor.do_pad				,				_UpperCamelCase     )

							lowerCAmelCase_						=	self.image_processing_class.from_dict(
							    self.image_processor_dict				,				size=42				,				max_size=84				,				pad_and_return_pixel_mask=_UpperCamelCase     )
							self.assertEqual(image_processor.size				,				{"shortest_edge": 42, "longest_edge": 84}     )
							self.assertEqual(image_processor.do_pad				,				_UpperCamelCase     )




				def      __a						(					self     )				->      Union[str, Any]:
							pass




				def      __a						(					self     )				->      Optional[Any]:
							# Initialize image_processing
							lowerCAmelCase_						=	self.image_processing_class(**self.image_processor_dict     )
							# create random PIL images
							lowerCAmelCase_						=	prepare_image_inputs(self.image_processor_tester				,				equal_resolution=_UpperCamelCase     )
							for image in image_inputs:
										self.assertIsInstance(_UpperCamelCase				,				Image.Image     )

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

							lowerCAmelCase_	,  lowerCAmelCase_						=	self.image_processor_tester.get_expected_values(_UpperCamelCase     )

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

							# Test batched
							lowerCAmelCase_	,  lowerCAmelCase_						=	self.image_processor_tester.get_expected_values(_UpperCamelCase				,				batched=_UpperCamelCase     )

							lowerCAmelCase_						=	image_processing(_UpperCamelCase				,				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      __a						(					self     )				->      List[Any]:
							# Initialize image_processing
							lowerCAmelCase_						=	self.image_processing_class(**self.image_processor_dict     )
							# create random numpy tensors
							lowerCAmelCase_						=	prepare_image_inputs(self.image_processor_tester				,				equal_resolution=_UpperCamelCase				,				numpify=_UpperCamelCase     )
							for image in image_inputs:
										self.assertIsInstance(_UpperCamelCase				,				np.ndarray     )

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

							lowerCAmelCase_	,  lowerCAmelCase_						=	self.image_processor_tester.get_expected_values(_UpperCamelCase     )

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

							# Test batched
							lowerCAmelCase_						=	image_processing(_UpperCamelCase				,				return_tensors="pt"     ).pixel_values

							lowerCAmelCase_	,  lowerCAmelCase_						=	self.image_processor_tester.get_expected_values(_UpperCamelCase				,				batched=_UpperCamelCase     )

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




				def      __a						(					self     )				->      Tuple:
							# Initialize image_processing
							lowerCAmelCase_						=	self.image_processing_class(**self.image_processor_dict     )
							# create random PyTorch tensors
							lowerCAmelCase_						=	prepare_image_inputs(self.image_processor_tester				,				equal_resolution=_UpperCamelCase				,				torchify=_UpperCamelCase     )
							for image in image_inputs:
										self.assertIsInstance(_UpperCamelCase				,				torch.Tensor     )

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

							lowerCAmelCase_	,  lowerCAmelCase_						=	self.image_processor_tester.get_expected_values(_UpperCamelCase     )

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

							# Test batched
							lowerCAmelCase_						=	image_processing(_UpperCamelCase				,				return_tensors="pt"     ).pixel_values

							lowerCAmelCase_	,  lowerCAmelCase_						=	self.image_processor_tester.get_expected_values(_UpperCamelCase				,				batched=_UpperCamelCase     )

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




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

							lowerCAmelCase_						=	{"image_id": 39_769, "annotations": target}

							# encode them
							lowerCAmelCase_						=	DeformableDetrImageProcessor()
							lowerCAmelCase_						=	image_processing(images=_UpperCamelCase				,				annotations=_UpperCamelCase				,				return_tensors="pt"     )

							# verify pixel values
							lowerCAmelCase_						=	torch.Size([1, 3, 800, 1_066]     )
							self.assertEqual(encoding["pixel_values"].shape				,				_UpperCamelCase     )

							lowerCAmelCase_						=	torch.tensor([0.2796, 0.3138, 0.3481]     )
							self.assertTrue(torch.allclose(encoding["pixel_values"][0, 0, 0, :3]				,				_UpperCamelCase				,				atol=1e-4     )     )

							# verify area
							lowerCAmelCase_						=	torch.tensor([5887.9600, 11250.2061, 489353.8438, 837122.7500, 147967.5156, 165732.3438]     )
							self.assertTrue(torch.allclose(encoding["labels"][0]["area"]				,				_UpperCamelCase     )     )
							# verify boxes
							lowerCAmelCase_						=	torch.Size([6, 4]     )
							self.assertEqual(encoding["labels"][0]["boxes"].shape				,				_UpperCamelCase     )
							lowerCAmelCase_						=	torch.tensor([0.5503, 0.2765, 0.0604, 0.2215]     )
							self.assertTrue(torch.allclose(encoding["labels"][0]["boxes"][0]				,				_UpperCamelCase				,				atol=1e-3     )     )
							# verify image_id
							lowerCAmelCase_						=	torch.tensor([39_769]     )
							self.assertTrue(torch.allclose(encoding["labels"][0]["image_id"]				,				_UpperCamelCase     )     )
							# verify is_crowd
							lowerCAmelCase_						=	torch.tensor([0, 0, 0, 0, 0, 0]     )
							self.assertTrue(torch.allclose(encoding["labels"][0]["iscrowd"]				,				_UpperCamelCase     )     )
							# verify class_labels
							lowerCAmelCase_						=	torch.tensor([75, 75, 63, 65, 17, 17]     )
							self.assertTrue(torch.allclose(encoding["labels"][0]["class_labels"]				,				_UpperCamelCase     )     )
							# verify orig_size
							lowerCAmelCase_						=	torch.tensor([480, 640]     )
							self.assertTrue(torch.allclose(encoding["labels"][0]["orig_size"]				,				_UpperCamelCase     )     )
							# verify size
							lowerCAmelCase_						=	torch.tensor([800, 1_066]     )
							self.assertTrue(torch.allclose(encoding["labels"][0]["size"]				,				_UpperCamelCase     )     )




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

							lowerCAmelCase_						=	{"file_name": "000000039769.png", "image_id": 39_769, "segments_info": target}

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

							# encode them
							lowerCAmelCase_						=	DeformableDetrImageProcessor(format="coco_panoptic"     )
							lowerCAmelCase_						=	image_processing(images=_UpperCamelCase				,				annotations=_UpperCamelCase				,				masks_path=_UpperCamelCase				,				return_tensors="pt"     )

							# verify pixel values
							lowerCAmelCase_						=	torch.Size([1, 3, 800, 1_066]     )
							self.assertEqual(encoding["pixel_values"].shape				,				_UpperCamelCase     )

							lowerCAmelCase_						=	torch.tensor([0.2796, 0.3138, 0.3481]     )
							self.assertTrue(torch.allclose(encoding["pixel_values"][0, 0, 0, :3]				,				_UpperCamelCase				,				atol=1e-4     )     )

							# verify area
							lowerCAmelCase_						=	torch.tensor([147979.6875, 165527.0469, 484638.5938, 11292.9375, 5879.6562, 7634.1147]     )
							self.assertTrue(torch.allclose(encoding["labels"][0]["area"]				,				_UpperCamelCase     )     )
							# verify boxes
							lowerCAmelCase_						=	torch.Size([6, 4]     )
							self.assertEqual(encoding["labels"][0]["boxes"].shape				,				_UpperCamelCase     )
							lowerCAmelCase_						=	torch.tensor([0.2625, 0.5437, 0.4688, 0.8625]     )
							self.assertTrue(torch.allclose(encoding["labels"][0]["boxes"][0]				,				_UpperCamelCase				,				atol=1e-3     )     )
							# verify image_id
							lowerCAmelCase_						=	torch.tensor([39_769]     )
							self.assertTrue(torch.allclose(encoding["labels"][0]["image_id"]				,				_UpperCamelCase     )     )
							# verify is_crowd
							lowerCAmelCase_						=	torch.tensor([0, 0, 0, 0, 0, 0]     )
							self.assertTrue(torch.allclose(encoding["labels"][0]["iscrowd"]				,				_UpperCamelCase     )     )
							# verify class_labels
							lowerCAmelCase_						=	torch.tensor([17, 17, 63, 75, 75, 93]     )
							self.assertTrue(torch.allclose(encoding["labels"][0]["class_labels"]				,				_UpperCamelCase     )     )
							# verify masks
							lowerCAmelCase_						=	822_873
							self.assertEqual(encoding["labels"][0]["masks"].sum().item()				,				_UpperCamelCase     )
							# verify orig_size
							lowerCAmelCase_						=	torch.tensor([480, 640]     )
							self.assertTrue(torch.allclose(encoding["labels"][0]["orig_size"]				,				_UpperCamelCase     )     )
							# verify size
							lowerCAmelCase_						=	torch.tensor([800, 1_066]     )
							self.assertTrue(torch.allclose(encoding["labels"][0]["size"]				,				_UpperCamelCase     )     )





from ..utils import DummyObject, requires_backends





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Dict:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Optional[int]:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      str:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Any:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Any:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Optional[Any]:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Optional[Any]:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      int:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Optional[Any]:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Dict:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Optional[Any]:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      int:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      int:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      List[Any]:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      List[str]:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Dict:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      int:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Tuple:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      int:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Dict:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Tuple:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      int:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      int:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Optional[Any]:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      str:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      List[str]:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      int:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Dict:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Optional[int]:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Optional[Any]:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      List[str]:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      int:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Optional[int]:
							requires_backends(cls				,				["torch"]     )






def    lowerCamelCase__				(				*__lowerCAmelCase  :  Union[str, Any]    ,							**__lowerCAmelCase  :  Dict				):




			"""simple docstring"""


			requires_backends(__lowerCAmelCase    ,							["torch"]				)






def    lowerCamelCase__				(				*__lowerCAmelCase  :  Optional[int]    ,							**__lowerCAmelCase  :  int				):




			"""simple docstring"""


			requires_backends(__lowerCAmelCase    ,							["torch"]				)






def    lowerCamelCase__				(				*__lowerCAmelCase  :  List[str]    ,							**__lowerCAmelCase  :  int				):




			"""simple docstring"""


			requires_backends(__lowerCAmelCase    ,							["torch"]				)






def    lowerCamelCase__				(				*__lowerCAmelCase  :  Union[str, Any]    ,							**__lowerCAmelCase  :  Optional[Any]				):




			"""simple docstring"""


			requires_backends(__lowerCAmelCase    ,							["torch"]				)






def    lowerCamelCase__				(				*__lowerCAmelCase  :  Dict    ,							**__lowerCAmelCase  :  Any				):




			"""simple docstring"""


			requires_backends(__lowerCAmelCase    ,							["torch"]				)






def    lowerCamelCase__				(				*__lowerCAmelCase  :  Optional[int]    ,							**__lowerCAmelCase  :  Dict				):




			"""simple docstring"""


			requires_backends(__lowerCAmelCase    ,							["torch"]				)






def    lowerCamelCase__				(				*__lowerCAmelCase  :  int    ,							**__lowerCAmelCase  :  Any				):




			"""simple docstring"""


			requires_backends(__lowerCAmelCase    ,							["torch"]				)





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      int:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      List[str]:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      List[str]:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Tuple:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Dict:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      int:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      List[str]:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Union[str, Any]:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Optional[int]:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Optional[int]:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      int:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      List[Any]:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Tuple:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      List[str]:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Union[str, Any]:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Optional[int]:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Tuple:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      List[Any]:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Any:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Optional[int]:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      List[Any]:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Optional[Any]:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      str:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Optional[Any]:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Optional[Any]:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      List[Any]:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      List[Any]:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Optional[int]:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      List[Any]:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      List[Any]:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Dict:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      int:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Any:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Dict:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Tuple:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Tuple:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      List[Any]:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Tuple:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Optional[int]:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Union[str, Any]:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      List[Any]:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      List[str]:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Optional[int]:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Tuple:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      List[str]:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      int:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Any:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Optional[int]:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Dict:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      List[str]:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Optional[int]:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Optional[int]:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      List[Any]:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Dict:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Any:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Optional[int]:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Optional[Any]:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Union[str, Any]:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Any:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Dict:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      int:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Any:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Optional[Any]:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Optional[Any]:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Tuple:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Optional[Any]:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Tuple:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Dict:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      List[Any]:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      str:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      List[Any]:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Tuple:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Dict:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      List[Any]:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Tuple:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Optional[Any]:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      int:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      List[Any]:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      int:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Dict:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Any:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Dict:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Any:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      str:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Dict:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      int:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      List[Any]:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Optional[Any]:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      List[str]:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Optional[Any]:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Tuple:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Union[str, Any]:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Union[str, Any]:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Optional[Any]:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      int:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Optional[Any]:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Optional[Any]:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      List[Any]:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Dict:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Dict:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      int:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      List[str]:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Tuple:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Any:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      List[Any]:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Optional[Any]:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Dict:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Optional[Any]:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Dict:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Optional[Any]:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      List[str]:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Optional[int]:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Union[str, Any]:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Tuple:
							requires_backends(cls				,				["torch"]     )





class 	_lowerCAmelCase					(	metaclass=__a       ):
				_lowercase					=['''torch''']




				def __init__(					self				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      str:
							requires_backends(self				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      Dict:
							requires_backends(cls				,				["torch"]     )




				@classmethod
				def      __a						(					cls				,				*_UpperCamelCase				,				**_UpperCamelCase     )				->      List[str]:
							requires_backends(cls				,				["torch"]     )



