




import gc
import random
import unittest

import numpy as np
import torch
from PIL import Image
from transformers import CLIPTextConfig, CLIPTextModel, CLIPTokenizer

from diffusers import AutoencoderKL, DDIMScheduler, DDPMScheduler, StableDiffusionUpscalePipeline, UNetaDConditionModel
from diffusers.utils import floats_tensor, load_image, load_numpy, slow, torch_device
from diffusers.utils.testing_utils import enable_full_determinism, require_torch_gpu


enable_full_determinism()







class        __lowerCAmelCase					(			unittest.TestCase					):

			"""simple docstring"""







			def  lowercase_       ( self				)       -> Tuple:



							'''simple docstring'''
							# clean up the VRAM after each test
							super().tearDown()
							gc.collect()
							torch.cuda.empty_cache()


			@property
			def  lowercase_       ( self				)       -> Union[str, Any]:



							'''simple docstring'''
							__lowerCamelCase									=       1
							__lowerCamelCase									=       3
							__lowerCamelCase									=       (32, 32)

							__lowerCamelCase									=       floats_tensor((batch_size, num_channels) + sizes     ,		rng=random.Random(0				)				).to(lowerCamelCase__				)
							return image


			@property
			def  lowercase_       ( self				)       -> Union[str, Any]:



							'''simple docstring'''
							torch.manual_seed(0				)
							__lowerCamelCase									=       UNetaDConditionModel(
							    block_out_channels=(32, 32, 64)     ,		layers_per_block=2     ,		sample_size=32     ,		in_channels=7     ,		out_channels=4     ,		down_block_types=('DownBlock2D', 'CrossAttnDownBlock2D', 'CrossAttnDownBlock2D')     ,		up_block_types=('CrossAttnUpBlock2D', 'CrossAttnUpBlock2D', 'UpBlock2D')     ,		cross_attention_dim=32     ,		attention_head_dim=8     ,		use_linear_projection=lowerCamelCase__     ,		only_cross_attention=(True, True, False)     ,		num_class_embeds=100     ,		)
							return model


			@property
			def  lowercase_       ( self				)       -> Optional[Any]:



							'''simple docstring'''
							torch.manual_seed(0				)
							__lowerCamelCase									=       AutoencoderKL(
							    block_out_channels=[32, 32, 64]     ,		in_channels=3     ,		out_channels=3     ,		down_block_types=['DownEncoderBlock2D', 'DownEncoderBlock2D', 'DownEncoderBlock2D']     ,		up_block_types=['UpDecoderBlock2D', 'UpDecoderBlock2D', 'UpDecoderBlock2D']     ,		latent_channels=4     ,		)
							return model


			@property
			def  lowercase_       ( self				)       -> int:



							'''simple docstring'''
							torch.manual_seed(0				)
							__lowerCamelCase									=       CLIPTextConfig(
							    bos_token_id=0     ,		eos_token_id=2     ,		hidden_size=32     ,		intermediate_size=37     ,		layer_norm_eps=1e-05     ,		num_attention_heads=4     ,		num_hidden_layers=5     ,		pad_token_id=1     ,		vocab_size=1_000     ,		hidden_act='gelu'     ,		projection_dim=512     ,		)
							return CLIPTextModel(lowerCamelCase__				)


			def  lowercase_       ( self				)       -> str:



							'''simple docstring'''
							__lowerCamelCase									=       'cpu'  # ensure determinism for the device-dependent torch.Generator
							__lowerCamelCase									=       self.dummy_cond_unet_upscale
							__lowerCamelCase									=       DDPMScheduler()
							__lowerCamelCase									=       DDIMScheduler(prediction_type='v_prediction'				)
							__lowerCamelCase									=       self.dummy_vae
							__lowerCamelCase									=       self.dummy_text_encoder
							__lowerCamelCase									=       CLIPTokenizer.from_pretrained('hf-internal-testing/tiny-random-clip'				)

							__lowerCamelCase									=       self.dummy_image.cpu().permute(0     ,		2     ,		3     ,		1				)[0]
							__lowerCamelCase									=       Image.fromarray(np.uinta(lowerCamelCase__				)				).convert('RGB'				).resize((64, 64)				)

							# make sure here that pndm scheduler skips prk
							__lowerCamelCase									=       StableDiffusionUpscalePipeline(
							    unet=lowerCamelCase__     ,		low_res_scheduler=lowerCamelCase__     ,		scheduler=lowerCamelCase__     ,		vae=lowerCamelCase__     ,		text_encoder=lowerCamelCase__     ,		tokenizer=lowerCamelCase__     ,		max_noise_level=350     ,		)
							__lowerCamelCase									=       sd_pipe.to(lowerCamelCase__				)
							sd_pipe.set_progress_bar_config(disable=lowerCamelCase__				)

							__lowerCamelCase									=       'A painting of a squirrel eating a burger'
							__lowerCamelCase									=       torch.Generator(device=lowerCamelCase__				).manual_seed(0				)
							__lowerCamelCase									=       sd_pipe(
							    [prompt]     ,		image=lowerCamelCase__     ,		generator=lowerCamelCase__     ,		guidance_scale=6.0     ,		noise_level=20     ,		num_inference_steps=2     ,		output_type='np'     ,		)

							__lowerCamelCase									=       output.images

							__lowerCamelCase									=       torch.Generator(device=lowerCamelCase__				).manual_seed(0				)
							__lowerCamelCase									=       sd_pipe(
							    [prompt]     ,		image=lowerCamelCase__     ,		generator=lowerCamelCase__     ,		guidance_scale=6.0     ,		noise_level=20     ,		num_inference_steps=2     ,		output_type='np'     ,		return_dict=lowerCamelCase__     ,		)[0]

							__lowerCamelCase									=       image[0, -3:, -3:, -1]
							__lowerCamelCase									=       image_from_tuple[0, -3:, -3:, -1]

							__lowerCamelCase									=       low_res_image.size[0] * 4
							assert image.shape == (1, expected_height_width, expected_height_width, 3)
							__lowerCamelCase									=       np.array([0.31_13, 0.39_10, 0.42_72, 0.48_59, 0.50_61, 0.46_52, 0.53_62, 0.57_15, 0.56_61]				)

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


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



							'''simple docstring'''
							__lowerCamelCase									=       'cpu'  # ensure determinism for the device-dependent torch.Generator
							__lowerCamelCase									=       self.dummy_cond_unet_upscale
							__lowerCamelCase									=       DDPMScheduler()
							__lowerCamelCase									=       DDIMScheduler(prediction_type='v_prediction'				)
							__lowerCamelCase									=       self.dummy_vae
							__lowerCamelCase									=       self.dummy_text_encoder
							__lowerCamelCase									=       CLIPTokenizer.from_pretrained('hf-internal-testing/tiny-random-clip'				)

							__lowerCamelCase									=       self.dummy_image.cpu().permute(0     ,		2     ,		3     ,		1				)[0]
							__lowerCamelCase									=       Image.fromarray(np.uinta(lowerCamelCase__				)				).convert('RGB'				).resize((64, 64)				)

							# make sure here that pndm scheduler skips prk
							__lowerCamelCase									=       StableDiffusionUpscalePipeline(
							    unet=lowerCamelCase__     ,		low_res_scheduler=lowerCamelCase__     ,		scheduler=lowerCamelCase__     ,		vae=lowerCamelCase__     ,		text_encoder=lowerCamelCase__     ,		tokenizer=lowerCamelCase__     ,		max_noise_level=350     ,		)
							__lowerCamelCase									=       sd_pipe.to(lowerCamelCase__				)
							sd_pipe.set_progress_bar_config(disable=lowerCamelCase__				)

							__lowerCamelCase									=       'A painting of a squirrel eating a burger'
							__lowerCamelCase									=       sd_pipe(
							    2 * [prompt]     ,		image=2 * [low_res_image]     ,		guidance_scale=6.0     ,		noise_level=20     ,		num_inference_steps=2     ,		output_type='np'     ,		)
							__lowerCamelCase									=       output.images
							assert image.shape[0] == 2

							__lowerCamelCase									=       torch.Generator(device=lowerCamelCase__				).manual_seed(0				)
							__lowerCamelCase									=       sd_pipe(
							    [prompt]     ,		image=lowerCamelCase__     ,		generator=lowerCamelCase__     ,		num_images_per_prompt=2     ,		guidance_scale=6.0     ,		noise_level=20     ,		num_inference_steps=2     ,		output_type='np'     ,		)
							__lowerCamelCase									=       output.images
							assert image.shape[0] == 2






			@unittest.skipIf(torch_device != 'cuda'     ,		'This test requires a GPU'				)
			def  lowercase_       ( self				)       -> Optional[int]:



							'''simple docstring'''
							__lowerCamelCase									=       self.dummy_cond_unet_upscale
							__lowerCamelCase									=       DDPMScheduler()
							__lowerCamelCase									=       DDIMScheduler(prediction_type='v_prediction'				)
							__lowerCamelCase									=       self.dummy_vae
							__lowerCamelCase									=       self.dummy_text_encoder
							__lowerCamelCase									=       CLIPTokenizer.from_pretrained('hf-internal-testing/tiny-random-clip'				)

							__lowerCamelCase									=       self.dummy_image.cpu().permute(0     ,		2     ,		3     ,		1				)[0]
							__lowerCamelCase									=       Image.fromarray(np.uinta(lowerCamelCase__				)				).convert('RGB'				).resize((64, 64)				)

							# put models in fp16, except vae as it overflows in fp16
							__lowerCamelCase									=       unet.half()
							__lowerCamelCase									=       text_encoder.half()

							# make sure here that pndm scheduler skips prk
							__lowerCamelCase									=       StableDiffusionUpscalePipeline(
							    unet=lowerCamelCase__     ,		low_res_scheduler=lowerCamelCase__     ,		scheduler=lowerCamelCase__     ,		vae=lowerCamelCase__     ,		text_encoder=lowerCamelCase__     ,		tokenizer=lowerCamelCase__     ,		max_noise_level=350     ,		)
							__lowerCamelCase									=       sd_pipe.to(lowerCamelCase__				)
							sd_pipe.set_progress_bar_config(disable=lowerCamelCase__				)

							__lowerCamelCase									=       'A painting of a squirrel eating a burger'
							__lowerCamelCase									=       torch.manual_seed(0				)
							__lowerCamelCase									=       sd_pipe(
							    [prompt]     ,		image=lowerCamelCase__     ,		generator=lowerCamelCase__     ,		num_inference_steps=2     ,		output_type='np'     ,		).images

							__lowerCamelCase									=       low_res_image.size[0] * 4
							assert image.shape == (1, expected_height_width, expected_height_width, 3)







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

			"""simple docstring"""







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



							'''simple docstring'''
							# clean up the VRAM after each test
							super().tearDown()
							gc.collect()
							torch.cuda.empty_cache()


			def  lowercase_       ( self				)       -> int:



							'''simple docstring'''
							__lowerCamelCase									=       load_image(
							    'https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main'
							    '/sd2-upscale/low_res_cat.png'				)
							__lowerCamelCase									=       load_numpy(
							    'https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/sd2-upscale'
							    '/upsampled_cat.npy'				)

							__lowerCamelCase									=       'stabilityai/stable-diffusion-x4-upscaler'
							__lowerCamelCase									=       StableDiffusionUpscalePipeline.from_pretrained(lowerCamelCase__				)
							pipe.to(lowerCamelCase__				)
							pipe.set_progress_bar_config(disable=lowerCamelCase__				)
							pipe.enable_attention_slicing()

							__lowerCamelCase									=       'a cat sitting on a park bench'

							__lowerCamelCase									=       torch.manual_seed(0				)
							__lowerCamelCase									=       pipe(
							    prompt=lowerCamelCase__     ,		image=lowerCamelCase__     ,		generator=lowerCamelCase__     ,		output_type='np'     ,		)
							__lowerCamelCase									=       output.images[0]

							assert image.shape == (512, 512, 3)
							assert np.abs(expected_image - image				).max() < 1e-3


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



							'''simple docstring'''
							__lowerCamelCase									=       load_image(
							    'https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main'
							    '/sd2-upscale/low_res_cat.png'				)
							__lowerCamelCase									=       load_numpy(
							    'https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/sd2-upscale'
							    '/upsampled_cat_fp16.npy'				)

							__lowerCamelCase									=       'stabilityai/stable-diffusion-x4-upscaler'
							__lowerCamelCase									=       StableDiffusionUpscalePipeline.from_pretrained(
							    lowerCamelCase__     ,		torch_dtype=torch.floataa     ,		)
							pipe.to(lowerCamelCase__				)
							pipe.set_progress_bar_config(disable=lowerCamelCase__				)
							pipe.enable_attention_slicing()

							__lowerCamelCase									=       'a cat sitting on a park bench'

							__lowerCamelCase									=       torch.manual_seed(0				)
							__lowerCamelCase									=       pipe(
							    prompt=lowerCamelCase__     ,		image=lowerCamelCase__     ,		generator=lowerCamelCase__     ,		output_type='np'     ,		)
							__lowerCamelCase									=       output.images[0]

							assert image.shape == (512, 512, 3)
							assert np.abs(expected_image - image				).max() < 5e-1






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



							'''simple docstring'''
							torch.cuda.empty_cache()
							torch.cuda.reset_max_memory_allocated()
							torch.cuda.reset_peak_memory_stats()

							__lowerCamelCase									=       load_image(
							    'https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main'
							    '/sd2-upscale/low_res_cat.png'				)

							__lowerCamelCase									=       'stabilityai/stable-diffusion-x4-upscaler'
							__lowerCamelCase									=       StableDiffusionUpscalePipeline.from_pretrained(
							    lowerCamelCase__     ,		torch_dtype=torch.floataa     ,		)
							pipe.to(lowerCamelCase__				)
							pipe.set_progress_bar_config(disable=lowerCamelCase__				)
							pipe.enable_attention_slicing(1				)
							pipe.enable_sequential_cpu_offload()

							__lowerCamelCase									=       'a cat sitting on a park bench'

							__lowerCamelCase									=       torch.manual_seed(0				)
							__lowerCamelCase									=       pipe(
							    prompt=lowerCamelCase__     ,		image=lowerCamelCase__     ,		generator=lowerCamelCase__     ,		num_inference_steps=5     ,		output_type='np'     ,		)

							__lowerCamelCase									=       torch.cuda.max_memory_allocated()
							# make sure that less than 2.9 GB is allocated
							assert mem_bytes < 2.9 * 10**9








