





import copy
import inspect
import unittest

from transformers import PretrainedConfig, SwiftFormerConfig
from transformers.testing_utils import (
    require_torch,
    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 SwiftFormerForImageClassification, SwiftFormerModel
							from transformers.models.swiftformer.modeling_swiftformer import SWIFTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
							from PIL import Image

							from transformers import ViTImageProcessor

class       __A     :


				def __init__(		self   , UpperCAmelCase_   , UpperCAmelCase_=13   , UpperCAmelCase_=3   , UpperCAmelCase_=True   , UpperCAmelCase_=True   , UpperCAmelCase_=0.1   , UpperCAmelCase_=0.1   , UpperCAmelCase_=224   , UpperCAmelCase_=1000   , UpperCAmelCase_=[3, 3, 6, 4]   , UpperCAmelCase_=[48, 56, 112, 220]   , ):
								lowerCamelCase	 =parent
								lowerCamelCase	 =batch_size
								lowerCamelCase	 =num_channels
								lowerCamelCase	 =is_training
								lowerCamelCase	 =use_labels
								lowerCamelCase	 =hidden_dropout_prob
								lowerCamelCase	 =attention_probs_dropout_prob
								lowerCamelCase	 =num_labels
								lowerCamelCase	 =image_size
								lowerCamelCase	 =layer_depths
								lowerCamelCase	 =embed_dims


				def _snake_case       (		self							):
								lowerCamelCase	 =floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]							)

								lowerCamelCase	 =None
								if self.use_labels:
												lowerCamelCase	 =ids_tensor([self.batch_size]   , self.num_labels							)

								lowerCamelCase	 =self.get_config()

								return config, pixel_values, labels


				def _snake_case       (		self							):
								return SwiftFormerConfig(
								    depths=self.layer_depths   , embed_dims=self.embed_dims   , mlp_ratio=4   , downsamples=[True, True, True, True]   , hidden_act="""gelu"""   , num_labels=self.num_labels   , down_patch_size=3   , down_stride=2   , down_pad=1   , drop_rate=0.0   , drop_path_rate=0.0   , use_layer_scale=UpperCAmelCase_   , layer_scale_init_value=1E-5   , )


				def _snake_case       (		self   , UpperCAmelCase_   , UpperCAmelCase_   , UpperCAmelCase_							):
								lowerCamelCase	 =SwiftFormerModel(config=UpperCAmelCase_							)
								model.to(UpperCAmelCase_							)
								model.eval()
								lowerCamelCase	 =model(UpperCAmelCase_							)
								self.parent.assertEqual(result.last_hidden_state.shape   , (self.batch_size, self.embed_dims[-1], 7, 7)							)


				def _snake_case       (		self   , UpperCAmelCase_   , UpperCAmelCase_   , UpperCAmelCase_							):
								lowerCamelCase	 =self.num_labels
								lowerCamelCase	 =SwiftFormerForImageClassification(UpperCAmelCase_							)
								model.to(UpperCAmelCase_							)
								model.eval()
								lowerCamelCase	 =model(UpperCAmelCase_   , labels=UpperCAmelCase_							)
								self.parent.assertEqual(result.logits.shape   , (self.batch_size, self.num_labels)							)

								lowerCamelCase	 =SwiftFormerForImageClassification(UpperCAmelCase_							)
								model.to(UpperCAmelCase_							)
								model.eval()

								lowerCamelCase	 =floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]							)
								lowerCamelCase	 =model(UpperCAmelCase_							)
								self.parent.assertEqual(result.logits.shape   , (self.batch_size, self.num_labels)							)


				def _snake_case       (		self							):
								((lowerCamelCase) ,  (lowerCamelCase) ,  (lowerCamelCase))	 =self.prepare_config_and_inputs()
								lowerCamelCase	 ={"""pixel_values""": pixel_values}
								return config, inputs_dict




