


import tempfile

import torch

from diffusers import PNDMScheduler

from .test_schedulers import SchedulerCommonTest






class      UpperCamelCase(	_a ):
					snake_case_		:					Tuple    					=						(PNDMScheduler,)
					snake_case_		:					int    					=						(("""num_inference_steps""", 50),)


					def 				SCREAMING_SNAKE_CASE_	(    self						:		List[str]  ,     **SCREAMING_SNAKE_CASE						:		Any    )      ->						Optional[Any]:




											'''simple docstring'''

											__snake_case				=		{
											    "num_train_timesteps": 1_0_0_0,
											    "beta_start": 0.0001,
											    "beta_end": 0.02,
											    "beta_schedule": "linear",
											}

											config.update(**SCREAMING_SNAKE_CASE    )
											return config


					def 				SCREAMING_SNAKE_CASE_	(    self						:		str  ,     SCREAMING_SNAKE_CASE						:		Union[str, Any]=0  ,     **SCREAMING_SNAKE_CASE						:		Optional[int]    )      ->						List[Any]:




											'''simple docstring'''

											__snake_case				=		dict(self.forward_default_kwargs    )
											__snake_case				=		kwargs.pop("num_inference_steps"  ,     SCREAMING_SNAKE_CASE    )
											__snake_case				=		self.dummy_sample
											__snake_case				=		0.1 * sample
											__snake_case				=		[residual + 0.2, residual + 0.15, residual + 0.1, residual + 0.05]

											for scheduler_class in self.scheduler_classes:
																	__snake_case				=		self.get_scheduler_config(**SCREAMING_SNAKE_CASE    )
																	__snake_case				=		scheduler_class(**SCREAMING_SNAKE_CASE    )
																	scheduler.set_timesteps(SCREAMING_SNAKE_CASE    )
																	# copy over dummy past residuals
																	__snake_case				=		dummy_past_residuals[:]

																	with tempfile.TemporaryDirectory() as tmpdirname:
																							scheduler.save_config(SCREAMING_SNAKE_CASE    )
																							__snake_case				=		scheduler_class.from_pretrained(SCREAMING_SNAKE_CASE    )
																							new_scheduler.set_timesteps(SCREAMING_SNAKE_CASE    )
																							# copy over dummy past residuals
																							__snake_case				=		dummy_past_residuals[:]

																	__snake_case				=		scheduler.step_prk(SCREAMING_SNAKE_CASE  ,     SCREAMING_SNAKE_CASE  ,     SCREAMING_SNAKE_CASE  ,     **SCREAMING_SNAKE_CASE    ).prev_sample
																	__snake_case				=		new_scheduler.step_prk(SCREAMING_SNAKE_CASE  ,     SCREAMING_SNAKE_CASE  ,     SCREAMING_SNAKE_CASE  ,     **SCREAMING_SNAKE_CASE    ).prev_sample

																	assert torch.sum(torch.abs(output - new_output    )    ) < 1e-5, "Scheduler outputs are not identical"

																	__snake_case				=		scheduler.step_plms(SCREAMING_SNAKE_CASE  ,     SCREAMING_SNAKE_CASE  ,     SCREAMING_SNAKE_CASE  ,     **SCREAMING_SNAKE_CASE    ).prev_sample
																	__snake_case				=		new_scheduler.step_plms(SCREAMING_SNAKE_CASE  ,     SCREAMING_SNAKE_CASE  ,     SCREAMING_SNAKE_CASE  ,     **SCREAMING_SNAKE_CASE    ).prev_sample

																	assert torch.sum(torch.abs(output - new_output    )    ) < 1e-5, "Scheduler outputs are not identical"


					def 				SCREAMING_SNAKE_CASE_	(    self						:		Dict    )      ->						List[str]:




											'''simple docstring'''

											pass


					def 				SCREAMING_SNAKE_CASE_	(    self						:		Any  ,     SCREAMING_SNAKE_CASE						:		List[Any]=0  ,     **SCREAMING_SNAKE_CASE						:		str    )      ->						Optional[int]:




											'''simple docstring'''

											__snake_case				=		dict(self.forward_default_kwargs    )
											__snake_case				=		kwargs.pop("num_inference_steps"  ,     SCREAMING_SNAKE_CASE    )
											__snake_case				=		self.dummy_sample
											__snake_case				=		0.1 * sample
											__snake_case				=		[residual + 0.2, residual + 0.15, residual + 0.1, residual + 0.05]

											for scheduler_class in self.scheduler_classes:
																	__snake_case				=		self.get_scheduler_config()
																	__snake_case				=		scheduler_class(**SCREAMING_SNAKE_CASE    )
																	scheduler.set_timesteps(SCREAMING_SNAKE_CASE    )

																	# copy over dummy past residuals (must be after setting timesteps)
																	__snake_case				=		dummy_past_residuals[:]

																	with tempfile.TemporaryDirectory() as tmpdirname:
																							scheduler.save_config(SCREAMING_SNAKE_CASE    )
																							__snake_case				=		scheduler_class.from_pretrained(SCREAMING_SNAKE_CASE    )
																							# copy over dummy past residuals
																							new_scheduler.set_timesteps(SCREAMING_SNAKE_CASE    )

																							# copy over dummy past residual (must be after setting timesteps)
																							__snake_case				=		dummy_past_residuals[:]

																	__snake_case				=		scheduler.step_prk(SCREAMING_SNAKE_CASE  ,     SCREAMING_SNAKE_CASE  ,     SCREAMING_SNAKE_CASE  ,     **SCREAMING_SNAKE_CASE    ).prev_sample
																	__snake_case				=		new_scheduler.step_prk(SCREAMING_SNAKE_CASE  ,     SCREAMING_SNAKE_CASE  ,     SCREAMING_SNAKE_CASE  ,     **SCREAMING_SNAKE_CASE    ).prev_sample

																	assert torch.sum(torch.abs(output - new_output    )    ) < 1e-5, "Scheduler outputs are not identical"

																	__snake_case				=		scheduler.step_plms(SCREAMING_SNAKE_CASE  ,     SCREAMING_SNAKE_CASE  ,     SCREAMING_SNAKE_CASE  ,     **SCREAMING_SNAKE_CASE    ).prev_sample
																	__snake_case				=		new_scheduler.step_plms(SCREAMING_SNAKE_CASE  ,     SCREAMING_SNAKE_CASE  ,     SCREAMING_SNAKE_CASE  ,     **SCREAMING_SNAKE_CASE    ).prev_sample

																	assert torch.sum(torch.abs(output - new_output    )    ) < 1e-5, "Scheduler outputs are not identical"


					def 				SCREAMING_SNAKE_CASE_	(    self						:		Union[str, Any]  ,     **SCREAMING_SNAKE_CASE						:		List[Any]    )      ->						Dict:




											'''simple docstring'''

											__snake_case				=		self.scheduler_classes[0]
											__snake_case				=		self.get_scheduler_config(**SCREAMING_SNAKE_CASE    )
											__snake_case				=		scheduler_class(**SCREAMING_SNAKE_CASE    )

											__snake_case				=		1_0
											__snake_case				=		self.dummy_model()
											__snake_case				=		self.dummy_sample_deter
											scheduler.set_timesteps(SCREAMING_SNAKE_CASE    )

											for i, t in enumerate(scheduler.prk_timesteps    ):
																	__snake_case				=		model(SCREAMING_SNAKE_CASE  ,     SCREAMING_SNAKE_CASE    )
																	__snake_case				=		scheduler.step_prk(SCREAMING_SNAKE_CASE  ,     SCREAMING_SNAKE_CASE  ,     SCREAMING_SNAKE_CASE    ).prev_sample

											for i, t in enumerate(scheduler.plms_timesteps    ):
																	__snake_case				=		model(SCREAMING_SNAKE_CASE  ,     SCREAMING_SNAKE_CASE    )
																	__snake_case				=		scheduler.step_plms(SCREAMING_SNAKE_CASE  ,     SCREAMING_SNAKE_CASE  ,     SCREAMING_SNAKE_CASE    ).prev_sample

											return sample


					def 				SCREAMING_SNAKE_CASE_	(    self						:		Tuple    )      ->						Optional[Any]:




											'''simple docstring'''

											__snake_case				=		dict(self.forward_default_kwargs    )

											__snake_case				=		kwargs.pop("num_inference_steps"  ,     SCREAMING_SNAKE_CASE    )

											for scheduler_class in self.scheduler_classes:
																	__snake_case				=		self.get_scheduler_config()
																	__snake_case				=		scheduler_class(**SCREAMING_SNAKE_CASE    )

																	__snake_case				=		self.dummy_sample
																	__snake_case				=		0.1 * sample

																	if num_inference_steps is not None and hasattr(SCREAMING_SNAKE_CASE  ,     "set_timesteps"    ):
																							scheduler.set_timesteps(SCREAMING_SNAKE_CASE    )
																	elif num_inference_steps is not None and not hasattr(SCREAMING_SNAKE_CASE  ,     "set_timesteps"    ):
																							__snake_case				=		num_inference_steps

																	# copy over dummy past residuals (must be done after set_timesteps)
																	__snake_case				=		[residual + 0.2, residual + 0.15, residual + 0.1, residual + 0.05]
																	__snake_case				=		dummy_past_residuals[:]

																	__snake_case				=		scheduler.step_prk(SCREAMING_SNAKE_CASE  ,     0  ,     SCREAMING_SNAKE_CASE  ,     **SCREAMING_SNAKE_CASE    ).prev_sample
																	__snake_case				=		scheduler.step_prk(SCREAMING_SNAKE_CASE  ,     1  ,     SCREAMING_SNAKE_CASE  ,     **SCREAMING_SNAKE_CASE    ).prev_sample

																	self.assertEqual(output_a.shape  ,     sample.shape    )
																	self.assertEqual(output_a.shape  ,     output_a.shape    )

																	__snake_case				=		scheduler.step_plms(SCREAMING_SNAKE_CASE  ,     0  ,     SCREAMING_SNAKE_CASE  ,     **SCREAMING_SNAKE_CASE    ).prev_sample
																	__snake_case				=		scheduler.step_plms(SCREAMING_SNAKE_CASE  ,     1  ,     SCREAMING_SNAKE_CASE  ,     **SCREAMING_SNAKE_CASE    ).prev_sample

																	self.assertEqual(output_a.shape  ,     sample.shape    )
																	self.assertEqual(output_a.shape  ,     output_a.shape    )


					def 				SCREAMING_SNAKE_CASE_	(    self						:		Any    )      ->						Dict:




											'''simple docstring'''

											for timesteps in [1_0_0, 1_0_0_0]:
																	self.check_over_configs(num_train_timesteps=SCREAMING_SNAKE_CASE    )


					def 				SCREAMING_SNAKE_CASE_	(    self						:		Union[str, Any]    )      ->						Tuple:




											'''simple docstring'''

											for steps_offset in [0, 1]:
																	self.check_over_configs(steps_offset=SCREAMING_SNAKE_CASE    )

											__snake_case				=		self.scheduler_classes[0]
											__snake_case				=		self.get_scheduler_config(steps_offset=1    )
											__snake_case				=		scheduler_class(**SCREAMING_SNAKE_CASE    )
											scheduler.set_timesteps(1_0    )
											assert torch.equal(
											    scheduler.timesteps  ,     torch.LongTensor(
											        [9_0_1, 8_5_1, 8_5_1, 8_0_1, 8_0_1, 7_5_1, 7_5_1, 7_0_1, 7_0_1, 6_5_1, 6_5_1, 6_0_1, 6_0_1, 5_0_1, 4_0_1, 3_0_1, 2_0_1, 1_0_1, 1]    )  ,     )


					def 				SCREAMING_SNAKE_CASE_	(    self						:		Optional[Any]    )      ->						List[Any]:




											'''simple docstring'''

											for beta_start, beta_end in zip([0.0001, 0.001]  ,     [0.002, 0.02]    ):
																	self.check_over_configs(beta_start=SCREAMING_SNAKE_CASE  ,     beta_end=SCREAMING_SNAKE_CASE    )


					def 				SCREAMING_SNAKE_CASE_	(    self						:		int    )      ->						List[Any]:




											'''simple docstring'''

											for schedule in ["linear", "squaredcos_cap_v2"]:
																	self.check_over_configs(beta_schedule=SCREAMING_SNAKE_CASE    )


					def 				SCREAMING_SNAKE_CASE_	(    self						:		Tuple    )      ->						Optional[int]:




											'''simple docstring'''

											for prediction_type in ["epsilon", "v_prediction"]:
																	self.check_over_configs(prediction_type=SCREAMING_SNAKE_CASE    )


					def 				SCREAMING_SNAKE_CASE_	(    self						:		Optional[int]    )      ->						List[Any]:




											'''simple docstring'''

											for t in [1, 5, 1_0]:
																	self.check_over_forward(time_step=SCREAMING_SNAKE_CASE    )


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




											'''simple docstring'''

											for t, num_inference_steps in zip([1, 5, 1_0]  ,     [1_0, 5_0, 1_0_0]    ):
																	self.check_over_forward(num_inference_steps=SCREAMING_SNAKE_CASE    )


					def 				SCREAMING_SNAKE_CASE_	(    self						:		Dict    )      ->						Tuple:




											'''simple docstring'''

											__snake_case				=		2_7

											for scheduler_class in self.scheduler_classes:
																	__snake_case				=		self.dummy_sample
																	__snake_case				=		0.1 * sample

																	__snake_case				=		self.get_scheduler_config()
																	__snake_case				=		scheduler_class(**SCREAMING_SNAKE_CASE    )

																	scheduler.set_timesteps(SCREAMING_SNAKE_CASE    )

																	# before power of 3 fix, would error on first step, so we only need to do two
																	for i, t in enumerate(scheduler.prk_timesteps[:2]    ):
																							__snake_case				=		scheduler.step_prk(SCREAMING_SNAKE_CASE  ,     SCREAMING_SNAKE_CASE  ,     SCREAMING_SNAKE_CASE    ).prev_sample


					def 				SCREAMING_SNAKE_CASE_	(    self						:		Tuple    )      ->						Union[str, Any]:




											'''simple docstring'''

											with self.assertRaises(SCREAMING_SNAKE_CASE    ):
																	__snake_case				=		self.scheduler_classes[0]
																	__snake_case				=		self.get_scheduler_config()
																	__snake_case				=		scheduler_class(**SCREAMING_SNAKE_CASE    )

																	scheduler.step_plms(self.dummy_sample  ,     1  ,     self.dummy_sample    ).prev_sample


					def 				SCREAMING_SNAKE_CASE_	(    self						:		Dict    )      ->						Tuple:




											'''simple docstring'''

											__snake_case				=		self.full_loop()
											__snake_case				=		torch.sum(torch.abs(SCREAMING_SNAKE_CASE    )    )
											__snake_case				=		torch.mean(torch.abs(SCREAMING_SNAKE_CASE    )    )

											assert abs(result_sum.item() - 198.1318    ) < 1e-2
											assert abs(result_mean.item() - 0.2580    ) < 1e-3


					def 				SCREAMING_SNAKE_CASE_	(    self						:		List[str]    )      ->						Union[str, Any]:




											'''simple docstring'''

											__snake_case				=		self.full_loop(prediction_type="v_prediction"    )
											__snake_case				=		torch.sum(torch.abs(SCREAMING_SNAKE_CASE    )    )
											__snake_case				=		torch.mean(torch.abs(SCREAMING_SNAKE_CASE    )    )

											assert abs(result_sum.item() - 67.3986    ) < 1e-2
											assert abs(result_mean.item() - 0.0878    ) < 1e-3


					def 				SCREAMING_SNAKE_CASE_	(    self						:		Union[str, Any]    )      ->						List[Any]:




											'''simple docstring'''

											__snake_case				=		self.full_loop(set_alpha_to_one=SCREAMING_SNAKE_CASE  ,     beta_start=0.01    )
											__snake_case				=		torch.sum(torch.abs(SCREAMING_SNAKE_CASE    )    )
											__snake_case				=		torch.mean(torch.abs(SCREAMING_SNAKE_CASE    )    )

											assert abs(result_sum.item() - 230.0399    ) < 1e-2
											assert abs(result_mean.item() - 0.2995    ) < 1e-3






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




											'''simple docstring'''

											__snake_case				=		self.full_loop(set_alpha_to_one=SCREAMING_SNAKE_CASE  ,     beta_start=0.01    )
											__snake_case				=		torch.sum(torch.abs(SCREAMING_SNAKE_CASE    )    )
											__snake_case				=		torch.mean(torch.abs(SCREAMING_SNAKE_CASE    )    )

											assert abs(result_sum.item() - 186.9482    ) < 1e-2
											assert abs(result_mean.item() - 0.2434    ) < 1e-3









