




"""simple docstring"""







import argparse
import json
import os

import fairseq
import torch
from torch import nn

from transformers import (
    SpeechaTextaConfig,
    SpeechaTextaForCausalLM,
    SpeechaTextaTokenizer,
    SpeechEncoderDecoderConfig,
    SpeechEncoderDecoderModel,
    WavaVecaConfig,
    WavaVecaFeatureExtractor,
    WavaVecaModel,
    logging,
)


logging.set_verbosity_info()
SCREAMING_SNAKE_CASE_	     =       logging.get_logger(__name__)

SCREAMING_SNAKE_CASE_	     =       {
    'post_extract_proj': 'feature_projection.projection',
    'encoder.pos_conv.0': 'encoder.pos_conv_embed.conv',
    'self_attn.k_proj': 'encoder.layers.*.attention.k_proj',
    'self_attn.v_proj': 'encoder.layers.*.attention.v_proj',
    'self_attn.q_proj': 'encoder.layers.*.attention.q_proj',
    'self_attn.out_proj': 'encoder.layers.*.attention.out_proj',
    'self_attn_layer_norm': 'encoder.layers.*.layer_norm',
    'fc1': 'encoder.layers.*.feed_forward.intermediate_dense',
    'fc2': 'encoder.layers.*.feed_forward.output_dense',
    'final_layer_norm': 'encoder.layers.*.final_layer_norm',
    'encoder.layer_norm': 'encoder.layer_norm',
    'w2v_model.layer_norm': 'feature_projection.layer_norm',
    'quantizer.weight_proj': 'quantizer.weight_proj',
    'quantizer.vars': 'quantizer.codevectors',
    'project_q': 'project_q',
    'final_proj': 'project_hid',
    'w2v_encoder.proj': 'lm_head',
    'mask_emb': 'masked_spec_embed',
}
SCREAMING_SNAKE_CASE_	     =       [
    'lm_head',
    'quantizer.weight_proj',
    'quantizer.codevectors',
    'project_q',
    'project_hid',
]





def      __snake_case (				_lowercase			,_lowercase			,_lowercase			,_lowercase			,_lowercase    ):


    """simple docstring"""







    for attribute in key.split('''.'''    ):
        UpperCamelCase              =	getattr(_A			,_A    )

    if weight_type is not None:
        UpperCamelCase              =	getattr(_A			,_A    ).shape
    else:
        UpperCamelCase              =	hf_pointer.shape

    assert hf_shape == value.shape, (
        f'Shape of hf {key + "." + weight_type if weight_type is not None else ""} is {hf_shape}, but should be'
        f' {value.shape} for {full_name}'
    )

    if weight_type == "weight":
        UpperCamelCase              =	value
    elif weight_type == "weight_g":
        UpperCamelCase              =	value
    elif weight_type == "weight_v":
        UpperCamelCase              =	value
    elif weight_type == "bias":
        UpperCamelCase              =	value
    else:
        UpperCamelCase              =	value

    logger.info(f'{key + "." + weight_type if weight_type is not None else ""} was initialized from {full_name}.'    )





def      __snake_case (				_lowercase			,_lowercase    ):


    """simple docstring"""







    UpperCamelCase              =	[]
    UpperCamelCase              =	fairseq_model.state_dict()

    UpperCamelCase              =	hf_model.feature_extractor

    # if encoder has different dim to decoder -> use proj_weight
    UpperCamelCase              =	None

    for name, value in fairseq_dict.items():
        UpperCamelCase              =	False
        if "conv_layers" in name:
            load_conv_layer(
                _A			,_A			,_A			,_A			,hf_model.config.feat_extract_norm == '''group'''			,)
            UpperCamelCase              =	True
        elif name.split('''.'''    )[0] == "proj":
            UpperCamelCase              =	fairseq_model.proj
            UpperCamelCase              =	True
        else:
            for key, mapped_key in MAPPING.items():
                if key in name or key.split('''w2v_model.'''    )[-1] == name.split('''.'''    )[0]:
                    UpperCamelCase              =	True
                    if "*" in mapped_key:
                        UpperCamelCase              =	name.split(_A    )[0].split('''.'''    )[-2]
                        UpperCamelCase              =	mapped_key.replace('''*'''			,_A    )
                    if "weight_g" in name:
                        UpperCamelCase              =	"""weight_g"""
                    elif "weight_v" in name:
                        UpperCamelCase              =	"""weight_v"""
                    elif "bias" in name:
                        UpperCamelCase              =	"""bias"""
                    elif "weight" in name:
                        UpperCamelCase              =	"""weight"""
                    else:
                        UpperCamelCase              =	None
                    set_recursively(_A			,_A			,_A			,_A			,_A    )
                continue
        if not is_used:
            unused_weights.append(_A    )

    logger.warning(f'Unused weights: {unused_weights}'    )

    return proj_weight





