code: def test_inference_masked_lm(self):
      # I-BERT should be "equivalent" to RoBERTa if not quantized
      # Test coped from `test_modeling_roberta.py`
      model = IBertForMaskedLM.from_pretrained(
          "kssteven/ibert-roberta-base"
      )
      input_ids = torch.tensor(
          [[0, 31414, 232, 328, 740, 1140, 12695, 69, 46078, 1588, 2]]
      )
      output = model(input_ids)[0]
      expected_shape = torch.Size((1, 11, 50265))
      self.assertEqual(output.shape, expected_shape)
      expected_slice = torch.tensor(
          [
              [
                  [33.8802, -4.3103, 22.7761],
                  [4.6539, -2.8098, 13.6253],
                  [1.8228, -3.6898, 8.8600],
              ]
          ]
      )
      self.assertTrue(
          torch.allclose(output[:, :3, :3], expected_slice, atol=1e-4)
      )
  
      # I-BERT should be "similar" to RoBERTa if quantized
      self.quantize(model)
      output = model(input_ids)[0]
      self.assertEqual(output.shape, expected_shape)
      self.assertTrue(
          torch.allclose(output[:, :3, :3], expected_slice, atol=0.1)
      )
  
imports: import copy
  import unittest
  from transformers import IBertConfig, is_torch_available
  from transformers.testing_utils import 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
label_desc: Use image node_id 11 for calling the IBertModelIntegrationTest obj's underlying member method code with example usage: obj.test_inference_masked_lm() without return types