import unittest

import numpy as np

from transformers.testing_utils import require_torch, require_vision
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 PoolFormerImageProcessor






class      UpperCamelCase(	unittest.TestCase ):


					def __init__(    self						:		Tuple  ,     SCREAMING_SNAKE_CASE						:		List[Any]  ,     SCREAMING_SNAKE_CASE						:		Optional[Any]=7  ,     SCREAMING_SNAKE_CASE						:		Dict=3  ,     SCREAMING_SNAKE_CASE						:		Any=3_0  ,     SCREAMING_SNAKE_CASE						:		List[str]=4_0_0  ,     SCREAMING_SNAKE_CASE						:		Any=True  ,     SCREAMING_SNAKE_CASE						:		List[Any]=None  ,     SCREAMING_SNAKE_CASE						:		int=0.9  ,     SCREAMING_SNAKE_CASE						:		Tuple=None  ,     SCREAMING_SNAKE_CASE						:		int=True  ,     SCREAMING_SNAKE_CASE						:		Union[str, Any]=[0.5, 0.5, 0.5]  ,     SCREAMING_SNAKE_CASE						:		Optional[Any]=[0.5, 0.5, 0.5]  ,     )      ->						Union[str, Any]:




											'''simple docstring'''

											__snake_case				=		size if size is not None else {"shortest_edge": 3_0}
											__snake_case				=		crop_size if crop_size is not None else {"height": 3_0, "width": 3_0}
											__snake_case				=		parent
											__snake_case				=		batch_size
											__snake_case				=		num_channels
											__snake_case				=		min_resolution
											__snake_case				=		max_resolution
											__snake_case				=		do_resize_and_center_crop
											__snake_case				=		size
											__snake_case				=		crop_pct
											__snake_case				=		crop_size
											__snake_case				=		do_normalize
											__snake_case				=		image_mean
											__snake_case				=		image_std






					def 				SCREAMING_SNAKE_CASE_	(    self						:		str    )      ->						Any:




											'''simple docstring'''

											return {
											    "size": self.size,
											    "do_resize_and_center_crop": self.do_resize_and_center_crop,
											    "crop_pct": self.crop_pct,
											    "crop_size": self.crop_size,
											    "do_normalize": self.do_normalize,
											    "image_mean": self.image_mean,
											    "image_std": self.image_std,
											}






