



from math import sqrt



def    snake_case_				(    _SCREAMING_SNAKE_CASE   ):
	assert isinstance(_SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   ) and (
	    number >= 0
	), "'number' must been an int and positive"

	__lowercase		       =			True

	# 0 and 1 are none primes.
	if number <= 1:
		__lowercase		       =			False

	for divisor in range(2  ,	int(round(sqrt(_SCREAMING_SNAKE_CASE   )   )   ) + 1   ):
		# if 'number' divisible by 'divisor' then sets 'status'
		# of false and break up the loop.
		if number % divisor == 0:
			__lowercase		       =			False
			break

    # precondition
	assert isinstance(_SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   ), "'status' must been from type bool"

	return status



def    snake_case_				(    _SCREAMING_SNAKE_CASE   ):
	assert isinstance(_SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   ) and (n > 2), "'N' must been an int and > 2"

	# beginList: contains all natural numbers from 2 up to N
	__lowercase		       =			list(range(2  ,	n + 1   )   )

	__lowercase		       =			[]  # this list will be returns.

	# actual sieve of erathostenes
	for i in range(len(_SCREAMING_SNAKE_CASE   )   ):
		for j in range(i + 1  ,	len(_SCREAMING_SNAKE_CASE   )   ):
			if (begin_list[i] != 0) and (begin_list[j] % begin_list[i] == 0):
				__lowercase		       =			0

    # filters actual prime numbers.
	__lowercase		       =			[x for x in begin_list if x != 0]

	# precondition
	assert isinstance(_SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   ), "'ans' must been from type list"

	return ans



def    snake_case_				(    _SCREAMING_SNAKE_CASE   ):
	assert isinstance(_SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   ) and (n > 2), "'N' must been an int and > 2"

	__lowercase		       =			[]

	# iterates over all numbers between 2 up to N+1
	# if a number is prime then appends to list 'ans'
	for number in range(2  ,	n + 1   ):
		if is_prime(_SCREAMING_SNAKE_CASE   ):
			ans.append(_SCREAMING_SNAKE_CASE   )

    # precondition
	assert isinstance(_SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   ), "'ans' must been from type list"

	return ans



def    snake_case_				(    _SCREAMING_SNAKE_CASE   ):
	assert isinstance(_SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   ) and number >= 0, "'number' must been an int and >= 0"

	__lowercase		       =			[]  # this list will be returns of the function.

	# potential prime number factors.

	__lowercase		       =			2

	__lowercase		       =			number

	if number == 0 or number == 1:
		ans.append(_SCREAMING_SNAKE_CASE   )

	# if 'number' not prime then builds the prime factorization of 'number'
	elif not is_prime(_SCREAMING_SNAKE_CASE   ):
		while quotient != 1:
			if is_prime(_SCREAMING_SNAKE_CASE   ) and (quotient % factor == 0):
				ans.append(_SCREAMING_SNAKE_CASE   )
				quotient /= factor
			else:
				factor += 1

	else:
		ans.append(_SCREAMING_SNAKE_CASE   )

	# precondition
	assert isinstance(_SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   ), "'ans' must been from type list"

	return ans



def    snake_case_				(    _SCREAMING_SNAKE_CASE   ):
	assert isinstance(_SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   ) and (
	    number >= 0
	), "'number' bust been an int and >= 0"

	__lowercase		       =			0

	# prime factorization of 'number'
	__lowercase		       =			prime_factorization(_SCREAMING_SNAKE_CASE   )

	__lowercase		       =			max(_SCREAMING_SNAKE_CASE   )

	# precondition
	assert isinstance(_SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   ), "'ans' must been from type int"

	return ans



def    snake_case_				(    _SCREAMING_SNAKE_CASE   ):
	assert isinstance(_SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   ) and (
	    number >= 0
	), "'number' bust been an int and >= 0"

	__lowercase		       =			0

	# prime factorization of 'number'
	__lowercase		       =			prime_factorization(_SCREAMING_SNAKE_CASE   )

	__lowercase		       =			min(_SCREAMING_SNAKE_CASE   )

	# precondition
	assert isinstance(_SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   ), "'ans' must been from type int"

	return ans



def    snake_case_				(    _SCREAMING_SNAKE_CASE   ):
	assert isinstance(_SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   ), "'number' must been an int"
	assert isinstance(number % 2 == 0  ,	_SCREAMING_SNAKE_CASE   ), "compare bust been from type bool"

	return number % 2 == 0



def    snake_case_				(    _SCREAMING_SNAKE_CASE   ):
	assert isinstance(_SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   ), "'number' must been an int"
	assert isinstance(number % 2 != 0  ,	_SCREAMING_SNAKE_CASE   ), "compare bust been from type bool"

	return number % 2 != 0



