




import inspect
import unittest

from transformers import ViTConfig
from transformers.testing_utils import (
    require_accelerate,
    require_torch,
    require_torch_gpu,
    require_vision,
    slow,
    torch_device,
)
from transformers.utils import cached_property, is_torch_available, is_vision_available

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


if is_torch_available():
					import torch
					from torch import nn

					from transformers import ViTForImageClassification, ViTForMaskedImageModeling, ViTModel
					from transformers.models.vit.modeling_vit import VIT_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
					from PIL import Image

					from transformers import ViTImageProcessor

class   __a:






				"""simple docstring"""





				def __init__(				self       ,_SCREAMING_SNAKE_CASE       ,_SCREAMING_SNAKE_CASE=13       ,_SCREAMING_SNAKE_CASE=30       ,_SCREAMING_SNAKE_CASE=2       ,_SCREAMING_SNAKE_CASE=3       ,_SCREAMING_SNAKE_CASE=True       ,_SCREAMING_SNAKE_CASE=True       ,_SCREAMING_SNAKE_CASE=32       ,_SCREAMING_SNAKE_CASE=5       ,_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=10       ,_SCREAMING_SNAKE_CASE=0.02       ,_SCREAMING_SNAKE_CASE=None       ,_SCREAMING_SNAKE_CASE=2       ,)			->		Union[str, Any]:
									UpperCAmelCase_      :							List[str]       =      parent
									UpperCAmelCase_      :							Union[str, Any]       =      batch_size
									UpperCAmelCase_      :							Dict       =      image_size
									UpperCAmelCase_      :							Any       =      patch_size
									UpperCAmelCase_      :							Optional[Any]       =      num_channels
									UpperCAmelCase_      :							str       =      is_training
									UpperCAmelCase_      :							List[str]       =      use_labels
									UpperCAmelCase_      :							int       =      hidden_size
									UpperCAmelCase_      :							Optional[int]       =      num_hidden_layers
									UpperCAmelCase_      :							Optional[Any]       =      num_attention_heads
									UpperCAmelCase_      :							Tuple       =      intermediate_size
									UpperCAmelCase_      :							Any       =      hidden_act
									UpperCAmelCase_      :							int       =      hidden_dropout_prob
									UpperCAmelCase_      :							int       =      attention_probs_dropout_prob
									UpperCAmelCase_      :							Optional[Any]       =      type_sequence_label_size
									UpperCAmelCase_      :							Optional[int]       =      initializer_range
									UpperCAmelCase_      :							Any       =      scope
									UpperCAmelCase_      :							List[str]       =      encoder_stride

									# in ViT, the seq length equals the number of patches + 1 (we add 1 for the [CLS] token)
									UpperCAmelCase_      :							Tuple       =      (image_size // patch_size) ** 2
									UpperCAmelCase_      :							Union[str, Any]       =      num_patches + 1





				def 							a__				(				self  )			->		int:
									UpperCAmelCase_      :							Any       =      floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]  )

									UpperCAmelCase_      :							Union[str, Any]       =      None
									if self.use_labels:
														UpperCAmelCase_      :							Optional[int]       =      ids_tensor([self.batch_size]       ,self.type_sequence_label_size  )

									UpperCAmelCase_      :							Union[str, Any]       =      self.get_config()

									return config, pixel_values, labels





				def 							a__				(				self  )			->		Tuple:
									return ViTConfig(
									    image_size=self.image_size       ,patch_size=self.patch_size       ,num_channels=self.num_channels       ,hidden_size=self.hidden_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       ,is_decoder=_SCREAMING_SNAKE_CASE       ,initializer_range=self.initializer_range       ,encoder_stride=self.encoder_stride       ,)





				def 							a__				(				self       ,_SCREAMING_SNAKE_CASE       ,_SCREAMING_SNAKE_CASE       ,_SCREAMING_SNAKE_CASE  )			->		Optional[int]:
									UpperCAmelCase_      :							Dict       =      ViTModel(config=_SCREAMING_SNAKE_CASE  )
									model.to(_SCREAMING_SNAKE_CASE  )
									model.eval()
									UpperCAmelCase_      :							List[Any]       =      model(_SCREAMING_SNAKE_CASE  )
									self.parent.assertEqual(result.last_hidden_state.shape       ,(self.batch_size, self.seq_length, self.hidden_size)  )





				def 							a__				(				self       ,_SCREAMING_SNAKE_CASE       ,_SCREAMING_SNAKE_CASE       ,_SCREAMING_SNAKE_CASE  )			->		Union[str, Any]:
									UpperCAmelCase_      :							Union[str, Any]       =      ViTForMaskedImageModeling(config=_SCREAMING_SNAKE_CASE  )
									model.to(_SCREAMING_SNAKE_CASE  )
									model.eval()
									UpperCAmelCase_      :							int       =      model(_SCREAMING_SNAKE_CASE  )
									self.parent.assertEqual(
									    result.reconstruction.shape       ,(self.batch_size, self.num_channels, self.image_size, self.image_size)  )

									# test greyscale images
									UpperCAmelCase_      :							Optional[Any]       =      1
									UpperCAmelCase_      :							str       =      ViTForMaskedImageModeling(_SCREAMING_SNAKE_CASE  )
									model.to(_SCREAMING_SNAKE_CASE  )
									model.eval()

									UpperCAmelCase_      :							Union[str, Any]       =      floats_tensor([self.batch_size, 1, self.image_size, self.image_size]  )
									UpperCAmelCase_      :							Optional[int]       =      model(_SCREAMING_SNAKE_CASE  )
									self.parent.assertEqual(result.reconstruction.shape       ,(self.batch_size, 1, self.image_size, self.image_size)  )





				def 							a__				(				self       ,_SCREAMING_SNAKE_CASE       ,_SCREAMING_SNAKE_CASE       ,_SCREAMING_SNAKE_CASE  )			->		Union[str, Any]:
									UpperCAmelCase_      :							int       =      self.type_sequence_label_size
									UpperCAmelCase_      :							str       =      ViTForImageClassification(_SCREAMING_SNAKE_CASE  )
									model.to(_SCREAMING_SNAKE_CASE  )
									model.eval()
									UpperCAmelCase_      :							str       =      model(_SCREAMING_SNAKE_CASE       ,labels=_SCREAMING_SNAKE_CASE  )
									self.parent.assertEqual(result.logits.shape       ,(self.batch_size, self.type_sequence_label_size)  )

									# test greyscale images
									UpperCAmelCase_      :							Dict       =      1
									UpperCAmelCase_      :							int       =      ViTForImageClassification(_SCREAMING_SNAKE_CASE  )
									model.to(_SCREAMING_SNAKE_CASE  )
									model.eval()

									UpperCAmelCase_      :							Any       =      floats_tensor([self.batch_size, 1, self.image_size, self.image_size]  )
									UpperCAmelCase_      :							Dict       =      model(_SCREAMING_SNAKE_CASE  )
									self.parent.assertEqual(result.logits.shape       ,(self.batch_size, self.type_sequence_label_size)  )





				def 							a__				(				self  )			->		List[str]:
									UpperCAmelCase_      :							Tuple       =      self.prepare_config_and_inputs()
									(
									    UpperCAmelCase_   
									)      :							List[Any]       =      config_and_inputs
									UpperCAmelCase_      :							List[Any]       =      {'''pixel_values''': pixel_values}
									return config, inputs_dict