def      __snake_case (				_lowercase			,_lowercase			,_lowercase			,_lowercase			,_lowercase    ):


    """simple docstring"""







    UpperCamelCase              =	full_name.split('''conv_layers.'''    )[-1]
    UpperCamelCase              =	name.split('''.'''    )
    UpperCamelCase              =	int(items[0]    )
    UpperCamelCase              =	int(items[1]    )

    if type_id == 0:
        if "bias" in name:
            assert value.shape == feature_extractor.conv_layers[layer_id].conv.bias.data.shape, (
                f'{full_name} has size {value.shape}, but'
                f' {feature_extractor.conv_layers[layer_id].conv.bias.data.shape} was found.'
            )
            UpperCamelCase              =	value
            logger.info(f'Feat extract conv layer {layer_id} was initialized from {full_name}.'    )
        elif "weight" in name:
            assert value.shape == feature_extractor.conv_layers[layer_id].conv.weight.data.shape, (
                f'{full_name} has size {value.shape}, but'
                f' {feature_extractor.conv_layers[layer_id].conv.weight.data.shape} was found.'
            )
            UpperCamelCase              =	value
            logger.info(f'Feat extract conv layer {layer_id} was initialized from {full_name}.'    )
    elif (type_id == 2 and not use_group_norm) or (type_id == 2 and layer_id == 0 and use_group_norm):
        if "bias" in name:
            assert value.shape == feature_extractor.conv_layers[layer_id].layer_norm.bias.data.shape, (
                f'{full_name} has size {value.shape}, but {feature_extractor[layer_id].layer_norm.bias.data.shape} was'
                " found."
            )
            UpperCamelCase              =	value
            logger.info(f'Feat extract layer norm weight of layer {layer_id} was initialized from {full_name}.'    )
        elif "weight" in name:
            assert value.shape == feature_extractor.conv_layers[layer_id].layer_norm.weight.data.shape, (
                f'{full_name} has size {value.shape}, but'
                f' {feature_extractor[layer_id].layer_norm.weight.data.shape} was found.'
            )
            UpperCamelCase              =	value
            logger.info(f'Feat extract layer norm weight of layer {layer_id} was initialized from {full_name}.'    )
    else:
        unused_weights.append(_A    )





def      __snake_case (				_lowercase    ):


    """simple docstring"""







    UpperCamelCase              =	emb.weight.shape
    UpperCamelCase              =	nn.Linear(_A			,_A			,bias=_A    )
    UpperCamelCase              =	emb.weight.data
    return lin_layer





def      __snake_case (				_lowercase    ):


    """simple docstring"""







    with open(_A			,'''r'''			,encoding='''utf-8'''    ) as f:
        UpperCamelCase              =	f.readlines()
        UpperCamelCase              =	[line.split(''' '''    )[0] for line in lines]

    UpperCamelCase              =	len(_A    )

    UpperCamelCase              =	{
        """<s>""": 0,
        """<pad>""": 1,
        """</s>""": 2,
        """<unk>""": 3,
    }

    vocab_dict.update(dict(zip(_A			,range(4			,num_words + 4    )    )    )    )
    return vocab_dict