def    snake_case_				(    _SCREAMING_SNAKE_CASE   ):
	assert (
	    isinstance(_SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   ) and (number > 2) and is_even(_SCREAMING_SNAKE_CASE   )
	), "'number' must been an int, even and > 2"

	__lowercase		       =			[]  # this list will returned

	# creates a list of prime numbers between 2 up to 'number'
	__lowercase		       =			get_prime_numbers(_SCREAMING_SNAKE_CASE   )
	__lowercase		       =			len(_SCREAMING_SNAKE_CASE   )

	# run variable for while-loops.
	__lowercase		       =			0
	__lowercase		       =			None

	# exit variable. for break up the loops
	__lowercase		       =			True

	while i < len_pn and loop:
		__lowercase		       =			i + 1

		while j < len_pn and loop:
			if prime_numbers[i] + prime_numbers[j] == number:
				__lowercase		       =			False
				ans.append(prime_numbers[i]   )
				ans.append(prime_numbers[j]   )

			j += 1

		i += 1

	# precondition
	assert (
	    isinstance(_SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   )
	    and (len(_SCREAMING_SNAKE_CASE   ) == 2)
	    and (ans[0] + ans[1] == number)
	    and is_prime(ans[0]   )
	    and is_prime(ans[1]   )
	), "'ans' must contains two primes. And sum of elements must been eq 'number'"

	return ans



def    snake_case_				(    _SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   ):
	assert (
	    isinstance(_SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   )
	    and isinstance(_SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   )
	    and (numbera >= 0)
	    and (numbera >= 0)
	), "'number1' and 'number2' must been positive integer."

	__lowercase		       =			0

	while numbera != 0:
		__lowercase		       =			numbera % numbera
		__lowercase		       =			numbera
		__lowercase		       =			rest

	# precondition
	assert isinstance(_SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   ) and (
	    numbera >= 0
	), "'number' must been from type int and positive"

	return numbera



def    snake_case_				(    _SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   ):
	assert (
	    isinstance(_SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   )
	    and isinstance(_SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   )
	    and (numbera >= 1)
	    and (numbera >= 1)
	), "'number1' and 'number2' must been positive integer."

	__lowercase		       =			1  # actual answer that will be return.

	# for kgV (x,1)
	if numbera > 1 and numbera > 1:
		# builds the prime factorization of 'number1' and 'number2'
		__lowercase		       =			prime_factorization(_SCREAMING_SNAKE_CASE   )
		__lowercase		       =			prime_factorization(_SCREAMING_SNAKE_CASE   )

	elif numbera == 1 or numbera == 1:
		__lowercase		       =			[]
		__lowercase		       =			[]
		__lowercase		       =			max(_SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   )

	__lowercase		       =			0
	__lowercase		       =			0

	__lowercase		       =			[]  # captured numbers int both 'primeFac1' and 'primeFac2'

	# iterates through primeFac1
	for n in prime_fac_a:
		if n not in done:
			if n in prime_fac_a:
				__lowercase		       =			prime_fac_a.count(_SCREAMING_SNAKE_CASE   )
				__lowercase		       =			prime_fac_a.count(_SCREAMING_SNAKE_CASE   )

				for _ in range(max(_SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   )   ):
					ans *= n

			else:
				__lowercase		       =			prime_fac_a.count(_SCREAMING_SNAKE_CASE   )

				for _ in range(_SCREAMING_SNAKE_CASE   ):
					ans *= n

			done.append(_SCREAMING_SNAKE_CASE   )

    # iterates through primeFac2
	for n in prime_fac_a:
		if n not in done:
			__lowercase		       =			prime_fac_a.count(_SCREAMING_SNAKE_CASE   )

			for _ in range(_SCREAMING_SNAKE_CASE   ):
				ans *= n

			done.append(_SCREAMING_SNAKE_CASE   )

    # precondition
	assert isinstance(_SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   ) and (
	    ans >= 0
	), "'ans' must been from type int and positive"

	return ans



def    snake_case_				(    _SCREAMING_SNAKE_CASE   ):
	assert isinstance(_SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   ) and (n >= 0), "'number' must been a positive int"

	__lowercase		       =			0
	__lowercase		       =			2  # this variable holds the answer

	while index < n:
		index += 1

		ans += 1  # counts to the next number

		# if ans not prime then
		# runs to the next prime number.
		while not is_prime(_SCREAMING_SNAKE_CASE   ):
			ans += 1

    # precondition
	assert isinstance(_SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   ) and is_prime(
	    _SCREAMING_SNAKE_CASE   ), "'ans' must been a prime number and from type int"

	return ans



