code: 
  
  
  
  
  """simple docstring"""
  
  from __future__ import annotations
  
  import unittest
  
  from transformers import AlbertConfig, is_tf_available
  from transformers.models.auto import get_values
  from transformers.testing_utils import require_tf, slow
  
  from ...test_configuration_common import ConfigTester
  from ...test_modeling_tf_common import TFModelTesterMixin, ids_tensor, random_attention_mask
  from ...test_pipeline_mixin import PipelineTesterMixin
  
  
  if is_tf_available():
  							import tensorflow as tf
  
  							from transformers import TF_MODEL_FOR_PRETRAINING_MAPPING
  							from transformers.models.albert.modeling_tf_albert import (
  							    TF_ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
  							    TFAlbertForMaskedLM,
  							    TFAlbertForMultipleChoice,
  							    TFAlbertForPreTraining,
  							    TFAlbertForQuestionAnswering,
  							    TFAlbertForSequenceClassification,
  							    TFAlbertForTokenClassification,
  							    TFAlbertModel,
  							)
  class 			lowerCamelCase__    :
  
  
  			def __init__(     self				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE=13				, SCREAMING_SNAKE_CASE=7				, SCREAMING_SNAKE_CASE=True				, SCREAMING_SNAKE_CASE=True				, SCREAMING_SNAKE_CASE=True				, SCREAMING_SNAKE_CASE=True				, SCREAMING_SNAKE_CASE=99				, SCREAMING_SNAKE_CASE=16				, SCREAMING_SNAKE_CASE=32				, SCREAMING_SNAKE_CASE=2				, SCREAMING_SNAKE_CASE=4				, SCREAMING_SNAKE_CASE=37				, SCREAMING_SNAKE_CASE="gelu"				, SCREAMING_SNAKE_CASE=0.1				, SCREAMING_SNAKE_CASE=0.1				, SCREAMING_SNAKE_CASE=512				, SCREAMING_SNAKE_CASE=16				, SCREAMING_SNAKE_CASE=2				, SCREAMING_SNAKE_CASE=0.02				, SCREAMING_SNAKE_CASE=3				, SCREAMING_SNAKE_CASE=4				, SCREAMING_SNAKE_CASE=None				, ):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					snake_case		:						List[str]								=				parent
  					snake_case		:						int								=				13
  					snake_case		:						List[Any]								=				7
  					snake_case		:						Tuple								=				True
  					snake_case		:						List[Any]								=				True
  					snake_case		:						List[str]								=				True
  					snake_case		:						List[str]								=				True
  					snake_case		:						List[Any]								=				99
  					snake_case		:						Union[str, Any]								=				16
  					snake_case		:						Dict								=				32
  					snake_case		:						Union[str, Any]								=				2
  					snake_case		:						str								=				4
  					snake_case		:						List[str]								=				37
  					snake_case		:						List[str]								=				"gelu"
  					snake_case		:						Optional[int]								=				0.1
  					snake_case		:						Dict								=				0.1
  					snake_case		:						Any								=				512
  					snake_case		:						Any								=				16
  					snake_case		:						Union[str, Any]								=				2
  					snake_case		:						int								=				0.02
  					snake_case		:						str								=				3
  					snake_case		:						str								=				4
  					snake_case		:						List[Any]								=				None
  
  
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					snake_case		:						Optional[int]								=				ids_tensor([self.batch_size, self.seq_length]				, self.vocab_size							)
  
  					snake_case		:						Any								=				None
  					if self.use_input_mask:
  							snake_case		:						int								=				random_attention_mask([self.batch_size, self.seq_length]							)
  
  					snake_case		:						Optional[int]								=				None
  					if self.use_token_type_ids:
  							snake_case		:						List[Any]								=				ids_tensor([self.batch_size, self.seq_length]				, self.type_vocab_size							)
  
  					snake_case		:						List[str]								=				None
  					snake_case		:						Optional[int]								=				None
  					snake_case		:						str								=				None
  					if self.use_labels:
  							snake_case		:						Union[str, Any]								=				ids_tensor([self.batch_size]				, self.type_sequence_label_size							)
  							snake_case		:						Optional[int]								=				ids_tensor([self.batch_size, self.seq_length]				, self.num_labels							)
  							snake_case		:						Dict								=				ids_tensor([self.batch_size]				, self.num_choices							)
  
  					snake_case		:						int								=				AlbertConfig(
  					    vocab_size=self.vocab_size				, hidden_size=self.hidden_size				, embedding_size=self.embedding_size				, num_hidden_layers=self.num_hidden_layers				, num_attention_heads=self.num_attention_heads				, intermediate_size=self.intermediate_size				, hidden_act=self.hidden_act				, hidden_dropout_prob=self.hidden_dropout_prob				, attention_probs_dropout_prob=self.attention_probs_dropout_prob				, max_position_embeddings=self.max_position_embeddings				, type_vocab_size=self.type_vocab_size				, initializer_range=self.initializer_range				, )
  
  					return config, input_ids, token_type_ids, input_mask, sequence_labels, token_labels, choice_labels
  
  
  			def 							lowerCamelCase_				(     self				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					snake_case		:						List[Any]								=				TFAlbertModel(config=SCREAMING_SNAKE_CASE							)
  					# inputs = {'input_ids': input_ids,
  					#           'attention_mask': input_mask,
  					#           'token_type_ids': token_type_ids}
  					# sequence_output, pooled_output = model(**inputs)
  					snake_case		:						List[str]								=				{"input_ids": input_ids, "attention_mask": input_mask, "token_type_ids": token_type_ids}
  					snake_case		:						Tuple								=				model(SCREAMING_SNAKE_CASE							)
  
  					snake_case		:						Any								=				[input_ids, input_mask]
  					snake_case		:						Optional[int]								=				model(SCREAMING_SNAKE_CASE							)
  
  					snake_case		:						Any								=				model(SCREAMING_SNAKE_CASE							)
  
  					self.parent.assertEqual(result.last_hidden_state.shape				, (self.batch_size, self.seq_length, self.hidden_size)							)
  					self.parent.assertEqual(result.pooler_output.shape				, (self.batch_size, self.hidden_size)							)
  
  
  			def 							lowerCamelCase_				(     self				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					snake_case		:						str								=				self.num_labels
  					snake_case		:						str								=				TFAlbertForPreTraining(config=SCREAMING_SNAKE_CASE							)
  					snake_case		:						Any								=				{"input_ids": input_ids, "attention_mask": input_mask, "token_type_ids": token_type_ids}
  					snake_case		:						str								=				model(SCREAMING_SNAKE_CASE							)
  					self.parent.assertEqual(result.prediction_logits.shape				, (self.batch_size, self.seq_length, self.vocab_size)							)
  					self.parent.assertEqual(result.sop_logits.shape				, (self.batch_size, self.num_labels)							)
  
  
  			def 							lowerCamelCase_				(     self				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					snake_case		:						Union[str, Any]								=				TFAlbertForMaskedLM(config=SCREAMING_SNAKE_CASE							)
  					snake_case		:						Any								=				{"input_ids": input_ids, "attention_mask": input_mask, "token_type_ids": token_type_ids}
  					snake_case		:						Optional[int]								=				model(SCREAMING_SNAKE_CASE							)
  					self.parent.assertEqual(result.logits.shape				, (self.batch_size, self.seq_length, self.vocab_size)							)
  
  
  			def 							lowerCamelCase_				(     self				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					snake_case		:						Optional[Any]								=				self.num_labels
  					snake_case		:						Optional[Any]								=				TFAlbertForSequenceClassification(config=SCREAMING_SNAKE_CASE							)
  					snake_case		:						str								=				{"input_ids": input_ids, "attention_mask": input_mask, "token_type_ids": token_type_ids}
  					snake_case		:						Union[str, Any]								=				model(SCREAMING_SNAKE_CASE							)
  					self.parent.assertEqual(result.logits.shape				, (self.batch_size, self.num_labels)							)
  
  
  			def 							lowerCamelCase_				(     self				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					snake_case		:						str								=				TFAlbertForQuestionAnswering(config=SCREAMING_SNAKE_CASE							)
  					snake_case		:						List[Any]								=				{"input_ids": input_ids, "attention_mask": input_mask, "token_type_ids": token_type_ids}
  					snake_case		:						List[str]								=				model(SCREAMING_SNAKE_CASE							)
  					self.parent.assertEqual(result.start_logits.shape				, (self.batch_size, self.seq_length)							)
  					self.parent.assertEqual(result.end_logits.shape				, (self.batch_size, self.seq_length)							)
  
  
  			def 							lowerCamelCase_				(     self				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					snake_case		:						Tuple								=				self.num_choices
  					snake_case		:						List[Any]								=				TFAlbertForMultipleChoice(config=SCREAMING_SNAKE_CASE							)
  					snake_case		:						Any								=				tf.tile(tf.expand_dims(SCREAMING_SNAKE_CASE				, 1							)				, (1, self.num_choices, 1)							)
  					snake_case		:						str								=				tf.tile(tf.expand_dims(SCREAMING_SNAKE_CASE				, 1							)				, (1, self.num_choices, 1)							)
  					snake_case		:						Optional[int]								=				tf.tile(tf.expand_dims(SCREAMING_SNAKE_CASE				, 1							)				, (1, self.num_choices, 1)							)
  					snake_case		:						Optional[int]								=				{
  					    "input_ids": multiple_choice_inputs_ids,
  					    "attention_mask": multiple_choice_input_mask,
  					    "token_type_ids": multiple_choice_token_type_ids,
  					}
  					snake_case		:						Union[str, Any]								=				model(SCREAMING_SNAKE_CASE							)
  					self.parent.assertListEqual(list(result["logits"].shape							)				, [self.batch_size, self.num_choices]							)
  
  
  			def 							lowerCamelCase_				(     self				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					snake_case		:						Tuple								=				self.num_labels
  					snake_case		:						Optional[Any]								=				TFAlbertForTokenClassification(config=SCREAMING_SNAKE_CASE							)
  					snake_case		:						Optional[Any]								=				{
  					    "input_ids": input_ids,
  					    "attention_mask": input_mask,
  					    "token_type_ids": token_type_ids,
  					}
  					snake_case		:						List[Any]								=				model(SCREAMING_SNAKE_CASE							)
  					self.parent.assertListEqual(list(result["logits"].shape							)				, [self.batch_size, self.seq_length, self.num_labels]							)
  
  
  
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					snake_case		:						int								=				self.prepare_config_and_inputs()
  					(
  					    snake_case				
  					)		:						Optional[Any]								=				config_and_inputs
  					snake_case		:						Tuple								=				{"input_ids": input_ids, "token_type_ids": token_type_ids, "attention_mask": input_mask}
  					return config, inputs_dict
  
  
  
  
  
  
  
  @require_tf
  class 			lowerCamelCase__    (  lowerCamelCase_				,  lowerCamelCase_				,  unittest.TestCase			):
  			a__ :      Optional[int]								=     (
  			    (
  			        TFAlbertModel,
  			        TFAlbertForPreTraining,
  			        TFAlbertForMaskedLM,
  			        TFAlbertForSequenceClassification,
  			        TFAlbertForQuestionAnswering,
  			        TFAlbertForTokenClassification,
  			        TFAlbertForMultipleChoice,
  			    )
  			    if is_tf_available()
  			    else ()
  			)
  			a__ :      Optional[int]								=     (
  			    {
  			        """feature-extraction""": TFAlbertModel,
  			        """fill-mask""": TFAlbertForMaskedLM,
  			        """question-answering""": TFAlbertForQuestionAnswering,
  			        """text-classification""": TFAlbertForSequenceClassification,
  			        """token-classification""": TFAlbertForTokenClassification,
  			        """zero-shot""": TFAlbertForSequenceClassification,
  			    }
  			    if is_tf_available()
  			    else {}
  			)
  			a__ :      List[Any]								=     False
  			a__ :      int								=     False
  
  
  			def 							lowerCamelCase_				(     self				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE=False							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					snake_case		:						Optional[int]								=				super()._prepare_for_class(SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE				, return_labels=SCREAMING_SNAKE_CASE							)
  
  					if return_labels:
  							if model_class in get_values(SCREAMING_SNAKE_CASE							):
  									snake_case		:						Any								=				tf.zeros(self.model_tester.batch_size				, dtype=tf.intaa							)
  
  					return inputs_dict
  
  
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					snake_case		:						Union[str, Any]								=				TFAlbertModelTester(self							)
  					snake_case		:						List[str]								=				ConfigTester(self				, config_class=SCREAMING_SNAKE_CASE				, hidden_size=37							)
  
  
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					self.config_tester.run_common_tests()
  
  
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					snake_case		:						Optional[int]								=				self.model_tester.prepare_config_and_inputs()
  					self.model_tester.create_and_check_albert_model(*SCREAMING_SNAKE_CASE							)
  
  
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					snake_case		:						int								=				self.model_tester.prepare_config_and_inputs()
  					self.model_tester.create_and_check_albert_for_pretraining(*SCREAMING_SNAKE_CASE							)
  
  
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					snake_case		:						List[str]								=				self.model_tester.prepare_config_and_inputs()
  					self.model_tester.create_and_check_albert_for_masked_lm(*SCREAMING_SNAKE_CASE							)
  
  
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					snake_case		:						int								=				self.model_tester.prepare_config_and_inputs()
  					self.model_tester.create_and_check_albert_for_multiple_choice(*SCREAMING_SNAKE_CASE							)
  
  
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					snake_case		:						str								=				self.model_tester.prepare_config_and_inputs()
  					self.model_tester.create_and_check_albert_for_sequence_classification(*SCREAMING_SNAKE_CASE							)
  
  
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					snake_case		:						Tuple								=				self.model_tester.prepare_config_and_inputs()
  					self.model_tester.create_and_check_albert_for_question_answering(*SCREAMING_SNAKE_CASE							)
  
  
  
  			@slow
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					for model_name in TF_ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
  							snake_case		:						List[Any]								=				TFAlbertModel.from_pretrained(SCREAMING_SNAKE_CASE							)
  							self.assertIsNotNone(SCREAMING_SNAKE_CASE							)
  
  
  
  
  
  
  
  @require_tf
  class 			lowerCamelCase__    (  unittest.TestCase			):
  
  
  			@slow
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					snake_case		:						Optional[Any]								=				TFAlbertForPreTraining.from_pretrained("albert-base-v2"							)
  					snake_case		:						Tuple								=				tf.constant([[0, 1, 2, 3, 4, 5]]							)
  					snake_case		:						Tuple								=				model(SCREAMING_SNAKE_CASE							)[0]
  
  					snake_case		:						Optional[Any]								=				[1, 6, 30_000]
  					self.assertEqual(output.shape				, SCREAMING_SNAKE_CASE							)
  
  					snake_case		:						Optional[Any]								=				tf.constant(
  					    [
  					        [
  					            [4.59_56_68, 0.74_46_27_54, -1.81_81_47],
  					            [4.5_95_43_47, 0.7_45_41_84, -1.8_18_82_58],
  					            [4.5_95_49_05, 0.7_44_82_35, -1.8_18_23_16],
  					        ]
  					    ]							)
  					tf.debugging.assert_near(output[:, :3, :3]				, SCREAMING_SNAKE_CASE				, atol=1E-4							)
  
style_context: 
  
  
  
  
  """simple docstring"""
  
  import gc
  import unittest
  
  import numpy as np
  import torch
  
  from diffusers import RePaintPipeline, RePaintScheduler, UNetaDModel
  from diffusers.utils.testing_utils import (
      enable_full_determinism,
      load_image,
      load_numpy,
      nightly,
      require_torch_gpu,
      skip_mps,
      torch_device,
  )
  
  from ..pipeline_params import IMAGE_INPAINTING_BATCH_PARAMS, IMAGE_INPAINTING_PARAMS
  from ..test_pipelines_common import PipelineTesterMixin
  
  
  enable_full_determinism()
  class 			lowerCamelCase__    (  lowerCamelCase_				,  unittest.TestCase			):
  			a__ :      Optional[Any]								=     RePaintPipeline
  			a__ :      List[Any]								=     IMAGE_INPAINTING_PARAMS - {"""width""", """height""", """guidance_scale"""}
  			a__ :      List[Any]								=     PipelineTesterMixin.required_optional_params - {
  			    """latents""",
  			    """num_images_per_prompt""",
  			    """callback""",
  			    """callback_steps""",
  			}
  			a__ :      List[Any]								=     IMAGE_INPAINTING_BATCH_PARAMS
  			a__ :      List[str]								=     False
  
  
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					torch.manual_seed(0							)
  					torch.manual_seed(0							)
  					snake_case		:						Union[str, Any]								=				UNetaDModel(
  					    block_out_channels=(32, 64)				, layers_per_block=2				, sample_size=32				, in_channels=3				, out_channels=3				, down_block_types=("DownBlock2D", "AttnDownBlock2D")				, up_block_types=("AttnUpBlock2D", "UpBlock2D")				, )
  					snake_case		:						Union[str, Any]								=				RePaintScheduler()
  					snake_case		:						Optional[Any]								=				{"unet": unet, "scheduler": scheduler}
  					return components
  
  
  			def 							lowerCamelCase_				(     self				, SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE=0							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					if str(SCREAMING_SNAKE_CASE							).startswith("mps"							):
  							snake_case		:						str								=				torch.manual_seed(SCREAMING_SNAKE_CASE							)
  					else:
  							snake_case		:						List[Any]								=				torch.Generator(device=SCREAMING_SNAKE_CASE							).manual_seed(SCREAMING_SNAKE_CASE							)
  					snake_case		:						Any								=				np.random.RandomState(SCREAMING_SNAKE_CASE							).standard_normal((1, 3, 32, 32)							)
  					snake_case		:						Any								=				torch.from_numpy(SCREAMING_SNAKE_CASE							).to(device=SCREAMING_SNAKE_CASE				, dtype=torch.floataa							)
  					snake_case		:						List[str]								=				(image > 0).to(device=SCREAMING_SNAKE_CASE				, dtype=torch.floataa							)
  					snake_case		:						int								=				{
  					    "image": image,
  					    "mask_image": mask,
  					    "generator": generator,
  					    "num_inference_steps": 5,
  					    "eta": 0.0,
  					    "jump_length": 2,
  					    "jump_n_sample": 2,
  					    "output_type": "numpy",
  					}
  					return inputs
  
  
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					snake_case		:						List[Any]								=				"cpu"  # ensure determinism for the device-dependent torch.Generator
  					snake_case		:						Any								=				self.get_dummy_components()
  					snake_case		:						Optional[int]								=				RePaintPipeline(**SCREAMING_SNAKE_CASE							)
  					snake_case		:						Optional[Any]								=				sd_pipe.to(SCREAMING_SNAKE_CASE							)
  					sd_pipe.set_progress_bar_config(disable=SCREAMING_SNAKE_CASE							)
  
  					snake_case		:						Any								=				self.get_dummy_inputs(SCREAMING_SNAKE_CASE							)
  					snake_case		:						Dict								=				sd_pipe(**SCREAMING_SNAKE_CASE							).images
  					snake_case		:						Optional[int]								=				image[0, -3:, -3:, -1]
  
  					assert image.shape == (1, 32, 32, 3)
  					snake_case		:						List[str]								=				np.array([1.00_00, 0.54_26, 0.54_97, 0.22_00, 1.00_00, 1.00_00, 0.56_23, 1.00_00, 0.62_74]							)
  
  					assert np.abs(image_slice.flatten() - expected_slice							).max() < 1E-3
  
  
  			@skip_mps
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					return super().test_save_load_local()
  
  
  			@unittest.skip("non-deterministic pipeline"							)
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					return super().test_inference_batch_single_identical()
  
  
  			@skip_mps
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					return super().test_dict_tuple_outputs_equivalent()
  
  
  			@skip_mps
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					return super().test_save_load_optional_components()
  
  
  
  			@skip_mps
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					return super().test_attention_slicing_forward_pass()
  
  
  
  
  
  
  
  @nightly
  @require_torch_gpu
  class 			lowerCamelCase__    (  unittest.TestCase			):
  
  
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					super().tearDown()
  					gc.collect()
  					torch.cuda.empty_cache()
  
  
  
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					snake_case		:						Optional[int]								=				load_image(
  					    "https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/"
  					    "repaint/celeba_hq_256.png"							)
  					snake_case		:						Any								=				load_image(
  					    "https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/repaint/mask_256.png"							)
  					snake_case		:						List[Any]								=				load_numpy(
  					    "https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/"
  					    "repaint/celeba_hq_256_result.npy"							)
  
  					snake_case		:						str								=				"google/ddpm-ema-celebahq-256"
  					snake_case		:						Optional[Any]								=				UNetaDModel.from_pretrained(SCREAMING_SNAKE_CASE							)
  					snake_case		:						Optional[int]								=				RePaintScheduler.from_pretrained(SCREAMING_SNAKE_CASE							)
  
  					snake_case		:						str								=				RePaintPipeline(unet=SCREAMING_SNAKE_CASE				, scheduler=SCREAMING_SNAKE_CASE							).to(SCREAMING_SNAKE_CASE							)
  					repaint.set_progress_bar_config(disable=SCREAMING_SNAKE_CASE							)
  					repaint.enable_attention_slicing()
  
  					snake_case		:						Union[str, Any]								=				torch.manual_seed(0							)
  					snake_case		:						int								=				repaint(
  					    SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE				, num_inference_steps=250				, eta=0.0				, jump_length=10				, jump_n_sample=10				, generator=SCREAMING_SNAKE_CASE				, output_type="np"				, )
  					snake_case		:						List[Any]								=				output.images[0]
  
  					assert image.shape == (256, 256, 3)
  					assert np.abs(expected_image - image							).mean() < 1E-2
  
  