
import json
import os
import unittest

from transformers.models.roc_bert.tokenization_roc_bert import (
    VOCAB_FILES_NAMES,
    RoCBertBasicTokenizer,
    RoCBertTokenizer,
    RoCBertWordpieceTokenizer,
    _is_control,
    _is_punctuation,
    _is_whitespace,
)
from transformers.testing_utils import require_tokenizers, slow

from ...test_tokenization_common import TokenizerTesterMixin, filter_non_english





@require_tokenizers
class 				UpperCAmelCase (    __SCREAMING_SNAKE_CASE     ,     unittest.TestCase    ):




	'''simple docstring'''





	snake_case_          =	RoCBertTokenizer
	snake_case_          =	None
	snake_case_          =	False
	snake_case_          =	True
	snake_case_          =	filter_non_english






	def 							UpperCamelCase_    (			self   :					List[Any]					):
					super().setUp()

					__A       =					["[UNK]", "[CLS]", "[SEP]", "[PAD]", "[MASK]", "你", "好", "是", "谁", "a", "b", "c", "d"]
					__A       =					{}
					__A       =					{}
					for i, value in enumerate(A					):
									__A       =					i
									__A       =					i
					__A       =					os.path.join(self.tmpdirname				,VOCAB_FILES_NAMES["vocab_file"]					)
					__A       =					os.path.join(self.tmpdirname				,VOCAB_FILES_NAMES["word_shape_file"]					)
					__A       =					os.path.join(self.tmpdirname				,VOCAB_FILES_NAMES["word_pronunciation_file"]					)
					with open(self.vocab_file				,"w"				,encoding="utf-8"					) as vocab_writer:
									vocab_writer.write("".join([x + "\n" for x in vocab_tokens]					)					)
					with open(self.word_shape_file				,"w"				,encoding="utf-8"					) as word_shape_writer:
									json.dump(A				,A				,ensure_ascii=A					)
					with open(self.word_pronunciation_file				,"w"				,encoding="utf-8"					) as word_pronunciation_writer:
									json.dump(A				,A				,ensure_ascii=A					)






	def 							UpperCamelCase_    (			self   :					Optional[Any]					):
					__A       =					self.tokenizer_class(self.vocab_file				,self.word_shape_file				,self.word_pronunciation_file					)

					__A       =					tokenizer.tokenize("你好[SEP]你是谁"					)
					self.assertListEqual(A				,["你", "好", "[SEP]", "你", "是", "谁"]					)
					self.assertListEqual(tokenizer.convert_tokens_to_ids(A					)				,[5, 6, 2, 5, 7, 8]					)
					self.assertListEqual(tokenizer.convert_tokens_to_shape_ids(A					)				,[5, 6, 2, 5, 7, 8]					)
					self.assertListEqual(tokenizer.convert_tokens_to_pronunciation_ids(A					)				,[5, 6, 2, 5, 7, 8]					)






	def 							UpperCamelCase_    (			self   :					str					):
					__A       =					RoCBertBasicTokenizer()

					self.assertListEqual(tokenizer.tokenize("ah\u535A\u63A8zz"					)				,["ah", "\u535A", "\u63A8", "zz"]					)






	def 							UpperCamelCase_    (			self   :					Optional[int]					):
					__A       =					RoCBertBasicTokenizer(do_lower_case=A					)

					self.assertListEqual(
					    tokenizer.tokenize(" \tHeLLo!how  \n Are yoU?  "					)				,["hello", "!", "how", "are", "you", "?"]					)
					self.assertListEqual(tokenizer.tokenize("H\u00E9llo"					)				,["hello"]					)






	def 							UpperCamelCase_    (			self   :					Union[str, Any]					):
					__A       =					RoCBertBasicTokenizer(do_lower_case=A				,strip_accents=A					)

					self.assertListEqual(
					    tokenizer.tokenize(" \tHäLLo!how  \n Are yoU?  "					)				,["hällo", "!", "how", "are", "you", "?"]					)
					self.assertListEqual(tokenizer.tokenize("H\u00E9llo"					)				,["h\u00E9llo"]					)






	def 							UpperCamelCase_    (			self   :					Optional[int]					):
					__A       =					RoCBertBasicTokenizer(do_lower_case=A				,strip_accents=A					)

					self.assertListEqual(
					    tokenizer.tokenize(" \tHäLLo!how  \n Are yoU?  "					)				,["hallo", "!", "how", "are", "you", "?"]					)
					self.assertListEqual(tokenizer.tokenize("H\u00E9llo"					)				,["hello"]					)






	def 							UpperCamelCase_    (			self   :					int					):
					__A       =					RoCBertBasicTokenizer(do_lower_case=A					)

					self.assertListEqual(
					    tokenizer.tokenize(" \tHäLLo!how  \n Are yoU?  "					)				,["hallo", "!", "how", "are", "you", "?"]					)
					self.assertListEqual(tokenizer.tokenize("H\u00E9llo"					)				,["hello"]					)






	def 							UpperCamelCase_    (			self   :					Union[str, Any]					):
					__A       =					RoCBertBasicTokenizer(do_lower_case=A					)

					self.assertListEqual(
					    tokenizer.tokenize(" \tHeLLo!how  \n Are yoU?  "					)				,["HeLLo", "!", "how", "Are", "yoU", "?"]					)






	def 							UpperCamelCase_    (			self   :					str					):
					__A       =					RoCBertBasicTokenizer(do_lower_case=A				,strip_accents=A					)

					self.assertListEqual(
					    tokenizer.tokenize(" \tHäLLo!how  \n Are yoU?  "					)				,["HäLLo", "!", "how", "Are", "yoU", "?"]					)






	def 							UpperCamelCase_    (			self   :					List[str]					):
					__A       =					RoCBertBasicTokenizer(do_lower_case=A				,strip_accents=A					)

					self.assertListEqual(
					    tokenizer.tokenize(" \tHäLLo!how  \n Are yoU?  "					)				,["HaLLo", "!", "how", "Are", "yoU", "?"]					)






	def 							UpperCamelCase_    (			self   :					Any					):
					__A       =					RoCBertBasicTokenizer(do_lower_case=A				,never_split=["[UNK]"]					)

					self.assertListEqual(
					    tokenizer.tokenize(" \tHeLLo!how  \n Are yoU? [UNK]"					)				,["HeLLo", "!", "how", "Are", "yoU", "?", "[UNK]"]					)






	def 							UpperCamelCase_    (			self   :					Any					):
					__A       =					["[UNK]", "[CLS]", "[SEP]", "want", "##want", "##ed", "wa", "un", "runn", "##ing"]

					__A       =					{}
					for i, token in enumerate(A					):
									__A       =					i
					__A       =					RoCBertWordpieceTokenizer(vocab=A				,unk_token="[UNK]"					)

					self.assertListEqual(tokenizer.tokenize(""					)				,[]					)

					self.assertListEqual(tokenizer.tokenize("unwanted running"					)				,["un", "##want", "##ed", "runn", "##ing"]					)

					self.assertListEqual(tokenizer.tokenize("unwantedX running"					)				,["[UNK]", "runn", "##ing"]					)






	def 							UpperCamelCase_    (			self   :					Union[str, Any]					):
					self.assertTrue(_is_whitespace(" "					)					)
					self.assertTrue(_is_whitespace("\t"					)					)
					self.assertTrue(_is_whitespace("\r"					)					)
					self.assertTrue(_is_whitespace("\n"					)					)
					self.assertTrue(_is_whitespace("\u00A0"					)					)

					self.assertFalse(_is_whitespace("A"					)					)
					self.assertFalse(_is_whitespace("-"					)					)






	def 							UpperCamelCase_    (			self   :					Dict					):
					self.assertTrue(_is_control("\u0005"					)					)

					self.assertFalse(_is_control("A"					)					)
					self.assertFalse(_is_control(" "					)					)
					self.assertFalse(_is_control("\t"					)					)
					self.assertFalse(_is_control("\r"					)					)






	def 							UpperCamelCase_    (			self   :					Optional[Any]					):
					self.assertTrue(_is_punctuation("-"					)					)
					self.assertTrue(_is_punctuation("$"					)					)
					self.assertTrue(_is_punctuation("`"					)					)
					self.assertTrue(_is_punctuation("."					)					)

					self.assertFalse(_is_punctuation("A"					)					)
					self.assertFalse(_is_punctuation(" "					)					)






	def 							UpperCamelCase_    (			self   :					Optional[Any]					):
					__A       =					self.get_tokenizer()

					# Example taken from the issue https://github.com/huggingface/tokenizers/issues/340
					self.assertListEqual([tokenizer.tokenize(A					) for t in ["Test", "\xad", "test"]]				,[["[UNK]"], [], ["[UNK]"]]					)

					if self.test_rust_tokenizer:
									__A       =					self.get_rust_tokenizer()
									self.assertListEqual(
									    [rust_tokenizer.tokenize(A					) for t in ["Test", "\xad", "test"]]				,[["[UNK]"], [], ["[UNK]"]]					)






	def 							UpperCamelCase_    (			self   :					Dict					):
					for tokenizer, pretrained_name, kwargs in self.tokenizers_list:
									with self.subTest(f'''{tokenizer.__class__.__name__} ({pretrained_name})'''					):
													__A       =					self.rust_tokenizer_class.from_pretrained(A				,**A					)

													__A       =					f'''A, naïve {tokenizer_r.mask_token} AllenNLP sentence.'''
													__A       =					tokenizer_r.encode_plus(
													    A				,return_attention_mask=A				,return_token_type_ids=A				,return_offsets_mapping=A				,add_special_tokens=A				,)

													__A       =					tokenizer_r.do_lower_case if hasattr(A				,"do_lower_case"					) else False
													__A       =					(
													    [
													        ((0, 0), tokenizer_r.cls_token),
													        ((0, 1), "A"),
													        ((1, 2), ","),
													        ((3, 5), "na"),
													        ((5, 6), "##ï"),
													        ((6, 8), "##ve"),
													        ((9, 15), tokenizer_r.mask_token),
													        ((16, 21), "Allen"),
													        ((21, 23), "##NL"),
													        ((23, 24), "##P"),
													        ((25, 33), "sentence"),
													        ((33, 34), "."),
													        ((0, 0), tokenizer_r.sep_token),
													    ]
													    if not do_lower_case
													    else [
													        ((0, 0), tokenizer_r.cls_token),
													        ((0, 1), "a"),
													        ((1, 2), ","),
													        ((3, 8), "naive"),
													        ((9, 15), tokenizer_r.mask_token),
													        ((16, 21), "allen"),
													        ((21, 23), "##nl"),
													        ((23, 24), "##p"),
													        ((25, 33), "sentence"),
													        ((33, 34), "."),
													        ((0, 0), tokenizer_r.sep_token),
													    ]
													)

													self.assertEqual(
													    [e[1] for e in expected_results]				,tokenizer_r.convert_ids_to_tokens(tokens["input_ids"]					)					)
													self.assertEqual([e[0] for e in expected_results]				,tokens["offset_mapping"]					)






	def 							UpperCamelCase_    (			self   :					List[str]					):
					__A       =					["的", "人", "有"]
					__A       =					"".join(A					)
					for tokenizer, pretrained_name, kwargs in self.tokenizers_list:
									with self.subTest(f'''{tokenizer.__class__.__name__} ({pretrained_name})'''					):
													__A       =					True
													__A       =					self.tokenizer_class.from_pretrained(A				,**A					)
													__A       =					self.rust_tokenizer_class.from_pretrained(A				,**A					)

													__A       =					tokenizer_p.encode(A				,add_special_tokens=A					)
													__A       =					tokenizer_r.encode(A				,add_special_tokens=A					)

													__A       =					tokenizer_r.convert_ids_to_tokens(A					)
													__A       =					tokenizer_p.convert_ids_to_tokens(A					)

													# it is expected that each Chinese character is not preceded by "##"
													self.assertListEqual(A				,A					)
													self.assertListEqual(A				,A					)

													__A       =					False
													__A       =					self.rust_tokenizer_class.from_pretrained(A				,**A					)
													__A       =					self.tokenizer_class.from_pretrained(A				,**A					)

													__A       =					tokenizer_r.encode(A				,add_special_tokens=A					)
													__A       =					tokenizer_p.encode(A				,add_special_tokens=A					)

													__A       =					tokenizer_r.convert_ids_to_tokens(A					)
													__A       =					tokenizer_p.convert_ids_to_tokens(A					)

													# it is expected that only the first Chinese character is not preceded by "##".
													__A       =					[
													    f'''##{token}''' if idx != 0 else token for idx, token in enumerate(A					)
													]
													self.assertListEqual(A				,A					)
													self.assertListEqual(A				,A					)






	@slow
	def 							UpperCamelCase_    (			self   :					Tuple					):
					__A       =					self.tokenizer_class(self.vocab_file				,self.word_shape_file				,self.word_pronunciation_file					)

					__A       =					tokenizer.encode("你好"				,add_special_tokens=A					)
					__A       =					tokenizer.encode("你是谁"				,add_special_tokens=A					)

					__A       =					tokenizer.build_inputs_with_special_tokens(A					)
					__A       =					tokenizer.build_inputs_with_special_tokens(A				,A					)

					assert encoded_sentence == [1] + text + [2]
					assert encoded_pair == [1] + text + [2] + text_a + [2]







	def 							UpperCamelCase_    (			self   :					Optional[Any]					):
					__A       =					self.get_tokenizers(do_lower_case=A					)
					for tokenizer in tokenizers:
									with self.subTest(f'''{tokenizer.__class__.__name__}'''					):
													__A       =					"你好，你是谁"
													__A       =					tokenizer.tokenize(A					)
													__A       =					tokenizer.convert_tokens_to_ids(A					)
													__A       =					tokenizer.convert_tokens_to_shape_ids(A					)
													__A       =					tokenizer.convert_tokens_to_pronunciation_ids(A					)
													__A       =					tokenizer.prepare_for_model(
													    A				,A				,A				,add_special_tokens=A					)

													__A       =					tokenizer.encode_plus(A				,add_special_tokens=A					)

													self.assertEqual(A				,A					)



