


"""simple docstring"""


import random
import unittest

from torch.utils.data import BatchSampler, DataLoader, IterableDataset

from accelerate import Accelerator
from accelerate.data_loader import (
    BatchSamplerShard,
    DataLoaderDispatcher,
    DataLoaderShard,
    IterableDatasetShard,
    SkipBatchSampler,
    SkipDataLoader,
    skip_first_batches,
)
class snake_case      (  _UpperCamelCase):







		def __init__(					self      :       Optional[int]    ,   a__      :       str=0.0_1    ,   a__      :       str=10_00		)       ->						int:





						'''simple docstring'''







						_A					  =			p_stop
						_A					  =			max_length







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





						'''simple docstring'''







						_A					  =			0
						_A					  =			False
						while not stop and count < self.max_length:
										yield count
										count += 1
										_A					  =			random.random() < self.p_stop





class snake_case      (  unittest.TestCase):







		def  a_ (					self      :       List[Any]    ,   a__      :       Union[str, Any]    ,   a__      :       Union[str, Any]    ,   a__      :       List[str]=False    ,   a__      :       str=True		)       ->						Union[str, Any]:





						'''simple docstring'''







						_A					  =			[
						    BatchSamplerShard(a__    ,   2    ,   a__    ,   split_batches=a__    ,   even_batches=a__		)
						    for i in range(2		)
						]
						_A					  =			[list(a__		) for batch_sampler_shard in batch_sampler_shards]
						if not split_batches:
										self.assertListEqual([len(a__		) for shard in batch_sampler_shards]    ,   [len(a__		) for e in expected]		)
						self.assertListEqual(a__    ,   a__		)







		def  a_ (					self      :       List[Any]		)       ->						str:





						'''simple docstring'''







						_A					  =			BatchSampler(range(24		)    ,   batch_size=3    ,   drop_last=a__		)
						_A					  =			[
						    [[0, 1, 2], [6, 7, 8], [12, 13, 14], [18, 19, 20]],
						    [[3, 4, 5], [9, 10, 11], [15, 16, 17], [21, 22, 23]],
						]
						self.check_batch_sampler_shards(a__    ,   a__		)

						_A					  =			BatchSampler(range(24		)    ,   batch_size=3    ,   drop_last=a__		)
						# Expected shouldn't change
						self.check_batch_sampler_shards(a__    ,   a__		)

						# Check the shards when the dataset is a round multiple of batch size but not total batch size.
						_A					  =			BatchSampler(range(21		)    ,   batch_size=3    ,   drop_last=a__		)
						_A					  =			[
						    [[0, 1, 2], [6, 7, 8], [12, 13, 14], [18, 19, 20]],
						    [[3, 4, 5], [9, 10, 11], [15, 16, 17], [0, 1, 2]],
						]
						self.check_batch_sampler_shards(a__    ,   a__		)

						_A					  =			BatchSampler(range(21		)    ,   batch_size=3    ,   drop_last=a__		)
						_A					  =			[
						    [[0, 1, 2], [6, 7, 8], [12, 13, 14]],
						    [[3, 4, 5], [9, 10, 11], [15, 16, 17]],
						]
						self.check_batch_sampler_shards(a__    ,   a__		)

						# Check the shards when the dataset is not a round multiple of batch size but has a multiple of
						# num_processes batch.
						_A					  =			BatchSampler(range(22		)    ,   batch_size=3    ,   drop_last=a__		)
						_A					  =			[
						    [[0, 1, 2], [6, 7, 8], [12, 13, 14], [18, 19, 20]],
						    [[3, 4, 5], [9, 10, 11], [15, 16, 17], [21, 0, 1]],
						]
						self.check_batch_sampler_shards(a__    ,   a__		)

						_A					  =			BatchSampler(range(22		)    ,   batch_size=3    ,   drop_last=a__		)
						_A					  =			[
						    [[0, 1, 2], [6, 7, 8], [12, 13, 14]],
						    [[3, 4, 5], [9, 10, 11], [15, 16, 17]],
						]
						self.check_batch_sampler_shards(a__    ,   a__		)

						# Check the shards when the dataset is not a round multiple of batch size but and has not a multiple of
						# num_processes batch.
						_A					  =			BatchSampler(range(20		)    ,   batch_size=3    ,   drop_last=a__		)
						_A					  =			[
						    [[0, 1, 2], [6, 7, 8], [12, 13, 14], [18, 19, 0]],
						    [[3, 4, 5], [9, 10, 11], [15, 16, 17], [1, 2, 3]],
						]
						self.check_batch_sampler_shards(a__    ,   a__		)

						_A					  =			BatchSampler(range(20		)    ,   batch_size=3    ,   drop_last=a__		)
						_A					  =			[
						    [[0, 1, 2], [6, 7, 8], [12, 13, 14]],
						    [[3, 4, 5], [9, 10, 11], [15, 16, 17]],
						]
						self.check_batch_sampler_shards(a__    ,   a__		)

						# Check the shards when the dataset is very small.
						_A					  =			BatchSampler(range(2		)    ,   batch_size=3    ,   drop_last=a__		)
						_A					  =			[[[0, 1, 0]], [[1, 0, 1]]]
						self.check_batch_sampler_shards(a__    ,   a__		)

						_A					  =			BatchSampler(range(2		)    ,   batch_size=3    ,   drop_last=a__		)
						_A					  =			[[], []]
						self.check_batch_sampler_shards(a__    ,   a__		)







		def  a_ (					self      :       int		)       ->						int:





						'''simple docstring'''







						_A					  =			BatchSampler(range(24		)    ,   batch_size=4    ,   drop_last=a__		)
						_A					  =			[
						    [[0, 1], [4, 5], [8, 9], [12, 13], [16, 17], [20, 21]],
						    [[2, 3], [6, 7], [10, 11], [14, 15], [18, 19], [22, 23]],
						]
						self.check_batch_sampler_shards(a__    ,   a__    ,   split_batches=a__		)

						_A					  =			BatchSampler(range(24		)    ,   batch_size=4    ,   drop_last=a__		)
						# Expected shouldn't change
						self.check_batch_sampler_shards(a__    ,   a__    ,   split_batches=a__		)

						# Check the shards when the dataset is not a round multiple of batch size.
						_A					  =			BatchSampler(range(22		)    ,   batch_size=4    ,   drop_last=a__		)
						_A					  =			[
						    [[0, 1], [4, 5], [8, 9], [12, 13], [16, 17], [20, 21]],
						    [[2, 3], [6, 7], [10, 11], [14, 15], [18, 19], [0, 1]],
						]
						self.check_batch_sampler_shards(a__    ,   a__    ,   split_batches=a__		)

						_A					  =			BatchSampler(range(22		)    ,   batch_size=4    ,   drop_last=a__		)
						_A					  =			[
						    [[0, 1], [4, 5], [8, 9], [12, 13], [16, 17]],
						    [[2, 3], [6, 7], [10, 11], [14, 15], [18, 19]],
						]
						self.check_batch_sampler_shards(a__    ,   a__    ,   split_batches=a__		)

						# Check the shards when the dataset is not a round multiple of batch size or num_processes.
						_A					  =			BatchSampler(range(21		)    ,   batch_size=4    ,   drop_last=a__		)
						_A					  =			[
						    [[0, 1], [4, 5], [8, 9], [12, 13], [16, 17], [20, 0]],
						    [[2, 3], [6, 7], [10, 11], [14, 15], [18, 19], [1, 2]],
						]
						self.check_batch_sampler_shards(a__    ,   a__    ,   split_batches=a__		)

						_A					  =			BatchSampler(range(21		)    ,   batch_size=4    ,   drop_last=a__		)
						_A					  =			[
						    [[0, 1], [4, 5], [8, 9], [12, 13], [16, 17]],
						    [[2, 3], [6, 7], [10, 11], [14, 15], [18, 19]],
						]
						self.check_batch_sampler_shards(a__    ,   a__    ,   split_batches=a__		)

						# Check the shards when the dataset is very small.
						_A					  =			BatchSampler(range(2		)    ,   batch_size=4    ,   drop_last=a__		)
						_A					  =			[[[0, 1]], [[0, 1]]]
						self.check_batch_sampler_shards(a__    ,   a__    ,   split_batches=a__		)

						_A					  =			BatchSampler(range(2		)    ,   batch_size=4    ,   drop_last=a__		)
						_A					  =			[[], []]
						self.check_batch_sampler_shards(a__    ,   a__    ,   split_batches=a__		)







		def  a_ (					self      :       List[str]		)       ->						List[str]:





						'''simple docstring'''







						_A					  =			BatchSampler(range(24		)    ,   batch_size=3    ,   drop_last=a__		)
						_A					  =			[
						    [[0, 1, 2], [6, 7, 8], [12, 13, 14], [18, 19, 20]],
						    [[3, 4, 5], [9, 10, 11], [15, 16, 17], [21, 22, 23]],
						]
						self.check_batch_sampler_shards(a__    ,   a__    ,   even_batches=a__		)

						_A					  =			BatchSampler(range(24		)    ,   batch_size=3    ,   drop_last=a__		)
						# Expected shouldn't change
						self.check_batch_sampler_shards(a__    ,   a__    ,   even_batches=a__		)

						# Check the shards when the dataset is a round multiple of batch size but not total batch size.
						_A					  =			BatchSampler(range(21		)    ,   batch_size=3    ,   drop_last=a__		)
						_A					  =			[
						    [[0, 1, 2], [6, 7, 8], [12, 13, 14], [18, 19, 20]],
						    [[3, 4, 5], [9, 10, 11], [15, 16, 17]],
						]
						self.check_batch_sampler_shards(a__    ,   a__    ,   even_batches=a__		)

						_A					  =			BatchSampler(range(21		)    ,   batch_size=3    ,   drop_last=a__		)
						_A					  =			[
						    [[0, 1, 2], [6, 7, 8], [12, 13, 14]],
						    [[3, 4, 5], [9, 10, 11], [15, 16, 17]],
						]
						self.check_batch_sampler_shards(a__    ,   a__    ,   even_batches=a__		)

						# Check the shards when the dataset is not a round multiple of batch size but has a multiple of
						# num_processes batch.
						_A					  =			BatchSampler(range(22		)    ,   batch_size=3    ,   drop_last=a__		)
						_A					  =			[
						    [[0, 1, 2], [6, 7, 8], [12, 13, 14], [18, 19, 20]],
						    [[3, 4, 5], [9, 10, 11], [15, 16, 17], [21]],
						]
						self.check_batch_sampler_shards(a__    ,   a__    ,   even_batches=a__		)

						_A					  =			BatchSampler(range(22		)    ,   batch_size=3    ,   drop_last=a__		)
						_A					  =			[
						    [[0, 1, 2], [6, 7, 8], [12, 13, 14]],
						    [[3, 4, 5], [9, 10, 11], [15, 16, 17]],
						]
						self.check_batch_sampler_shards(a__    ,   a__    ,   even_batches=a__		)

						# Check the shards when the dataset is not a round multiple of batch size but and has not a multiple of
						# num_processes batch.
						_A					  =			BatchSampler(range(20		)    ,   batch_size=3    ,   drop_last=a__		)
						_A					  =			[
						    [[0, 1, 2], [6, 7, 8], [12, 13, 14], [18, 19]],
						    [[3, 4, 5], [9, 10, 11], [15, 16, 17]],
						]
						self.check_batch_sampler_shards(a__    ,   a__    ,   even_batches=a__		)

						_A					  =			BatchSampler(range(20		)    ,   batch_size=3    ,   drop_last=a__		)
						_A					  =			[
						    [[0, 1, 2], [6, 7, 8], [12, 13, 14]],
						    [[3, 4, 5], [9, 10, 11], [15, 16, 17]],
						]
						self.check_batch_sampler_shards(a__    ,   a__    ,   even_batches=a__		)

						# Check the shards when the dataset is very small.
						_A					  =			BatchSampler(range(2		)    ,   batch_size=3    ,   drop_last=a__		)
						_A					  =			[[[0, 1]], []]
						self.check_batch_sampler_shards(a__    ,   a__    ,   even_batches=a__		)

						_A					  =			BatchSampler(range(2		)    ,   batch_size=3    ,   drop_last=a__		)
						_A					  =			[[], []]
						self.check_batch_sampler_shards(a__    ,   a__    ,   even_batches=a__		)







		def  a_ (					self      :       List[str]		)       ->						str:





						'''simple docstring'''







						_A					  =			BatchSampler(range(24		)    ,   batch_size=4    ,   drop_last=a__		)
						_A					  =			[
						    [[0, 1], [4, 5], [8, 9], [12, 13], [16, 17], [20, 21]],
						    [[2, 3], [6, 7], [10, 11], [14, 15], [18, 19], [22, 23]],
						]
						self.check_batch_sampler_shards(a__    ,   a__    ,   split_batches=a__    ,   even_batches=a__		)

						_A					  =			BatchSampler(range(24		)    ,   batch_size=4    ,   drop_last=a__		)
						# Expected shouldn't change
						self.check_batch_sampler_shards(a__    ,   a__    ,   split_batches=a__    ,   even_batches=a__		)

						# Check the shards when the dataset is not a round multiple of batch size.
						_A					  =			BatchSampler(range(22		)    ,   batch_size=4    ,   drop_last=a__		)
						_A					  =			[
						    [[0, 1], [4, 5], [8, 9], [12, 13], [16, 17], [20, 21]],
						    [[2, 3], [6, 7], [10, 11], [14, 15], [18, 19]],
						]
						self.check_batch_sampler_shards(a__    ,   a__    ,   split_batches=a__    ,   even_batches=a__		)

						_A					  =			BatchSampler(range(22		)    ,   batch_size=4    ,   drop_last=a__		)
						_A					  =			[
						    [[0, 1], [4, 5], [8, 9], [12, 13], [16, 17]],
						    [[2, 3], [6, 7], [10, 11], [14, 15], [18, 19]],
						]
						self.check_batch_sampler_shards(a__    ,   a__    ,   split_batches=a__    ,   even_batches=a__		)

						# Check the shards when the dataset is not a round multiple of batch size or num_processes.
						_A					  =			BatchSampler(range(21		)    ,   batch_size=4    ,   drop_last=a__		)
						_A					  =			[
						    [[0, 1], [4, 5], [8, 9], [12, 13], [16, 17], [20]],
						    [[2, 3], [6, 7], [10, 11], [14, 15], [18, 19]],
						]
						self.check_batch_sampler_shards(a__    ,   a__    ,   split_batches=a__    ,   even_batches=a__		)

						_A					  =			BatchSampler(range(21		)    ,   batch_size=4    ,   drop_last=a__		)
						_A					  =			[
						    [[0, 1], [4, 5], [8, 9], [12, 13], [16, 17]],
						    [[2, 3], [6, 7], [10, 11], [14, 15], [18, 19]],
						]
						self.check_batch_sampler_shards(a__    ,   a__    ,   split_batches=a__    ,   even_batches=a__		)

						# Check the shards when the dataset is very small.
						_A					  =			BatchSampler(range(2		)    ,   batch_size=4    ,   drop_last=a__		)
						_A					  =			[[[0, 1]], []]
						self.check_batch_sampler_shards(a__    ,   a__    ,   split_batches=a__    ,   even_batches=a__		)

						_A					  =			BatchSampler(range(2		)    ,   batch_size=4    ,   drop_last=a__		)
						_A					  =			[[], []]
						self.check_batch_sampler_shards(a__    ,   a__    ,   split_batches=a__    ,   even_batches=a__		)







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





						'''simple docstring'''







						_A					  =			[[0, 1, 2], [3, 4], [5, 6, 7, 8], [9, 10, 11], [12, 13]]
						_A					  =			[BatchSamplerShard(a__    ,   2    ,   a__    ,   even_batches=a__		) for i in range(2		)]

						self.assertEqual(len(batch_sampler_shards[0]		)    ,   3		)
						self.assertEqual(len(batch_sampler_shards[1]		)    ,   2		)

						self.assertListEqual(list(batch_sampler_shards[0]		)    ,   [[0, 1, 2], [5, 6, 7, 8], [12, 13]]		)
						self.assertListEqual(list(batch_sampler_shards[1]		)    ,   [[3, 4], [9, 10, 11]]		)







		def  a_ (					self      :       Optional[int]    ,   a__      :       Optional[int]    ,   a__      :       Tuple    ,   a__      :       Optional[int]    ,   a__      :       Union[str, Any]=False    ,   a__      :       int=2    ,   a__      :       List[Any]=False		)       ->						str:





						'''simple docstring'''







						random.seed(a__		)
						_A					  =			list(a__		)

						_A					  =			[
						    IterableDatasetShard(
						        a__    ,   batch_size=a__    ,   drop_last=a__    ,   num_processes=a__    ,   process_index=a__    ,   split_batches=a__    ,   )
						    for i in range(a__		)
						]
						_A					  =			[]
						for iterable_dataset_shard in iterable_dataset_shards:
										# Since our random iterable dataset will be... random... we need to use a seed to get reproducible results.
										random.seed(a__		)
										iterable_dataset_lists.append(list(a__		)		)

						_A					  =			batch_size // num_processes if split_batches else batch_size
						# All iterable dataset shard should have the same length, a round multiple of shard_batch_size
						_A					  =			iterable_dataset_lists[0]
						for l in iterable_dataset_lists[1:]:
										self.assertEqual(len(a__		)    ,   len(a__		)		)
										self.assertTrue(len(a__		) % shard_batch_size == 0		)

						_A					  =			[]
						for idx in range(0    ,   len(a__		)    ,   a__		):
										for l in iterable_dataset_lists:
														observed += l[idx : idx + shard_batch_size]

						if not drop_last:
										while len(a__		) < len(a__		):
														reference += reference
						self.assertListEqual(a__    ,   reference[: len(a__		)]		)







		def  a_ (					self      :       List[str]		)       ->						List[Any]:





						'''simple docstring'''







						_A					  =			42
						_A					  =			RandomIterableDataset()

						self.check_iterable_dataset_shards(a__    ,   a__    ,   batch_size=4    ,   drop_last=a__    ,   split_batches=a__		)
						self.check_iterable_dataset_shards(a__    ,   a__    ,   batch_size=4    ,   drop_last=a__    ,   split_batches=a__		)
						self.check_iterable_dataset_shards(a__    ,   a__    ,   batch_size=4    ,   drop_last=a__    ,   split_batches=a__		)
						self.check_iterable_dataset_shards(a__    ,   a__    ,   batch_size=4    ,   drop_last=a__    ,   split_batches=a__		)

						# Edge case with a very small dataset
						_A					  =			RandomIterableDataset(max_length=2		)

						self.check_iterable_dataset_shards(a__    ,   a__    ,   batch_size=4    ,   drop_last=a__    ,   split_batches=a__		)
						self.check_iterable_dataset_shards(a__    ,   a__    ,   batch_size=4    ,   drop_last=a__    ,   split_batches=a__		)
						self.check_iterable_dataset_shards(a__    ,   a__    ,   batch_size=4    ,   drop_last=a__    ,   split_batches=a__		)
						self.check_iterable_dataset_shards(a__    ,   a__    ,   batch_size=4    ,   drop_last=a__    ,   split_batches=a__		)







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





						'''simple docstring'''







						_A					  =			BatchSampler(range(16		)    ,   batch_size=4    ,   drop_last=a__		)
						_A					  =			SkipBatchSampler(a__    ,   2		)
						self.assertListEqual(list(a__		)    ,   [[8, 9, 10, 11], [12, 13, 14, 15]]		)







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





						'''simple docstring'''







						_A					  =			SkipDataLoader(list(range(16		)		)    ,   batch_size=4    ,   skip_batches=2		)
						self.assertListEqual([t.tolist() for t in dataloader]    ,   [[8, 9, 10, 11], [12, 13, 14, 15]]		)







		def  a_ (					self      :       int		)       ->						Optional[int]:





						'''simple docstring'''







						_A					  =			DataLoader(list(range(16		)		)    ,   batch_size=4		)
						_A					  =			skip_first_batches(a__    ,   num_batches=2		)
						self.assertListEqual([t.tolist() for t in new_dataloader]    ,   [[8, 9, 10, 11], [12, 13, 14, 15]]		)







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





						'''simple docstring'''







						_A					  =			DataLoaderShard(list(range(16		)		)    ,   batch_size=4		)
						for idx, _ in enumerate(a__		):
										self.assertEqual(dataloader.end_of_dataloader    ,   idx == 3		)

						# Test it also works on the second iteration
						for idx, _ in enumerate(a__		):
										self.assertEqual(dataloader.end_of_dataloader    ,   idx == 3		)







		def  a_ (					self      :       int		)       ->						int:





						'''simple docstring'''







						Accelerator()
						_A					  =			DataLoaderDispatcher(range(16		)    ,   batch_size=4		)
						for idx, _ in enumerate(a__		):
										self.assertEqual(dataloader.end_of_dataloader    ,   idx == 3		)

						# Test it also works on the second iteration
						for idx, _ in enumerate(a__		):
										self.assertEqual(dataloader.end_of_dataloader    ,   idx == 3		)