import unittest

from transformers import EsmConfig, is_torch_available
from transformers.testing_utils import TestCasePlus, require_torch, slow, torch_device

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
					import torch

					from transformers.models.esm.modeling_esmfold import EsmForProteinFolding







class        __lowerCAmelCase					:

			"""simple docstring"""







			def __init__( self     ,		lowerCamelCase__     ,		lowerCamelCase__=13     ,		lowerCamelCase__=7     ,		lowerCamelCase__=False     ,		lowerCamelCase__=True     ,		lowerCamelCase__=False     ,		lowerCamelCase__=False     ,		lowerCamelCase__=19     ,		lowerCamelCase__=32     ,		lowerCamelCase__=5     ,		lowerCamelCase__=4     ,		lowerCamelCase__=37     ,		lowerCamelCase__="gelu"     ,		lowerCamelCase__=0.1     ,		lowerCamelCase__=0.1     ,		lowerCamelCase__=512     ,		lowerCamelCase__=16     ,		lowerCamelCase__=2     ,		lowerCamelCase__=0.02     ,		lowerCamelCase__=3     ,		lowerCamelCase__=4     ,		lowerCamelCase__=None     ,		)       -> Any:



							'''simple docstring'''
							__lowerCamelCase									=       parent
							__lowerCamelCase									=       batch_size
							__lowerCamelCase									=       seq_length
							__lowerCamelCase									=       is_training
							__lowerCamelCase									=       use_input_mask
							__lowerCamelCase									=       use_token_type_ids
							__lowerCamelCase									=       use_labels
							__lowerCamelCase									=       vocab_size
							__lowerCamelCase									=       hidden_size
							__lowerCamelCase									=       num_hidden_layers
							__lowerCamelCase									=       num_attention_heads
							__lowerCamelCase									=       intermediate_size
							__lowerCamelCase									=       hidden_act
							__lowerCamelCase									=       hidden_dropout_prob
							__lowerCamelCase									=       attention_probs_dropout_prob
							__lowerCamelCase									=       max_position_embeddings
							__lowerCamelCase									=       type_vocab_size
							__lowerCamelCase									=       type_sequence_label_size
							__lowerCamelCase									=       initializer_range
							__lowerCamelCase									=       num_labels
							__lowerCamelCase									=       num_choices
							__lowerCamelCase									=       scope


			def  lowercase_       ( self				)       -> str:



							'''simple docstring'''
							__lowerCamelCase									=       ids_tensor([self.batch_size, self.seq_length]     ,		self.vocab_size				)

							__lowerCamelCase									=       None
							if self.use_input_mask:
											__lowerCamelCase									=       random_attention_mask([self.batch_size, self.seq_length]				)

							__lowerCamelCase									=       None
							__lowerCamelCase									=       None
							__lowerCamelCase									=       None
							if self.use_labels:
											__lowerCamelCase									=       ids_tensor([self.batch_size]     ,		self.type_sequence_label_size				)
											__lowerCamelCase									=       ids_tensor([self.batch_size, self.seq_length]     ,		self.num_labels				)
											__lowerCamelCase									=       ids_tensor([self.batch_size]     ,		self.num_choices				)

							__lowerCamelCase									=       self.get_config()

							return config, input_ids, input_mask, sequence_labels, token_labels, choice_labels


			def  lowercase_       ( self				)       -> Tuple:



							'''simple docstring'''
							__lowerCamelCase									=       EsmConfig(
							    vocab_size=33     ,		hidden_size=self.hidden_size     ,		pad_token_id=1     ,		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     ,		is_folding_model=lowerCamelCase__     ,		esmfold_config={'trunk': {'num_blocks': 2}, 'fp16_esm': False}     ,		)
							return config


			def  lowercase_       ( self     ,		lowerCamelCase__     ,		lowerCamelCase__     ,		lowerCamelCase__     ,		lowerCamelCase__     ,		lowerCamelCase__     ,		lowerCamelCase__				)       -> Optional[Any]:



							'''simple docstring'''
							__lowerCamelCase									=       EsmForProteinFolding(config=lowerCamelCase__				).float()
							model.to(lowerCamelCase__				)
							model.eval()
							__lowerCamelCase									=       model(lowerCamelCase__     ,		attention_mask=lowerCamelCase__				)
							__lowerCamelCase									=       model(lowerCamelCase__				)
							__lowerCamelCase									=       model(lowerCamelCase__				)

							self.parent.assertEqual(result.positions.shape     ,		(8, self.batch_size, self.seq_length, 14, 3)				)
							self.parent.assertEqual(result.angles.shape     ,		(8, self.batch_size, self.seq_length, 7, 2)				)






			def  lowercase_       ( self				)       -> int:



							'''simple docstring'''
							__lowerCamelCase									=       self.prepare_config_and_inputs()
							(
							    (
							    __lowerCamelCase
							)			,		(
							    __lowerCamelCase
							)			,		(
							    __lowerCamelCase
							)			,		(
							    __lowerCamelCase
							)			,		(
							    __lowerCamelCase
							)			,		(
							    __lowerCamelCase
							)			,		
							)									=       config_and_inputs
							__lowerCamelCase									=       {'input_ids': input_ids, 'attention_mask': input_mask}
							return config, inputs_dict