import gc
import unittest

import numpy as np
import torch
from transformers import CLIPTextConfig, CLIPTextModel, XLMRobertaTokenizer

from diffusers import AltDiffusionPipeline, AutoencoderKL, DDIMScheduler, PNDMScheduler, UNetaDConditionModel
from diffusers.pipelines.alt_diffusion.modeling_roberta_series import (
    RobertaSeriesConfig,
    RobertaSeriesModelWithTransformation,
)
from diffusers.utils import slow, torch_device
from diffusers.utils.testing_utils import enable_full_determinism, require_torch_gpu

from ..pipeline_params import TEXT_TO_IMAGE_BATCH_PARAMS, TEXT_TO_IMAGE_IMAGE_PARAMS, TEXT_TO_IMAGE_PARAMS
from ..test_pipelines_common import PipelineKarrasSchedulerTesterMixin, PipelineLatentTesterMixin, PipelineTesterMixin


enable_full_determinism()



class        _a		(__magic_name__						,  __magic_name__						,  __magic_name__						,  unittest.TestCase							):


					'''simple docstring'''






					UpperCAmelCase__:  int    				=			AltDiffusionPipeline
					UpperCAmelCase__:  Tuple    				=			TEXT_TO_IMAGE_PARAMS
					UpperCAmelCase__:  List[str]    				=			TEXT_TO_IMAGE_BATCH_PARAMS
					UpperCAmelCase__:  Union[str, Any]    				=			TEXT_TO_IMAGE_IMAGE_PARAMS
					UpperCAmelCase__:  Optional[int]    				=			TEXT_TO_IMAGE_IMAGE_PARAMS






					def     __A     (					self     ):
						torch.manual_seed(0     )
						A__				:       Union[str, Any]	  =						UNetaDConditionModel(
						    block_out_channels=(32, 64)       ,			layers_per_block=2       ,			sample_size=32       ,			in_channels=4       ,			out_channels=4       ,			down_block_types=("""DownBlock2D""", """CrossAttnDownBlock2D""")       ,			up_block_types=("""CrossAttnUpBlock2D""", """UpBlock2D""")       ,			cross_attention_dim=32       ,			)
						A__				:       List[str]	  =						DDIMScheduler(
						    beta_start=0.0_0_0_8_5       ,			beta_end=0.0_1_2       ,			beta_schedule="""scaled_linear"""       ,			clip_sample=A__       ,			set_alpha_to_one=A__       ,			)
						torch.manual_seed(0     )
						A__				:       int	  =						AutoencoderKL(
						    block_out_channels=[32, 64]       ,			in_channels=3       ,			out_channels=3       ,			down_block_types=["""DownEncoderBlock2D""", """DownEncoderBlock2D"""]       ,			up_block_types=["""UpDecoderBlock2D""", """UpDecoderBlock2D"""]       ,			latent_channels=4       ,			)

						# TODO: address the non-deterministic text encoder (fails for save-load tests)
						# torch.manual_seed(0)
						# text_encoder_config = RobertaSeriesConfig(
						#     hidden_size=32,
						#     project_dim=32,
						#     intermediate_size=37,
						#     layer_norm_eps=1e-05,
						#     num_attention_heads=4,
						#     num_hidden_layers=5,
						#     vocab_size=5002,
						# )
						# text_encoder = RobertaSeriesModelWithTransformation(text_encoder_config)

						torch.manual_seed(0     )
						A__				:       int	  =						CLIPTextConfig(
						    bos_token_id=0       ,			eos_token_id=2       ,			hidden_size=32       ,			projection_dim=32       ,			intermediate_size=37       ,			layer_norm_eps=1e-05       ,			num_attention_heads=4       ,			num_hidden_layers=5       ,			pad_token_id=1       ,			vocab_size=5002       ,			)
						A__				:       Tuple	  =						CLIPTextModel(A__     )

						A__				:       Union[str, Any]	  =						XLMRobertaTokenizer.from_pretrained("""hf-internal-testing/tiny-xlm-roberta"""     )
						A__				:       Union[str, Any]	  =						77

						A__				:       Tuple	  =						{
						    """unet""": unet,
						    """scheduler""": scheduler,
						    """vae""": vae,
						    """text_encoder""": text_encoder,
						    """tokenizer""": tokenizer,
						    """safety_checker""": None,
						    """feature_extractor""": None,
						}
						return components






					def     __A     (					self       ,			A__       ,			A__=0     ):
						if str(A__     ).startswith("""mps"""     ):
							A__				:       Dict	  =						torch.manual_seed(A__     )
						else:
							A__				:       str	  =						torch.Generator(device=A__     ).manual_seed(A__     )
						A__				:       int	  =						{
						    """prompt""": """A painting of a squirrel eating a burger""",
						    """generator""": generator,
						    """num_inference_steps""": 2,
						    """guidance_scale""": 6.0,
						    """output_type""": """numpy""",
						}
						return inputs






					def     __A     (					self     ):
						super().test_attention_slicing_forward_pass(expected_max_diff=3e-3     )






					def     __A     (					self     ):
						super().test_inference_batch_single_identical(expected_max_diff=3e-3     )






					def     __A     (					self     ):
						A__				:       Optional[Any]	  =						"""cpu"""  # ensure determinism for the device-dependent torch.Generator

						A__				:       Union[str, Any]	  =						self.get_dummy_components()
						torch.manual_seed(0     )
						A__				:       List[str]	  =						RobertaSeriesConfig(
						    hidden_size=32       ,			project_dim=32       ,			intermediate_size=37       ,			layer_norm_eps=1e-05       ,			num_attention_heads=4       ,			num_hidden_layers=5       ,			vocab_size=5002       ,			)
						# TODO: remove after fixing the non-deterministic text encoder
						A__				:       Tuple	  =						RobertaSeriesModelWithTransformation(A__     )
						A__				:       Optional[int]	  =						text_encoder

						A__				:       Optional[int]	  =						AltDiffusionPipeline(**A__     )
						A__				:       str	  =						alt_pipe.to(A__     )
						alt_pipe.set_progress_bar_config(disable=A__     )

						A__				:       List[str]	  =						self.get_dummy_inputs(A__     )
						A__				:       List[str]	  =						"""A photo of an astronaut"""
						A__				:       Optional[int]	  =						alt_pipe(**A__     )
						A__				:       List[Any]	  =						output.images
						A__				:       int	  =						image[0, -3:, -3:, -1]

						assert image.shape == (1, 64, 64, 3)
						A__				:       Optional[Any]	  =						np.array(
						    [0.5_7_4_8_1_6_2, 0.6_0_4_4_7_1_4_5, 0.4_8_8_2_1_2_1_7, 0.5_0_1_0_0_6_3_6, 0.5_4_3_1_1_8_5, 0.4_5_7_6_3_6_8_3, 0.4_9_6_5_7_6_9_6, 0.4_8_1_3_2_7_3_3, 0.4_7_5_7_3_0_9_3]     )

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






					def     __A     (					self     ):
						A__				:       Dict	  =						"""cpu"""  # ensure determinism for the device-dependent torch.Generator

						A__				:       Union[str, Any]	  =						self.get_dummy_components()
						A__				:       Any	  =						PNDMScheduler(skip_prk_steps=A__     )
						torch.manual_seed(0     )
						A__				:       List[str]	  =						RobertaSeriesConfig(
						    hidden_size=32       ,			project_dim=32       ,			intermediate_size=37       ,			layer_norm_eps=1e-05       ,			num_attention_heads=4       ,			num_hidden_layers=5       ,			vocab_size=5002       ,			)
						# TODO: remove after fixing the non-deterministic text encoder
						A__				:       Optional[Any]	  =						RobertaSeriesModelWithTransformation(A__     )
						A__				:       List[Any]	  =						text_encoder
						A__				:       Optional[Any]	  =						AltDiffusionPipeline(**A__     )
						A__				:       Union[str, Any]	  =						alt_pipe.to(A__     )
						alt_pipe.set_progress_bar_config(disable=A__     )

						A__				:       Optional[Any]	  =						self.get_dummy_inputs(A__     )
						A__				:       Dict	  =						alt_pipe(**A__     )
						A__				:       str	  =						output.images
						A__				:       Optional[int]	  =						image[0, -3:, -3:, -1]

						assert image.shape == (1, 64, 64, 3)
						A__				:       Dict	  =						np.array(
						    [0.5_1_6_0_5_0_9_3, 0.5_7_0_7_2_4_1, 0.4_7_3_6_5_5_0_7, 0.5_0_5_7_8_8_8_6, 0.5_6_3_3_8_7_7, 0.4_6_4_2_5_0_3, 0.5_1_8_2_0_8_1, 0.4_8_7_6_3_4_8_4, 0.4_9_0_8_4_2_3_7]     )

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