@require_torch
class   __a(					_a    ,						_a    ,						unittest.TestCase       ):






				"""simple docstring"""





				lowerCAmelCase        =				(
				    (
				        ViTModel,
				        ViTForImageClassification,
				        ViTForMaskedImageModeling,
				    )
				    if is_torch_available()
				    else ()
				)
				lowerCAmelCase        =				(
				    {'''feature-extraction''': ViTModel, '''image-classification''': ViTForImageClassification}
				    if is_torch_available()
				    else {}
				)
				lowerCAmelCase        =				True

				lowerCAmelCase        =				False
				lowerCAmelCase        =				False
				lowerCAmelCase        =				False





				def 							a__				(				self  )			->		Tuple:
									UpperCAmelCase_      :							List[str]       =      ViTModelTester(self  )
									UpperCAmelCase_      :							Dict       =      ConfigTester(self       ,config_class=_SCREAMING_SNAKE_CASE       ,has_text_modality=_SCREAMING_SNAKE_CASE       ,hidden_size=37  )





				def 							a__				(				self  )			->		int:
									self.config_tester.run_common_tests()





				@unittest.skip(reason='''ViT does not use inputs_embeds'''  )
				def 							a__				(				self  )			->		Optional[Any]:
									pass





				def 							a__				(				self  )			->		Dict:
									UpperCAmelCase_      :							Tuple       =      self.model_tester.prepare_config_and_inputs_for_common()

									for model_class in self.all_model_classes:
														UpperCAmelCase_      :							str       =      model_class(_SCREAMING_SNAKE_CASE  )
														self.assertIsInstance(model.get_input_embeddings()       ,(nn.Module)  )
														UpperCAmelCase_      :							int       =      model.get_output_embeddings()
														self.assertTrue(x is None or isinstance(_SCREAMING_SNAKE_CASE       ,nn.Linear  )  )





				def 							a__				(				self  )			->		Optional[int]:
									UpperCAmelCase_      :							Tuple       =      self.model_tester.prepare_config_and_inputs_for_common()

									for model_class in self.all_model_classes:
														UpperCAmelCase_      :							Any       =      model_class(_SCREAMING_SNAKE_CASE  )
														UpperCAmelCase_      :							Optional[int]       =      inspect.signature(model.forward  )
														# signature.parameters is an OrderedDict => so arg_names order is deterministic
														UpperCAmelCase_      :							str       =      [*signature.parameters.keys()]

														UpperCAmelCase_      :							str       =      ['''pixel_values''']
														self.assertListEqual(arg_names[:1]       ,_SCREAMING_SNAKE_CASE  )





				def 							a__				(				self  )			->		List[Any]:
									UpperCAmelCase_      :							List[str]       =      self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_model(*_SCREAMING_SNAKE_CASE  )





				def 							a__				(				self  )			->		List[str]:
									UpperCAmelCase_      :							Optional[Any]       =      self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_for_masked_image_modeling(*_SCREAMING_SNAKE_CASE  )





				def 							a__				(				self  )			->		Tuple:
									UpperCAmelCase_      :							Any       =      self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_for_image_classification(*_SCREAMING_SNAKE_CASE  )





				@slow
				def 							a__				(				self  )			->		Dict:
									for model_name in VIT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
														UpperCAmelCase_      :							List[str]       =      ViTModel.from_pretrained(_SCREAMING_SNAKE_CASE  )
														self.assertIsNotNone(_SCREAMING_SNAKE_CASE  )