def    snake_case_				(    _SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   ):
	assert (
	    is_prime(_SCREAMING_SNAKE_CASE   ) and is_prime(_SCREAMING_SNAKE_CASE   ) and (p_number_a < p_number_a)
	), "The arguments must been prime numbers and 'pNumber1' < 'pNumber2'"

	__lowercase		       =			p_number_a + 1  # jump to the next number

	__lowercase		       =			[]  # this list will be returns.

	# if number is not prime then
	# fetch the next prime number.
	while not is_prime(_SCREAMING_SNAKE_CASE   ):
		number += 1

	while number < p_number_a:
		ans.append(_SCREAMING_SNAKE_CASE   )

		number += 1

		# fetch the next prime number.
		while not is_prime(_SCREAMING_SNAKE_CASE   ):
			number += 1

    # precondition
	assert (
	    isinstance(_SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   )
	    and ans[0] != p_number_a
	    and ans[len(_SCREAMING_SNAKE_CASE   ) - 1] != p_number_a
	), "'ans' must been a list without the arguments"

	# 'ans' contains not 'pNumber1' and 'pNumber2' !
	return ans



def    snake_case_				(    _SCREAMING_SNAKE_CASE   ):
	assert isinstance(_SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   ) and (n >= 1), "'n' must been int and >= 1"

	__lowercase		       =			[]  # will be returned.

	for divisor in range(1  ,	n + 1   ):
		if n % divisor == 0:
			ans.append(_SCREAMING_SNAKE_CASE   )

    # precondition
	assert ans[0] == 1 and ans[len(_SCREAMING_SNAKE_CASE   ) - 1] == n, "Error in function getDivisiors(...)"

	return ans



def    snake_case_				(    _SCREAMING_SNAKE_CASE   ):
	assert isinstance(_SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   ) and (
	    number > 1
	), "'number' must been an int and >= 1"

	__lowercase		       =			get_divisors(_SCREAMING_SNAKE_CASE   )

	# precondition
	assert (
	    isinstance(_SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   )
	    and (divisors[0] == 1)
	    and (divisors[len(_SCREAMING_SNAKE_CASE   ) - 1] == number)
	), "Error in help-function getDivisiors(...)"

	# summed all divisors up to 'number' (exclusive), hence [:-1]
	return sum(divisors[:-1]   ) == number