@slow
@require_torch_gpu
class        _a		(unittest.TestCase							):


					'''simple docstring'''






					def     __A     (					self     ):
						# clean up the VRAM after each test
						super().tearDown()
						gc.collect()
						torch.cuda.empty_cache()






					def     __A     (					self     ):
						# make sure here that pndm scheduler skips prk
						A__				:       Any	  =						AltDiffusionPipeline.from_pretrained("""BAAI/AltDiffusion"""       ,			safety_checker=A__     )
						A__				:       Union[str, Any]	  =						alt_pipe.to(A__     )
						alt_pipe.set_progress_bar_config(disable=A__     )

						A__				:       int	  =						"""A painting of a squirrel eating a burger"""
						A__				:       Any	  =						torch.manual_seed(0     )
						A__				:       List[Any]	  =						alt_pipe([prompt]       ,			generator=A__       ,			guidance_scale=6.0       ,			num_inference_steps=20       ,			output_type="""np"""     )

						A__				:       List[Any]	  =						output.images

						A__				:       str	  =						image[0, -3:, -3:, -1]

						assert image.shape == (1, 512, 512, 3)
						A__				:       int	  =						np.array([0.1_0_1_0, 0.0_8_0_0, 0.0_7_9_4, 0.0_8_8_5, 0.0_8_4_3, 0.0_7_6_2, 0.0_7_6_9, 0.0_7_2_9, 0.0_5_8_6]     )

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






					def     __A     (					self     ):
						A__				:       Optional[Any]	  =						DDIMScheduler.from_pretrained("""BAAI/AltDiffusion"""       ,			subfolder="""scheduler"""     )

						A__				:       Optional[Any]	  =						AltDiffusionPipeline.from_pretrained("""BAAI/AltDiffusion"""       ,			scheduler=A__       ,			safety_checker=A__     )
						A__				:       Optional[Any]	  =						alt_pipe.to(A__     )
						alt_pipe.set_progress_bar_config(disable=A__     )

						A__				:       Union[str, Any]	  =						"""A painting of a squirrel eating a burger"""
						A__				:       Dict	  =						torch.manual_seed(0     )

						A__				:       List[Any]	  =						alt_pipe([prompt]       ,			generator=A__       ,			num_inference_steps=2       ,			output_type="""numpy"""     )
						A__				:       str	  =						output.images

						A__				:       Union[str, Any]	  =						image[0, -3:, -3:, -1]

						assert image.shape == (1, 512, 512, 3)
						A__				:       List[str]	  =						np.array([0.4_0_1_9, 0.4_0_5_2, 0.3_8_1_0, 0.4_1_1_9, 0.3_9_1_6, 0.3_9_8_2, 0.4_6_5_1, 0.4_1_9_5, 0.5_3_2_3]     )

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