def lowerCamelCase__       (      ):

					'''simple docstring'''


					UpperCAmelCase_      :							Optional[int]       =      Image.open('''./tests/fixtures/tests_samples/COCO/000000039769.png'''				)
					return image



@require_torch
@require_vision
class   __a(					unittest.TestCase       ):






				"""simple docstring"""





				@cached_property
				def 							a__				(				self  )			->		Tuple:
									return ViTImageProcessor.from_pretrained('''google/vit-base-patch16-224'''  ) if is_vision_available() else None





				@slow
				def 							a__				(				self  )			->		Union[str, Any]:
									UpperCAmelCase_      :							Dict       =      ViTForImageClassification.from_pretrained('''google/vit-base-patch16-224'''  ).to(_SCREAMING_SNAKE_CASE  )

									UpperCAmelCase_      :							Tuple       =      self.default_image_processor
									UpperCAmelCase_      :							Tuple       =      prepare_img()
									UpperCAmelCase_      :							Tuple       =      image_processor(images=_SCREAMING_SNAKE_CASE       ,return_tensors='''pt'''  ).to(_SCREAMING_SNAKE_CASE  )

									# forward pass
									with torch.no_grad():
														UpperCAmelCase_      :							Union[str, Any]       =      model(**_SCREAMING_SNAKE_CASE  )

									# verify the logits
									UpperCAmelCase_      :							Optional[int]       =      torch.Size((1, 1_000)  )
									self.assertEqual(outputs.logits.shape       ,_SCREAMING_SNAKE_CASE  )

									UpperCAmelCase_      :							Any       =      torch.tensor([-0.27_44, 0.82_15, -0.08_36]  ).to(_SCREAMING_SNAKE_CASE  )

									self.assertTrue(torch.allclose(outputs.logits[0, :3]       ,_SCREAMING_SNAKE_CASE       ,atol=1e-4  )  )





				@slow
				def 							a__				(				self  )			->		Dict:
									# ViT models have an `interpolate_pos_encoding` argument in their forward method,
									# allowing to interpolate the pre-trained position embeddings in order to use
									# the model on higher resolutions. The DINO model by Facebook AI leverages this
									# to visualize self-attention on higher resolution images.
									UpperCAmelCase_      :							Optional[int]       =      ViTModel.from_pretrained('''facebook/dino-vits8'''  ).to(_SCREAMING_SNAKE_CASE  )

									UpperCAmelCase_      :							Tuple       =      ViTImageProcessor.from_pretrained('''facebook/dino-vits8'''       ,size=480  )
									UpperCAmelCase_      :							Tuple       =      prepare_img()
									UpperCAmelCase_      :							List[Any]       =      image_processor(images=_SCREAMING_SNAKE_CASE       ,return_tensors='''pt'''  )
									UpperCAmelCase_      :							List[str]       =      inputs.pixel_values.to(_SCREAMING_SNAKE_CASE  )

									# forward pass
									with torch.no_grad():
														UpperCAmelCase_      :							Tuple       =      model(_SCREAMING_SNAKE_CASE       ,interpolate_pos_encoding=_SCREAMING_SNAKE_CASE  )

									# verify the logits
									UpperCAmelCase_      :							str       =      torch.Size((1, 3_601, 384)  )
									self.assertEqual(outputs.last_hidden_state.shape       ,_SCREAMING_SNAKE_CASE  )

									UpperCAmelCase_      :							Optional[Any]       =      torch.tensor(
									    [[4.23_40, 4.39_06, -6.66_92], [4.54_63, 1.89_28, -6.72_57], [4.44_29, 0.84_96, -5.85_85]]  ).to(_SCREAMING_SNAKE_CASE  )

									self.assertTrue(torch.allclose(outputs.last_hidden_state[0, :3, :3]       ,_SCREAMING_SNAKE_CASE       ,atol=1e-4  )  )





				@slow
				@require_accelerate
				@require_torch_gpu
				def 							a__				(				self  )			->		Dict:
									UpperCAmelCase_      :							Optional[int]       =      ViTModel.from_pretrained('''facebook/dino-vits8'''       ,torch_dtype=torch.floataa       ,device_map='''auto'''  )
									UpperCAmelCase_      :							Any       =      self.default_image_processor

									UpperCAmelCase_      :							Any       =      prepare_img()
									UpperCAmelCase_      :							Any       =      image_processor(images=_SCREAMING_SNAKE_CASE       ,return_tensors='''pt'''  )
									UpperCAmelCase_      :							str       =      inputs.pixel_values.to(_SCREAMING_SNAKE_CASE  )

									# forward pass to make sure inference works in fp16
									with torch.no_grad():
														UpperCAmelCase_      :							int       =      model(_SCREAMING_SNAKE_CASE  )





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   __a:






    """simple docstring"""





    def __init__(				self       ,_SCREAMING_SNAKE_CASE       ,_SCREAMING_SNAKE_CASE=13       ,_SCREAMING_SNAKE_CASE=7       ,_SCREAMING_SNAKE_CASE=False       ,_SCREAMING_SNAKE_CASE=True       ,_SCREAMING_SNAKE_CASE=False       ,_SCREAMING_SNAKE_CASE=False       ,_SCREAMING_SNAKE_CASE=19       ,_SCREAMING_SNAKE_CASE=32       ,_SCREAMING_SNAKE_CASE=5       ,_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       ,)			->		Dict:
         UpperCAmelCase_      :							Optional[Any]       =      parent
         UpperCAmelCase_      :							Dict       =      batch_size
         UpperCAmelCase_      :							Optional[int]       =      seq_length
         UpperCAmelCase_      :							Union[str, Any]       =      is_training
         UpperCAmelCase_      :							Any       =      use_input_mask
         UpperCAmelCase_      :							Tuple       =      use_token_type_ids
         UpperCAmelCase_      :							Optional[int]       =      use_labels
         UpperCAmelCase_      :							List[Any]       =      vocab_size
         UpperCAmelCase_      :							List[Any]       =      hidden_size
         UpperCAmelCase_      :							str       =      num_hidden_layers
         UpperCAmelCase_      :							Dict       =      num_attention_heads
         UpperCAmelCase_      :							Optional[Any]       =      intermediate_size
         UpperCAmelCase_      :							str       =      hidden_act
         UpperCAmelCase_      :							int       =      hidden_dropout_prob
         UpperCAmelCase_      :							List[Any]       =      attention_probs_dropout_prob
         UpperCAmelCase_      :							Optional[int]       =      max_position_embeddings
         UpperCAmelCase_      :							Optional[int]       =      type_vocab_size
         UpperCAmelCase_      :							Any       =      type_sequence_label_size
         UpperCAmelCase_      :							int       =      initializer_range
         UpperCAmelCase_      :							Any       =      num_labels
         UpperCAmelCase_      :							Optional[Any]       =      num_choices
         UpperCAmelCase_      :							List[str]       =      scope





    def 							a__				(				self  )			->		Optional[Any]:
         UpperCAmelCase_      :							List[Any]       =      ids_tensor([self.batch_size, self.seq_length]       ,self.vocab_size  )

         UpperCAmelCase_      :							str       =      None
         if self.use_input_mask:
              UpperCAmelCase_      :							Optional[int]       =      random_attention_mask([self.batch_size, self.seq_length]  )

         UpperCAmelCase_      :							Union[str, Any]       =      None
         UpperCAmelCase_      :							List[str]       =      None
         UpperCAmelCase_      :							Optional[Any]       =      None
         if self.use_labels:
              UpperCAmelCase_      :							Optional[int]       =      ids_tensor([self.batch_size]       ,self.type_sequence_label_size  )
              UpperCAmelCase_      :							List[str]       =      ids_tensor([self.batch_size, self.seq_length]       ,self.num_labels  )
              UpperCAmelCase_      :							Optional[int]       =      ids_tensor([self.batch_size]       ,self.num_choices  )

         UpperCAmelCase_      :							Optional[Any]       =      self.get_config()

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





    def 							a__				(				self  )			->		List[str]:
         UpperCAmelCase_      :							Union[str, Any]       =      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=_SCREAMING_SNAKE_CASE       ,esmfold_config={'''trunk''': {'''num_blocks''': 2}, '''fp16_esm''': False}       ,)
         return config





    def 							a__				(				self       ,_SCREAMING_SNAKE_CASE       ,_SCREAMING_SNAKE_CASE       ,_SCREAMING_SNAKE_CASE       ,_SCREAMING_SNAKE_CASE       ,_SCREAMING_SNAKE_CASE       ,_SCREAMING_SNAKE_CASE  )			->		int:
         UpperCAmelCase_      :							Optional[int]       =      EsmForProteinFolding(config=_SCREAMING_SNAKE_CASE  ).float()
         model.to(_SCREAMING_SNAKE_CASE  )
         model.eval()
         UpperCAmelCase_      :							Union[str, Any]       =      model(_SCREAMING_SNAKE_CASE       ,attention_mask=_SCREAMING_SNAKE_CASE  )
         UpperCAmelCase_      :							List[str]       =      model(_SCREAMING_SNAKE_CASE  )
         UpperCAmelCase_      :							Any       =      model(_SCREAMING_SNAKE_CASE  )

         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 							a__				(				self  )			->		Optional[Any]:
         UpperCAmelCase_      :							int       =      self.prepare_config_and_inputs()
         (
             (
             UpperCAmelCase_
         ),   (
             UpperCAmelCase_
         ),   (
             UpperCAmelCase_
         ),   (
             UpperCAmelCase_
         ),   (
             UpperCAmelCase_
         ),   (
             UpperCAmelCase_
         ),   
         )      :							Optional[Any]       =      config_and_inputs
         UpperCAmelCase_      :							int       =      {'''input_ids''': input_ids, '''attention_mask''': input_mask}
         return config, inputs_dict