def    snake_case_				(    _SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   ):
	assert (
	    isinstance(_SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   )
	    and isinstance(_SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   )
	    and (denominator != 0)
	), "The arguments must been from type int and 'denominator' != 0"

	# build the greatest common divisor of numerator and denominator.
	__lowercase		       =			gcd(abs(_SCREAMING_SNAKE_CASE   )  ,	abs(_SCREAMING_SNAKE_CASE   )   )

	# precondition
	assert (
	    isinstance(_SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   )
	    and (numerator % gcd_of_fraction == 0)
	    and (denominator % gcd_of_fraction == 0)
	), "Error in function gcd(...,...)"

	return (numerator // gcd_of_fraction, denominator // gcd_of_fraction)



def    snake_case_				(    _SCREAMING_SNAKE_CASE   ):
	assert isinstance(_SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   ) and (n >= 0), "'n' must been a int and >= 0"

	__lowercase		       =			1  # this will be return.

	for factor in range(1  ,	n + 1   ):
		ans *= factor

	return ans



def    snake_case_				(    _SCREAMING_SNAKE_CASE   ):
	assert isinstance(_SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   ) and (n >= 0), "'n' must been an int and >= 0"

	__lowercase		       =			0
	__lowercase		       =			1
	__lowercase		       =			1  # this will be return

	for _ in range(n - 1   ):
		__lowercase		       =			ans
		ans += fiba
		__lowercase		       =			tmp

	return ans








import tempfile

import numpy as np
import torch
from transformers import AutoTokenizer, TaEncoderModel

from diffusers import DDPMScheduler, UNetaDConditionModel
from diffusers.models.attention_processor import AttnAddedKVProcessor
from diffusers.pipelines.deepfloyd_if import IFWatermarker
from diffusers.utils.testing_utils import torch_device

from ..test_pipelines_common import to_np

class   _A   :


						'''simple docstring'''





						def     _snake_case	(	self	:							Union[str, Any]	):






							'''simple docstring'''



							torch.manual_seed(0	)
							__lowercase		       =			TaEncoderModel.from_pretrained("hf-internal-testing/tiny-random-t5"	)

							torch.manual_seed(0	)
							__lowercase		       =			AutoTokenizer.from_pretrained("hf-internal-testing/tiny-random-t5"	)

							torch.manual_seed(0	)
							__lowercase		       =			UNetaDConditionModel(
							    sample_size=32							,      layers_per_block=1							,      block_out_channels=[32, 64]							,      down_block_types=[
							        "ResnetDownsampleBlock2D",
							        "SimpleCrossAttnDownBlock2D",
							    ]							,      mid_block_type="UNetMidBlock2DSimpleCrossAttn"							,      up_block_types=["SimpleCrossAttnUpBlock2D", "ResnetUpsampleBlock2D"]							,      in_channels=3							,      out_channels=6							,      cross_attention_dim=32							,      encoder_hid_dim=32							,      attention_head_dim=8							,      addition_embed_type="text"							,      addition_embed_type_num_heads=2							,      cross_attention_norm="group_norm"							,      resnet_time_scale_shift="scale_shift"							,      act_fn="gelu"							,      )
							unet.set_attn_processor(AttnAddedKVProcessor()	)  # For reproducibility tests

							torch.manual_seed(0	)
							__lowercase		       =			DDPMScheduler(
							    num_train_timesteps=1_000							,      beta_schedule="squaredcos_cap_v2"							,      beta_start=0.0001							,      beta_end=0.02							,      thresholding=lowerCamelCase							,      dynamic_thresholding_ratio=0.95							,      sample_max_value=1.0							,      prediction_type="epsilon"							,      variance_type="learned_range"							,      )

							torch.manual_seed(0	)
							__lowercase		       =			IFWatermarker()

							return {
							    "text_encoder": text_encoder,
							    "tokenizer": tokenizer,
							    "unet": unet,
							    "scheduler": scheduler,
							    "watermarker": watermarker,
							    "safety_checker": None,
							    "feature_extractor": None,
							}



						def     _snake_case	(	self	:							Tuple	):






							'''simple docstring'''



							torch.manual_seed(0	)
							__lowercase		       =			TaEncoderModel.from_pretrained("hf-internal-testing/tiny-random-t5"	)

							torch.manual_seed(0	)
							__lowercase		       =			AutoTokenizer.from_pretrained("hf-internal-testing/tiny-random-t5"	)

							torch.manual_seed(0	)
							__lowercase		       =			UNetaDConditionModel(
							    sample_size=32							,      layers_per_block=[1, 2]							,      block_out_channels=[32, 64]							,      down_block_types=[
							        "ResnetDownsampleBlock2D",
							        "SimpleCrossAttnDownBlock2D",
							    ]							,      mid_block_type="UNetMidBlock2DSimpleCrossAttn"							,      up_block_types=["SimpleCrossAttnUpBlock2D", "ResnetUpsampleBlock2D"]							,      in_channels=6							,      out_channels=6							,      cross_attention_dim=32							,      encoder_hid_dim=32							,      attention_head_dim=8							,      addition_embed_type="text"							,      addition_embed_type_num_heads=2							,      cross_attention_norm="group_norm"							,      resnet_time_scale_shift="scale_shift"							,      act_fn="gelu"							,      class_embed_type="timestep"							,      mid_block_scale_factor=1.414							,      time_embedding_act_fn="gelu"							,      time_embedding_dim=32							,      )
							unet.set_attn_processor(AttnAddedKVProcessor()	)  # For reproducibility tests

							torch.manual_seed(0	)
							__lowercase		       =			DDPMScheduler(
							    num_train_timesteps=1_000							,      beta_schedule="squaredcos_cap_v2"							,      beta_start=0.0001							,      beta_end=0.02							,      thresholding=lowerCamelCase							,      dynamic_thresholding_ratio=0.95							,      sample_max_value=1.0							,      prediction_type="epsilon"							,      variance_type="learned_range"							,      )

							torch.manual_seed(0	)
							__lowercase		       =			DDPMScheduler(
							    num_train_timesteps=1_000							,      beta_schedule="squaredcos_cap_v2"							,      beta_start=0.0001							,      beta_end=0.02							,      )

							torch.manual_seed(0	)
							__lowercase		       =			IFWatermarker()

							return {
							    "text_encoder": text_encoder,
							    "tokenizer": tokenizer,
							    "unet": unet,
							    "scheduler": scheduler,
							    "image_noising_scheduler": image_noising_scheduler,
							    "watermarker": watermarker,
							    "safety_checker": None,
							    "feature_extractor": None,
							}



						def     _snake_case	(	self	:							str	):






							'''simple docstring'''



							__lowercase		       =			self.get_dummy_components()
							__lowercase		       =			self.pipeline_class(**lowerCamelCase	)
							pipe.to(lowerCamelCase	)
							pipe.set_progress_bar_config(disable=lowerCamelCase	)

							__lowercase		       =			self.get_dummy_inputs(lowerCamelCase	)

							__lowercase		       =			inputs["prompt"]
							__lowercase		       =			inputs["generator"]
							__lowercase		       =			inputs["num_inference_steps"]
							__lowercase		       =			inputs["output_type"]

							if "image" in inputs:
								__lowercase		       =			inputs["image"]
							else:
								__lowercase		       =			None

							if "mask_image" in inputs:
								__lowercase		       =			inputs["mask_image"]
							else:
								__lowercase		       =			None

							if "original_image" in inputs:
								__lowercase		       =			inputs["original_image"]
							else:
								__lowercase		       =			None

							__lowercase       ,    __lowercase		       =			pipe.encode_prompt(lowerCamelCase	)

							# inputs with prompt converted to embeddings
							__lowercase		       =			{
							    "prompt_embeds": prompt_embeds,
							    "negative_prompt_embeds": negative_prompt_embeds,
							    "generator": generator,
							    "num_inference_steps": num_inference_steps,
							    "output_type": output_type,
							}

							if image is not None:
								__lowercase		       =			image

							if mask_image is not None:
								__lowercase		       =			mask_image

							if original_image is not None:
								__lowercase		       =			original_image

							# set all optional components to None
							for optional_component in pipe._optional_components:
								setattr(lowerCamelCase							,      lowerCamelCase							,      lowerCamelCase	)

							__lowercase		       =			pipe(**lowerCamelCase	)[0]

							with tempfile.TemporaryDirectory() as tmpdir:
								pipe.save_pretrained(lowerCamelCase	)
								__lowercase		       =			self.pipeline_class.from_pretrained(lowerCamelCase	)
								pipe_loaded.to(lowerCamelCase	)
								pipe_loaded.set_progress_bar_config(disable=lowerCamelCase	)

							pipe_loaded.unet.set_attn_processor(AttnAddedKVProcessor()	)  # For reproducibility tests

							for optional_component in pipe._optional_components:
								self.assertTrue(
								    getattr(lowerCamelCase							,      lowerCamelCase	) is None							,      f"""`{optional_component}` did not stay set to None after loading."""							,      )

							__lowercase		       =			self.get_dummy_inputs(lowerCamelCase	)

							__lowercase		       =			inputs["generator"]
							__lowercase		       =			inputs["num_inference_steps"]
							__lowercase		       =			inputs["output_type"]

							# inputs with prompt converted to embeddings
							__lowercase		       =			{
							    "prompt_embeds": prompt_embeds,
							    "negative_prompt_embeds": negative_prompt_embeds,
							    "generator": generator,
							    "num_inference_steps": num_inference_steps,
							    "output_type": output_type,
							}

							if image is not None:
								__lowercase		       =			image

							if mask_image is not None:
								__lowercase		       =			mask_image

							if original_image is not None:
								__lowercase		       =			original_image

							__lowercase		       =			pipe_loaded(**lowerCamelCase	)[0]

							__lowercase		       =			np.abs(to_np(lowerCamelCase	) - to_np(lowerCamelCase	)	).max()
							self.assertLess(lowerCamelCase							,      1e-4	)



						def     _snake_case	(	self	:							Optional[Any]	):






							'''simple docstring'''



							__lowercase		       =			self.get_dummy_components()
							__lowercase		       =			self.pipeline_class(**lowerCamelCase	)
							pipe.to(lowerCamelCase	)
							pipe.set_progress_bar_config(disable=lowerCamelCase	)

							__lowercase		       =			self.get_dummy_inputs(lowerCamelCase	)
							__lowercase		       =			pipe(**lowerCamelCase	)[0]

							with tempfile.TemporaryDirectory() as tmpdir:
								pipe.save_pretrained(lowerCamelCase	)
								__lowercase		       =			self.pipeline_class.from_pretrained(lowerCamelCase	)
								pipe_loaded.to(lowerCamelCase	)
								pipe_loaded.set_progress_bar_config(disable=lowerCamelCase	)

							pipe_loaded.unet.set_attn_processor(AttnAddedKVProcessor()	)  # For reproducibility tests

							__lowercase		       =			self.get_dummy_inputs(lowerCamelCase	)
							__lowercase		       =			pipe_loaded(**lowerCamelCase	)[0]

							__lowercase		       =			np.abs(to_np(lowerCamelCase	) - to_np(lowerCamelCase	)	).max()
							self.assertLess(lowerCamelCase							,      1e-4	)