@torch.no_grad()
def      __snake_case (				_lowercase			,_lowercase			,_lowercase			,_lowercase			,_lowercase			,_lowercase			,_lowercase			,):


    """simple docstring"""







    UpperCamelCase              =	WavaVecaConfig.from_pretrained(_A    )
    UpperCamelCase              =	SpeechaTextaConfig.from_pretrained(
        _A			,vocab_size=_A			,decoder_layers=_A			,do_stable_layer_norm=_A    )

    UpperCamelCase              =	WavaVecaFeatureExtractor(
        feature_size=1			,sampling_rate=1_6000			,padding_value=0			,do_normalize=_A			,return_attention_mask=_A			,)

    UpperCamelCase              =	fairseq.checkpoint_utils.load_model_ensemble_and_task(
        [checkpoint_path]			,arg_overrides={'''data''': '''/'''.join(dict_path.split('''/'''    )[:-1]    )}    )
    UpperCamelCase              =	model[0].eval()

    # set weights for wav2vec2 encoder
    UpperCamelCase              =	WavaVecaModel(_A    )
    UpperCamelCase              =	recursively_load_weights_wavaveca(model.encoder			,_A    )

    UpperCamelCase              =	SpeechaTextaForCausalLM(_A    )
    UpperCamelCase              =	hf_decoder.model.decoder.load_state_dict(model.decoder.state_dict()			,strict=_A    )

    # set output linear layer
    unexpected_keys.remove('''embed_out'''    )
    UpperCamelCase              =	nn.Parameter(model.decoder.embed_out.detach()    )

    # layer norm is init to identity matrix so leaving it is fine
    logger.warning(f'The following keys are missing when loading the decoder weights: {missing_keys}'    )
    logger.warning(f'The following keys are unexpected when loading the decoder weights: {unexpected_keys}'    )

    UpperCamelCase              =	SpeechEncoderDecoderModel(encoder=_A			,decoder=_A    )
    UpperCamelCase              =	False

    # add projection layer
    UpperCamelCase              =	nn.Parameter(projection_layer.weight    )
    UpperCamelCase              =	nn.Parameter(projection_layer.bias    )

    UpperCamelCase              =	create_vocab_dict(_A    )

    with open(os.path.join(_A			,'''vocab.json'''    )			,'''w'''    ) as fp:
        json.dump(_A			,_A    )

    UpperCamelCase              =	SpeechaTextaTokenizer(os.path.join(_A			,'''vocab.json'''    )    )
    tokenizer.save_pretrained(_A    )

    UpperCamelCase              =	hf_wavavec.config.to_dict()
    UpperCamelCase              =	tokenizer.pad_token_id
    UpperCamelCase              =	tokenizer.bos_token_id
    UpperCamelCase              =	tokenizer.eos_token_id
    UpperCamelCase              =	"""speech_to_text_2"""
    UpperCamelCase              =	"""wav2vec2"""

    UpperCamelCase              =	SpeechEncoderDecoderConfig.from_dict(_A    )

    hf_wavavec.save_pretrained(_A    )
    feature_extractor.save_pretrained(_A    )


if __name__ == "__main__":
  SCREAMING_SNAKE_CASE_	     =       argparse.ArgumentParser()
  parser.add_argument('--pytorch_dump_folder_path', default=None, type=str, help='Path to the output PyTorch model.')
  parser.add_argument('--checkpoint_path', default=None, type=str, help='Path to fairseq checkpoint')
  parser.add_argument('--dict_path', default=None, type=str, help='Path to dict of fine-tuned model')
  parser.add_argument(
      '--encoder_config_path',
      default='facebook/wav2vec2-large-lv60',
      type=str,
      help='Path to hf encoder wav2vec2 checkpoint config',
  )
  parser.add_argument(
      '--decoder_config_path',
      default='facebook/s2t-small-mustc-en-fr-st',
      type=str,
      help='Path to hf decoder s2t checkpoint config',
  )
  parser.add_argument('--vocab_size', default=10224, type=int, help='Vocab size of decoder')
  parser.add_argument('--num_decoder_layers', default=7, type=int, help='Number of decoder layers')

  SCREAMING_SNAKE_CASE_	     =       parser.parse_args()
  convert_wavaveca_checkpoint(
      args.checkpoint_path,
      args.pytorch_dump_folder_path,
      args.dict_path,
      encoder_config_path=args.encoder_config_path,
      decoder_config_path=args.decoder_config_path,
      vocab_size=args.vocab_size,
      num_decoder_layers=args.num_decoder_layers,
  )