"""simple docstring"""


import gc
import tempfile
import unittest

import numpy as np
import torch

from diffusers import VersatileDiffusionPipeline
from diffusers.utils.testing_utils import load_image, nightly, require_torch_gpu, torch_device


a_       							=    False
class snake_case      (  unittest.TestCase):
		pass





@nightly
@require_torch_gpu
class snake_case      (  unittest.TestCase):







		def  a_ (					self      :       Optional[int]		)       ->						str:





						'''simple docstring'''







						super().tearDown()
						gc.collect()
						torch.cuda.empty_cache()







		def  a_ (					self      :       Tuple		)       ->						Any:





						'''simple docstring'''







						_A					  =			VersatileDiffusionPipeline.from_pretrained("shi-labs/versatile-diffusion"    ,   torch_dtype=torch.floataa		)
						pipe.to(a__		)
						pipe.set_progress_bar_config(disable=a__		)

						_A					  =			load_image(
						    "https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/versatile_diffusion/benz.jpg"		)

						_A					  =			torch.manual_seed(0		)
						_A					  =			pipe.dual_guided(
						    prompt="first prompt"    ,   image=a__    ,   text_to_image_strength=0.7_5    ,   generator=a__    ,   guidance_scale=7.5    ,   num_inference_steps=2    ,   output_type="numpy"    ,   ).images

						with tempfile.TemporaryDirectory() as tmpdirname:
										pipe.save_pretrained(a__		)
										_A					  =			VersatileDiffusionPipeline.from_pretrained(a__    ,   torch_dtype=torch.floataa		)
						pipe.to(a__		)
						pipe.set_progress_bar_config(disable=a__		)

						_A					  =			generator.manual_seed(0		)
						_A					  =			pipe.dual_guided(
						    prompt="first prompt"    ,   image=a__    ,   text_to_image_strength=0.7_5    ,   generator=a__    ,   guidance_scale=7.5    ,   num_inference_steps=2    ,   output_type="numpy"    ,   ).images

						assert np.abs(image - new_image		).sum() < 1E-5, "Models don't have the same forward pass"







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





						'''simple docstring'''







						_A					  =			VersatileDiffusionPipeline.from_pretrained("shi-labs/versatile-diffusion"    ,   torch_dtype=torch.floataa		)
						pipe.to(a__		)
						pipe.set_progress_bar_config(disable=a__		)

						_A					  =			"cyberpunk 2077"
						_A					  =			load_image(
						    "https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/versatile_diffusion/benz.jpg"		)
						_A					  =			torch.manual_seed(0		)
						_A					  =			pipe.dual_guided(
						    prompt=a__    ,   image=a__    ,   text_to_image_strength=0.7_5    ,   generator=a__    ,   guidance_scale=7.5    ,   num_inference_steps=50    ,   output_type="numpy"    ,   ).images

						_A					  =			image[0, 2_53:2_56, 2_53:2_56, -1]

						assert image.shape == (1, 5_12, 5_12, 3)
						_A					  =			np.array([0.1_4_4_8, 0.1_6_1_9, 0.1_7_4_1, 0.1_0_8_6, 0.1_1_4_7, 0.1_1_2_8, 0.1_1_9_9, 0.1_1_6_5, 0.1_0_0_1]		)

						assert np.abs(image_slice.flatten() - expected_slice		).max() < 1E-1

						_A					  =			"A painting of a squirrel eating a burger "
						_A					  =			torch.manual_seed(0		)
						_A					  =			pipe.text_to_image(
						    prompt=a__    ,   generator=a__    ,   guidance_scale=7.5    ,   num_inference_steps=50    ,   output_type="numpy"		).images

						_A					  =			image[0, 2_53:2_56, 2_53:2_56, -1]

						assert image.shape == (1, 5_12, 5_12, 3)
						_A					  =			np.array([0.3_3_6_7, 0.3_1_6_9, 0.2_6_5_6, 0.3_8_7_0, 0.4_7_9_0, 0.3_7_9_6, 0.4_0_0_9, 0.4_8_7_8, 0.4_7_7_8]		)

						assert np.abs(image_slice.flatten() - expected_slice		).max() < 1E-1

						_A					  =			pipe.image_variation(a__    ,   generator=a__    ,   output_type="numpy"		).images

						_A					  =			image[0, 2_53:2_56, 2_53:2_56, -1]

						assert image.shape == (1, 5_12, 5_12, 3)
						_A					  =			np.array([0.3_0_7_6, 0.3_1_2_3, 0.3_2_8_4, 0.3_7_8_2, 0.3_7_7_0, 0.3_8_9_4, 0.4_2_9_7, 0.4_3_3_1, 0.4_4_5_6]		)

						assert np.abs(image_slice.flatten() - expected_slice		).max() < 1E-1