code: def test_inference_no_head(self):
      tokenizer = self.default_tokenizer
      model = FSMTModel.from_pretrained(self.default_mname).to(
          torch_device
      )
  
      src_text = "My friend computer will translate this for me"
      input_ids = tokenizer([src_text], return_tensors="pt")[
          "input_ids"
      ]
      input_ids = _long_tensor(input_ids).to(torch_device)
      inputs_dict = prepare_fsmt_inputs_dict(model.config, input_ids)
      with torch.no_grad():
          output = model(**inputs_dict)[0]
      expected_shape = torch.Size((1, 10, model.config.tgt_vocab_size))
      self.assertEqual(output.shape, expected_shape)
      # expected numbers were generated when en-ru model, using just fairseq's model4.pt
      # may have to adjust if switched to a different checkpoint
      expected_slice = torch.tensor(
          [
              [-1.5753, -1.5753, 2.8975],
              [-0.9540, -0.9540, 1.0299],
              [-3.3131, -3.3131, 0.5219],
          ]
      ).to(torch_device)
      self.assertTrue(
          torch.allclose(
              output[:, :3, :3], expected_slice, atol=TOLERANCE
          )
      )
  
imports: import tempfile
  import unittest
  import timeout_decorator
  from parameterized import parameterized
  from transformers import FSMTConfig, is_torch_available
  from transformers.testing_utils import require_sentencepiece, require_tokenizers, require_torch, slow, torch_device
  from transformers.utils import cached_property
  from ...generation.test_generation_utils import GenerationTesterMixin
  from ...test_configuration_common import ConfigTester
  from ...test_modeling_common import ModelTesterMixin, ids_tensor
label_desc: Use image node_id 5 for calling the FSMTModelIntegrationTests obj's underlying member method code with example usage: obj.test_inference_no_head() without return types