"""simple docstring"""







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






						def __init__(		self  :Union[str, Any]			, __magic_name__  :Any			, __magic_name__  :List[str]=13			, __magic_name__  :Any=3			, __magic_name__  :str=True			, __magic_name__  :int=True			, __magic_name__  :Dict=0.1			, __magic_name__  :Optional[int]=0.1			, __magic_name__  :List[str]=224			, __magic_name__  :Any=1_000			, __magic_name__  :int=[3, 3, 6, 4]			, __magic_name__  :int=[48, 56, 112, 220]			, )      ->int:
										lowercase    :      Dict       = parent
										lowercase    :      List[str]       = batch_size
										lowercase    :      Union[str, Any]       = num_channels
										lowercase    :      Dict       = is_training
										lowercase    :      Any       = use_labels
										lowercase    :      Dict       = hidden_dropout_prob
										lowercase    :      Union[str, Any]       = attention_probs_dropout_prob
										lowercase    :      Optional[Any]       = num_labels
										lowercase    :      Optional[Any]       = image_size
										lowercase    :      Optional[int]       = layer_depths
										lowercase    :      Optional[int]       = embed_dims






						def      __snake_case      (		self  :Tuple				)      ->str:
										lowercase    :      Dict       = floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]				)

										lowercase    :      Optional[Any]       = None
										if self.use_labels:
														lowercase    :      str       = ids_tensor([self.batch_size]			, self.num_labels				)

										lowercase    :      List[Any]       = self.get_config()

										return config, pixel_values, labels






						def      __snake_case      (		self  :Dict				)      ->Union[str, Any]:
										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=__magic_name__			, layer_scale_init_value=1E-5			, )






						def      __snake_case      (		self  :List[str]			, __magic_name__  :Union[str, Any]			, __magic_name__  :Dict			, __magic_name__  :Dict				)      ->Optional[Any]:
										lowercase    :      Optional[int]       = SwiftFormerModel(config=__magic_name__				)
										model.to(__magic_name__				)
										model.eval()
										lowercase    :      Union[str, Any]       = model(__magic_name__				)
										self.parent.assertEqual(result.last_hidden_state.shape			, (self.batch_size, self.embed_dims[-1], 7, 7)				)






						def      __snake_case      (		self  :Any			, __magic_name__  :Any			, __magic_name__  :Tuple			, __magic_name__  :Any				)      ->Union[str, Any]:
										lowercase    :      Optional[int]       = self.num_labels
										lowercase    :      List[str]       = SwiftFormerForImageClassification(__magic_name__				)
										model.to(__magic_name__				)
										model.eval()
										lowercase    :      List[Any]       = model(__magic_name__			, labels=__magic_name__				)
										self.parent.assertEqual(result.logits.shape			, (self.batch_size, self.num_labels)				)

										lowercase    :      Union[str, Any]       = SwiftFormerForImageClassification(__magic_name__				)
										model.to(__magic_name__				)
										model.eval()

										lowercase    :      Tuple       = floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]				)
										lowercase    :      Union[str, Any]       = model(__magic_name__				)
										self.parent.assertEqual(result.logits.shape			, (self.batch_size, self.num_labels)				)






						def      __snake_case      (		self  :Union[str, Any]				)      ->Optional[int]:
										((lowercase)      ,      (lowercase)      ,      (lowercase))    :      Optional[Any]       = self.prepare_config_and_inputs()
										lowercase    :      Any       = {"""pixel_values""": pixel_values}
										return config, inputs_dict