@require_torch
class   __a(					_a    ,						_a    ,						unittest.TestCase       ):






    """simple docstring"""





    lowerCAmelCase        =				False

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





    def 							a__				(				self  )			->		List[str]:
         UpperCAmelCase_      :							Optional[int]       =      EsmFoldModelTester(self  )
         UpperCAmelCase_      :							int       =      ConfigTester(self       ,config_class=_SCREAMING_SNAKE_CASE       ,hidden_size=37  )





    def 							a__				(				self  )			->		Tuple:
         self.config_tester.run_common_tests()





    def 							a__				(				self  )			->		Dict:
         UpperCAmelCase_      :							Optional[Any]       =      self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_model(*_SCREAMING_SNAKE_CASE  )





    @unittest.skip('''Does not support attention outputs'''  )
    def 							a__				(				self  )			->		Optional[int]:
         pass





    @unittest.skip
    def 							a__				(				self  )			->		Dict:
         pass





    @unittest.skip('''Esm does not support embedding resizing'''  )
    def 							a__				(				self  )			->		Union[str, Any]:
         pass





    @unittest.skip('''Esm does not support embedding resizing'''  )
    def 							a__				(				self  )			->		List[Any]:
         pass





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





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





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





    @unittest.skip('''ESMFold does not support head pruning.'''  )
    def 							a__				(				self  )			->		Optional[int]:
         pass





    @unittest.skip('''ESMFold does not support head pruning.'''  )
    def 							a__				(				self  )			->		Optional[int]:
         pass





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





    @unittest.skip('''ESMFold does not output hidden states in the normal way.'''  )
    def 							a__				(				self  )			->		str:
         pass





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





    @unittest.skip('''ESMFold only has one output format.'''  )
    def 							a__				(				self  )			->		Optional[int]:
         pass





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





    @unittest.skip('''ESMFold does not support input chunking.'''  )
    def 							a__				(				self  )			->		List[Any]:
         pass





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





    @unittest.skip('''ESMFold doesn\'t support torchscript compilation.'''  )
    def 							a__				(				self  )			->		Optional[int]:
         pass





    @unittest.skip('''ESMFold doesn\'t support torchscript compilation.'''  )
    def 							a__				(				self  )			->		List[str]:
         pass





    @unittest.skip('''ESMFold doesn\'t support torchscript compilation.'''  )
    def 							a__				(				self  )			->		Tuple:
         pass





    @unittest.skip('''ESMFold doesn\'t support data parallel.'''  )
    def 							a__				(				self  )			->		Dict:
         pass





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


@require_torch
class   __a(					_a       ):






    """simple docstring"""





    @slow
    def 							a__				(				self  )			->		List[Any]:
         UpperCAmelCase_      :							List[str]       =      EsmForProteinFolding.from_pretrained('''facebook/esmfold_v1'''  ).float()
         model.eval()
         UpperCAmelCase_      :							str       =      torch.tensor([[0, 6, 4, 13, 5, 4, 16, 12, 11, 7, 2]]  )
         UpperCAmelCase_      :							Optional[int]       =      model(_SCREAMING_SNAKE_CASE  )['''positions''']
         UpperCAmelCase_      :							List[str]       =      torch.tensor([2.58_28, 0.79_93, -10.93_34]       ,dtype=torch.floataa  )
         self.assertTrue(torch.allclose(position_outputs[0, 0, 0, 0]       ,_SCREAMING_SNAKE_CASE       ,atol=1e-4  )  )