@require_torch
class       __A     (						a    ,					a    ,					unittest.TestCase    ):
				__A      =				(SwiftFormerModel, SwiftFormerForImageClassification) if is_torch_available() else ()
				__A      =				(
				    {"""feature-extraction""": SwiftFormerModel, """image-classification""": SwiftFormerForImageClassification}
				    if is_torch_available()
				    else {}
				)

				__A      =				False
				__A      =				False
				__A      =				False
				__A      =				False
				__A      =				False


				def _snake_case       (		self							):
								lowerCamelCase	 =SwiftFormerModelTester(self							)
								lowerCamelCase	 =ConfigTester(
								    self   , config_class=UpperCAmelCase_   , has_text_modality=UpperCAmelCase_   , hidden_size=37   , num_attention_heads=12   , num_hidden_layers=12   , )


				def _snake_case       (		self							):
								self.config_tester.run_common_tests()


				@unittest.skip(reason="""SwiftFormer does not use inputs_embeds"""							)
				def _snake_case       (		self							):
								pass


				def _snake_case       (		self							):
								lowerCamelCase ,  lowerCamelCase	 =self.model_tester.prepare_config_and_inputs_for_common()

								for model_class in self.all_model_classes:
												lowerCamelCase	 =model_class(UpperCAmelCase_							)
												lowerCamelCase	 =model.get_output_embeddings()
												self.assertTrue(x is None or isinstance(UpperCAmelCase_   , nn.Linear							)							)


				def _snake_case       (		self							):
								lowerCamelCase ,  lowerCamelCase	 =self.model_tester.prepare_config_and_inputs_for_common()

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

												lowerCamelCase	 =["""pixel_values"""]
												self.assertListEqual(arg_names[:1]   , UpperCAmelCase_							)


				def _snake_case       (		self							):
								lowerCamelCase	 =self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_model(*UpperCAmelCase_							)


				def _snake_case       (		self							):
								lowerCamelCase	 =self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_for_image_classification(*UpperCAmelCase_							)


				@slow
				def _snake_case       (		self							):
								for model_name in SWIFTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
												lowerCamelCase	 =SwiftFormerModel.from_pretrained(UpperCAmelCase_							)
												self.assertIsNotNone(UpperCAmelCase_							)


				@unittest.skip(reason="""SwiftFormer does not output attentions"""							)
				def _snake_case       (		self							):
								pass


				def _snake_case       (		self							):
								def check_hidden_states_output(UpperCAmelCase_   , UpperCAmelCase_   , UpperCAmelCase_							):
												lowerCamelCase	 =model_class(UpperCAmelCase_							)
												model.to(UpperCAmelCase_							)
												model.eval()

												with torch.no_grad():
																lowerCamelCase	 =model(**self._prepare_for_class(UpperCAmelCase_   , UpperCAmelCase_							)							)

												lowerCamelCase	 =outputs.hidden_states

												lowerCamelCase	 =8
												self.assertEqual(len(UpperCAmelCase_							)   , UpperCAmelCase_							)  # TODO

												# SwiftFormer's feature maps are of shape (batch_size, embed_dims, height, width)
												# with the width and height being successively divided by 2, after every 2 blocks
												for i in range(len(UpperCAmelCase_							)							):
																self.assertEqual(
																    hidden_states[i].shape   , torch.Size(
																        [
																            self.model_tester.batch_size,
																            self.model_tester.embed_dims[i // 2],
																            (self.model_tester.image_size // 4) // 2 ** (i // 2),
																            (self.model_tester.image_size // 4) // 2 ** (i // 2),
																        ]							)   , )

								lowerCamelCase ,  lowerCamelCase	 =self.model_tester.prepare_config_and_inputs_for_common()

								for model_class in self.all_model_classes:
												lowerCamelCase	 =True
												check_hidden_states_output(UpperCAmelCase_   , UpperCAmelCase_   , UpperCAmelCase_							)

												# check that output_hidden_states also work using config
												del inputs_dict["output_hidden_states"]
												lowerCamelCase	 =True

												check_hidden_states_output(UpperCAmelCase_   , UpperCAmelCase_   , UpperCAmelCase_							)


				def _snake_case       (		self							):
								def _config_zero_init(UpperCAmelCase_							):
												lowerCamelCase	 =copy.deepcopy(UpperCAmelCase_							)
												for key in configs_no_init.__dict__.keys():
																if "_range" in key or "_std" in key or "initializer_factor" in key or "layer_scale" in key:
																				setattr(UpperCAmelCase_   , UpperCAmelCase_   , 1E-10							)
																if isinstance(getattr(UpperCAmelCase_   , UpperCAmelCase_   , UpperCAmelCase_							)   , UpperCAmelCase_							):
																				lowerCamelCase	 =_config_zero_init(getattr(UpperCAmelCase_   , UpperCAmelCase_							)							)
																				setattr(UpperCAmelCase_   , UpperCAmelCase_   , UpperCAmelCase_							)
												return configs_no_init

								lowerCamelCase ,  lowerCamelCase	 =self.model_tester.prepare_config_and_inputs_for_common()

								lowerCamelCase	 =_config_zero_init(UpperCAmelCase_							)
								for model_class in self.all_model_classes:
												lowerCamelCase	 =model_class(config=UpperCAmelCase_							)
												for name, param in model.named_parameters():
																if param.requires_grad:
																				self.assertIn(
																				    ((param.data.mean() * 1E9) / 1E9).round().item()   , [0.0, 1.0]   , msg=f"""Parameter {name} of model {model_class} seems not properly initialized"""   , )


				@unittest.skip("""Will be fixed soon by reducing the size of the model used for common tests."""							)
				def _snake_case       (		self							):
								pass





def      _lowercase					(						)						->  Dict:
				lowerCamelCase	 =Image.open("""./tests/fixtures/tests_samples/COCO/000000039769.png"""				)
				return image




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


				@cached_property
				def _snake_case       (		self							):
								return ViTImageProcessor.from_pretrained("""MBZUAI/swiftformer-xs"""							) if is_vision_available() else None


				@slow
				def _snake_case       (		self							):
								lowerCamelCase	 =SwiftFormerForImageClassification.from_pretrained("""MBZUAI/swiftformer-xs"""							).to(UpperCAmelCase_							)

								lowerCamelCase	 =self.default_image_processor
								lowerCamelCase	 =prepare_img()
								lowerCamelCase	 =image_processor(images=UpperCAmelCase_   , return_tensors="""pt"""							).to(UpperCAmelCase_							)

								# forward pass
								with torch.no_grad():
												lowerCamelCase	 =model(**UpperCAmelCase_							)

								# verify the logits
								lowerCamelCase	 =torch.Size((1, 1000)							)
								self.assertEqual(outputs.logits.shape   , UpperCAmelCase_							)

								lowerCamelCase	 =torch.tensor([[-2.1703E00, 2.1107E00, -2.0811E00]]							).to(UpperCAmelCase_							)
								self.assertTrue(torch.allclose(outputs.logits[0, :3]   , UpperCAmelCase_   , atol=1E-4							)							)












from ..utils import DummyObject, requires_backends

class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)





def      _lowercase					(						*_UpperCAmelCase			,      **_UpperCAmelCase				)						->  int:
				requires_backends(_UpperCAmelCase			,      ["""torch"""]				)





def      _lowercase					(						*_UpperCAmelCase			,      **_UpperCAmelCase				)						->  Optional[int]:
				requires_backends(_UpperCAmelCase			,      ["""torch"""]				)





def      _lowercase					(						*_UpperCAmelCase			,      **_UpperCAmelCase				)						->  str:
				requires_backends(_UpperCAmelCase			,      ["""torch"""]				)





def      _lowercase					(						*_UpperCAmelCase			,      **_UpperCAmelCase				)						->  str:
				requires_backends(_UpperCAmelCase			,      ["""torch"""]				)





def      _lowercase					(						*_UpperCAmelCase			,      **_UpperCAmelCase				)						->  Optional[Any]:
				requires_backends(_UpperCAmelCase			,      ["""torch"""]				)





def      _lowercase					(						*_UpperCAmelCase			,      **_UpperCAmelCase				)						->  List[str]:
				requires_backends(_UpperCAmelCase			,      ["""torch"""]				)





def      _lowercase					(						*_UpperCAmelCase			,      **_UpperCAmelCase				)						->  Dict:
				requires_backends(_UpperCAmelCase			,      ["""torch"""]				)

class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)




class       __A     (						metaclass=a    ):
				__A      =				["""torch"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""torch"""]							)