@require_torch
@require_vision
class      UpperCamelCase(	_a  ,				unittest.TestCase ):
					snake_case_		:					List[str]    					=						PoolFormerImageProcessor if is_vision_available() else None


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




											'''simple docstring'''

											__snake_case				=		PoolFormerImageProcessingTester(self    )


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




											'''simple docstring'''

											return self.image_processor_tester.prepare_image_processor_dict()


					def 				SCREAMING_SNAKE_CASE_	(    self						:		Dict    )      ->						List[str]:




											'''simple docstring'''

											__snake_case				=		self.image_processing_class(**self.image_processor_dict    )
											self.assertTrue(hasattr(SCREAMING_SNAKE_CASE  ,     "do_resize_and_center_crop"    )    )
											self.assertTrue(hasattr(SCREAMING_SNAKE_CASE  ,     "size"    )    )
											self.assertTrue(hasattr(SCREAMING_SNAKE_CASE  ,     "crop_pct"    )    )
											self.assertTrue(hasattr(SCREAMING_SNAKE_CASE  ,     "do_normalize"    )    )
											self.assertTrue(hasattr(SCREAMING_SNAKE_CASE  ,     "image_mean"    )    )
											self.assertTrue(hasattr(SCREAMING_SNAKE_CASE  ,     "image_std"    )    )


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




											'''simple docstring'''

											__snake_case				=		self.image_processing_class.from_dict(self.image_processor_dict    )
											self.assertEqual(image_processor.size  ,     {"shortest_edge": 3_0}    )
											self.assertEqual(image_processor.crop_size  ,     {"height": 3_0, "width": 3_0}    )

											__snake_case				=		self.image_processing_class.from_dict(self.image_processor_dict  ,     size=4_2  ,     crop_size=8_4    )
											self.assertEqual(image_processor.size  ,     {"shortest_edge": 4_2}    )
											self.assertEqual(image_processor.crop_size  ,     {"height": 8_4, "width": 8_4}    )


					def 				SCREAMING_SNAKE_CASE_	(    self						:		Optional[int]    )      ->						List[Any]:




											'''simple docstring'''

											pass


					def 				SCREAMING_SNAKE_CASE_	(    self						:		Optional[Any]    )      ->						Dict:




											'''simple docstring'''

											__snake_case				=		self.image_processing_class(**self.image_processor_dict    )
											# create random PIL images
											__snake_case				=		prepare_image_inputs(self.image_processor_tester  ,     equal_resolution=SCREAMING_SNAKE_CASE    )
											for image in image_inputs:
																	self.assertIsInstance(SCREAMING_SNAKE_CASE  ,     Image.Image    )

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

											self.assertEqual(
											    encoded_images.shape  ,     (
											        1,
											        self.image_processor_tester.num_channels,
											        self.image_processor_tester.crop_size["height"],
											        self.image_processor_tester.crop_size["width"],
											    )  ,     )

											# Test batched
											__snake_case				=		image_processing(SCREAMING_SNAKE_CASE  ,     return_tensors="pt"    ).pixel_values
											self.assertEqual(
											    encoded_images.shape  ,     (
											        self.image_processor_tester.batch_size,
											        self.image_processor_tester.num_channels,
											        self.image_processor_tester.crop_size["height"],
											        self.image_processor_tester.crop_size["width"],
											    )  ,     )


					def 				SCREAMING_SNAKE_CASE_	(    self						:		Optional[Any]    )      ->						Optional[int]:




											'''simple docstring'''

											__snake_case				=		self.image_processing_class(**self.image_processor_dict    )
											# create random numpy tensors
											__snake_case				=		prepare_image_inputs(self.image_processor_tester  ,     equal_resolution=SCREAMING_SNAKE_CASE  ,     numpify=SCREAMING_SNAKE_CASE    )
											for image in image_inputs:
																	self.assertIsInstance(SCREAMING_SNAKE_CASE  ,     np.ndarray    )

											# Test not batched input
											__snake_case				=		image_processing(image_inputs[0]  ,     return_tensors="pt"    ).pixel_values
											self.assertEqual(
											    encoded_images.shape  ,     (
											        1,
											        self.image_processor_tester.num_channels,
											        self.image_processor_tester.crop_size["height"],
											        self.image_processor_tester.crop_size["width"],
											    )  ,     )

											# Test batched
											__snake_case				=		image_processing(SCREAMING_SNAKE_CASE  ,     return_tensors="pt"    ).pixel_values
											self.assertEqual(
											    encoded_images.shape  ,     (
											        self.image_processor_tester.batch_size,
											        self.image_processor_tester.num_channels,
											        self.image_processor_tester.crop_size["height"],
											        self.image_processor_tester.crop_size["width"],
											    )  ,     )






					def 				SCREAMING_SNAKE_CASE_	(    self						:		Optional[int]    )      ->						Union[str, Any]:




											'''simple docstring'''

											__snake_case				=		self.image_processing_class(**self.image_processor_dict    )
											# create random PyTorch tensors
											__snake_case				=		prepare_image_inputs(self.image_processor_tester  ,     equal_resolution=SCREAMING_SNAKE_CASE  ,     torchify=SCREAMING_SNAKE_CASE    )
											for image in image_inputs:
																	self.assertIsInstance(SCREAMING_SNAKE_CASE  ,     torch.Tensor    )

											# Test not batched input
											__snake_case				=		image_processing(image_inputs[0]  ,     return_tensors="pt"    ).pixel_values
											self.assertEqual(
											    encoded_images.shape  ,     (
											        1,
											        self.image_processor_tester.num_channels,
											        self.image_processor_tester.crop_size["height"],
											        self.image_processor_tester.crop_size["width"],
											    )  ,     )

											# Test batched
											__snake_case				=		image_processing(SCREAMING_SNAKE_CASE  ,     return_tensors="pt"    ).pixel_values
											self.assertEqual(
											    encoded_images.shape  ,     (
											        self.image_processor_tester.batch_size,
											        self.image_processor_tester.num_channels,
											        self.image_processor_tester.crop_size["height"],
											        self.image_processor_tester.crop_size["width"],
											    )  ,     )