@require_torch
class        __lowerCAmelCase					(			__magic_name__     ,							__magic_name__     ,							unittest.TestCase					):

			"""simple docstring"""







			snake_case_  						=			False

			snake_case_  						=			(EsmForProteinFolding,) if is_torch_available() else ()
			snake_case_  						=			()
			snake_case_  						=			{} if is_torch_available() else {}
			snake_case_  						=			False


			def  lowercase_       ( self				)       -> Tuple:



							'''simple docstring'''
							__lowerCamelCase									=       EsmFoldModelTester(self				)
							__lowerCamelCase									=       ConfigTester(self     ,		config_class=lowerCamelCase__     ,		hidden_size=37				)


			def  lowercase_       ( self				)       -> Any:



							'''simple docstring'''
							self.config_tester.run_common_tests()


			def  lowercase_       ( self				)       -> str:



							'''simple docstring'''
							__lowerCamelCase									=       self.model_tester.prepare_config_and_inputs()
							self.model_tester.create_and_check_model(*lowerCamelCase__				)


			@unittest.skip('Does not support attention outputs'				)
			def  lowercase_       ( self				)       -> int:



							'''simple docstring'''
							pass


			@unittest.skip
			def  lowercase_       ( self				)       -> Tuple:



							'''simple docstring'''
							pass


			@unittest.skip('Esm does not support embedding resizing'				)
			def  lowercase_       ( self				)       -> Any:



							'''simple docstring'''
							pass


			@unittest.skip('Esm does not support embedding resizing'				)
			def  lowercase_       ( self				)       -> int:



							'''simple docstring'''
							pass


			@unittest.skip('ESMFold does not support passing input embeds!'				)
			def  lowercase_       ( self				)       -> Any:



							'''simple docstring'''
							pass


			@unittest.skip('ESMFold does not support head pruning.'				)
			def  lowercase_       ( self				)       -> List[Any]:



							'''simple docstring'''
							pass


			@unittest.skip('ESMFold does not support head pruning.'				)
			def  lowercase_       ( self				)       -> Dict:



							'''simple docstring'''
							pass


			@unittest.skip('ESMFold does not support head pruning.'				)
			def  lowercase_       ( self				)       -> List[Any]:



							'''simple docstring'''
							pass


			@unittest.skip('ESMFold does not support head pruning.'				)
			def  lowercase_       ( self				)       -> int:



							'''simple docstring'''
							pass


			@unittest.skip('ESMFold does not support head pruning.'				)
			def  lowercase_       ( self				)       -> Dict:



							'''simple docstring'''
							pass


			@unittest.skip('ESMFold does not output hidden states in the normal way.'				)
			def  lowercase_       ( self				)       -> List[str]:



							'''simple docstring'''
							pass


			@unittest.skip('ESMfold does not output hidden states in the normal way.'				)
			def  lowercase_       ( self				)       -> Optional[int]:



							'''simple docstring'''
							pass


			@unittest.skip('ESMFold only has one output format.'				)
			def  lowercase_       ( self				)       -> Tuple:



							'''simple docstring'''
							pass


			@unittest.skip('This test doesn\'t work for ESMFold and doesn\'t test core functionality'				)
			def  lowercase_       ( self				)       -> int:



							'''simple docstring'''
							pass


			@unittest.skip('ESMFold does not support input chunking.'				)
			def  lowercase_       ( self				)       -> Dict:



							'''simple docstring'''
							pass


			@unittest.skip('ESMFold doesn\'t respect you and it certainly doesn\'t respect your initialization arguments.'				)
			def  lowercase_       ( self				)       -> Any:



							'''simple docstring'''
							pass


			@unittest.skip('ESMFold doesn\'t support torchscript compilation.'				)
			def  lowercase_       ( self				)       -> Union[str, Any]:



							'''simple docstring'''
							pass


			@unittest.skip('ESMFold doesn\'t support torchscript compilation.'				)
			def  lowercase_       ( self				)       -> str:



							'''simple docstring'''
							pass


			@unittest.skip('ESMFold doesn\'t support torchscript compilation.'				)
			def  lowercase_       ( self				)       -> Dict:



							'''simple docstring'''
							pass


			@unittest.skip('ESMFold doesn\'t support data parallel.'				)
			def  lowercase_       ( self				)       -> str:



							'''simple docstring'''
							pass






			@unittest.skip('Will be fixed soon by reducing the size of the model used for common tests.'				)
			def  lowercase_       ( self				)       -> List[Any]:



							'''simple docstring'''
							pass







@require_torch
class        __lowerCAmelCase					(			__magic_name__					):

			"""simple docstring"""







			@slow
			def  lowercase_       ( self				)       -> str:



							'''simple docstring'''
							__lowerCamelCase									=       EsmForProteinFolding.from_pretrained('facebook/esmfold_v1'				).float()
							model.eval()
							__lowerCamelCase									=       torch.tensor([[0, 6, 4, 13, 5, 4, 16, 12, 11, 7, 2]]				)
							__lowerCamelCase									=       model(lowerCamelCase__				)['positions']
							__lowerCamelCase									=       torch.tensor([2.58_28, 0.79_93, -10.93_34]     ,		dtype=torch.floataa				)
							self.assertTrue(torch.allclose(position_outputs[0, 0, 0, 0]     ,		lowerCamelCase__     ,		atol=1e-4				)				)