@require_torch
class      UpperCamelCase		(__snake_case						,						__snake_case						,						unittest.TestCase     ):
						_SCREAMING_SNAKE_CASE  : List[str]												=		(SwiftFormerModel, SwiftFormerForImageClassification) if is_torch_available() else ()
						_SCREAMING_SNAKE_CASE  : Any												=		(
						    {"""feature-extraction""": SwiftFormerModel, """image-classification""": SwiftFormerForImageClassification}
						    if is_torch_available()
						    else {}
						)

						_SCREAMING_SNAKE_CASE  : Optional[Any]												=		False
						_SCREAMING_SNAKE_CASE  : Optional[Any]												=		False
						_SCREAMING_SNAKE_CASE  : List[str]												=		False
						_SCREAMING_SNAKE_CASE  : Tuple												=		False
						_SCREAMING_SNAKE_CASE  : List[Any]												=		False






						def      __snake_case      (		self  :Union[str, Any]				)      ->Optional[int]:
										lowercase    :      Optional[Any]       = SwiftFormerModelTester(self				)
										lowercase    :      List[str]       = ConfigTester(
										    self			, config_class=__magic_name__			, has_text_modality=__magic_name__			, hidden_size=37			, num_attention_heads=12			, num_hidden_layers=12			, )






						def      __snake_case      (		self  :Union[str, Any]				)      ->Union[str, Any]:
										self.config_tester.run_common_tests()






						@unittest.skip(reason="""SwiftFormer does not use inputs_embeds"""				)
						def      __snake_case      (		self  :Any				)      ->Any:
										pass






						def      __snake_case      (		self  :Optional[int]				)      ->List[Any]:
										lowercase      ,      lowercase    :      Optional[Any]       = self.model_tester.prepare_config_and_inputs_for_common()

										for model_class in self.all_model_classes:
														lowercase    :      Dict       = model_class(__magic_name__				)
														lowercase    :      int       = model.get_output_embeddings()
														self.assertTrue(x is None or isinstance(__magic_name__			, nn.Linear				)				)






						def      __snake_case      (		self  :Any				)      ->List[str]:
										lowercase      ,      lowercase    :      int       = self.model_tester.prepare_config_and_inputs_for_common()

										for model_class in self.all_model_classes:
														lowercase    :      Union[str, Any]       = model_class(__magic_name__				)
														lowercase    :      Tuple       = inspect.signature(model.forward				)
														# signature.parameters is an OrderedDict => so arg_names order is deterministic
														lowercase    :      str       = [*signature.parameters.keys()]

														lowercase    :      Any       = ["""pixel_values"""]
														self.assertListEqual(arg_names[:1]			, __magic_name__				)






						def      __snake_case      (		self  :Union[str, Any]				)      ->Optional[int]:
										lowercase    :      Union[str, Any]       = self.model_tester.prepare_config_and_inputs()
										self.model_tester.create_and_check_model(*__magic_name__				)






						def      __snake_case      (		self  :List[Any]				)      ->List[str]:
										lowercase    :      Any       = self.model_tester.prepare_config_and_inputs()
										self.model_tester.create_and_check_for_image_classification(*__magic_name__				)






						@slow
						def      __snake_case      (		self  :Any				)      ->Dict:
										for model_name in SWIFTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
														lowercase    :      List[Any]       = SwiftFormerModel.from_pretrained(__magic_name__				)
														self.assertIsNotNone(__magic_name__				)






						@unittest.skip(reason="""SwiftFormer does not output attentions"""				)
						def      __snake_case      (		self  :List[str]				)      ->Optional[Any]:
										pass






						def      __snake_case      (		self  :List[str]				)      ->List[str]:
										def check_hidden_states_output(__magic_name__  :str			, __magic_name__  :Optional[Any]			, __magic_name__  :Tuple				):
														lowercase    :      Optional[Any]       = model_class(__magic_name__				)
														model.to(__magic_name__				)
														model.eval()

														with torch.no_grad():
																		lowercase    :      Dict       = model(**self._prepare_for_class(__magic_name__			, __magic_name__				)				)

														lowercase    :      Tuple       = outputs.hidden_states

														lowercase    :      List[str]       = 8
														self.assertEqual(len(__magic_name__				)			, __magic_name__				)  # 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(__magic_name__				)				):
																		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),
																		        ]				)			, )

										lowercase      ,      lowercase    :      Optional[Any]       = self.model_tester.prepare_config_and_inputs_for_common()

										for model_class in self.all_model_classes:
														lowercase    :      Optional[int]       = True
														check_hidden_states_output(__magic_name__			, __magic_name__			, __magic_name__				)

														# check that output_hidden_states also work using config
														del inputs_dict["output_hidden_states"]
														lowercase    :      Any       = True

														check_hidden_states_output(__magic_name__			, __magic_name__			, __magic_name__				)






						def      __snake_case      (		self  :Any				)      ->Optional[int]:
										def _config_zero_init(__magic_name__  :List[Any]				):
														lowercase    :      Tuple       = copy.deepcopy(__magic_name__				)
														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(__magic_name__			, __magic_name__			, 1E-10				)
																		if isinstance(getattr(__magic_name__			, __magic_name__			, __magic_name__				)			, __magic_name__				):
																						lowercase    :      Any       = _config_zero_init(getattr(__magic_name__			, __magic_name__				)				)
																						setattr(__magic_name__			, __magic_name__			, __magic_name__				)
														return configs_no_init

										lowercase      ,      lowercase    :      Dict       = self.model_tester.prepare_config_and_inputs_for_common()

										lowercase    :      int       = _config_zero_init(__magic_name__				)
										for model_class in self.all_model_classes:
														lowercase    :      Union[str, Any]       = model_class(config=__magic_name__				)
														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  :Any				)      ->Any:
										pass


def      UpperCamelCase       ( )     ->       Tuple:
				lowercase    :      int       = Image.open("""./tests/fixtures/tests_samples/COCO/000000039769.png""" )
				return image


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






						@cached_property
						def      __snake_case      (		self  :Optional[Any]				)      ->List[str]:
										return ViTImageProcessor.from_pretrained("""MBZUAI/swiftformer-xs"""				) if is_vision_available() else None






						@slow
						def      __snake_case      (		self  :Optional[int]				)      ->int:
										lowercase    :      Union[str, Any]       = SwiftFormerForImageClassification.from_pretrained("""MBZUAI/swiftformer-xs"""				).to(__magic_name__				)

										lowercase    :      Any       = self.default_image_processor
										lowercase    :      str       = prepare_img()
										lowercase    :      Tuple       = image_processor(images=__magic_name__			, return_tensors="""pt"""				).to(__magic_name__				)

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

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

										lowercase    :      Optional[Any]       = torch.tensor([[-2.17_03E00, 2.11_07E00, -2.08_11E00]]				).to(__magic_name__				)
										self.assertTrue(torch.allclose(outputs.logits[0, :3]			, __magic_name__			, atol=1E-4				)				)
