code: def test_inference_no_head_absolute_embedding(self):
      # Set default quantizers before creating the model.
      import pytorch_quantization.nn as quant_nn
      from pytorch_quantization.tensor_quant import QuantDescriptor
  
      # The default tensor quantizer is set to use Max calibration method
      input_desc = QuantDescriptor(num_bits=8, calib_method="max")
      # The default tensor quantizer is set to be per-channel quantization for weights
      weight_desc = QuantDescriptor(num_bits=8, axis=((0,)))
      quant_nn.QuantLinear.set_default_quant_desc_input(input_desc)
      quant_nn.QuantLinear.set_default_quant_desc_weight(weight_desc)
  
      model = QDQBertModel.from_pretrained("bert-base-uncased")
      input_ids = torch.tensor(
          [[0, 345, 232, 328, 740, 140, 1695, 69, 6078, 1588, 2]]
      )
      attention_mask = torch.tensor([[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]])
      output = model(input_ids, attention_mask=attention_mask)[0]
      expected_shape = torch.Size((1, 11, 768))
      self.assertEqual(output.shape, expected_shape)
      expected_slice = torch.tensor(
          [
              [
                  [0.4571, -0.0735, 0.8594],
                  [0.2774, -0.0278, 0.8794],
                  [0.3548, -0.0473, 0.7593],
              ]
          ]
      )
      self.assertTrue(
          torch.allclose(output[:, 1:4, 1:4], expected_slice, atol=1e-4)
      )
  
imports: import unittest
  from transformers import QDQBertConfig, is_torch_available
  from transformers.testing_utils import require_pytorch_quantization, require_torch, slow, torch_device
  from ...test_configuration_common import ConfigTester
  from ...test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor, random_attention_mask
label_desc: Use image node_id 1 for calling the QDQBertModelIntegrationTest obj's underlying member method code with example usage: obj.test_inference_no_head_absolute_embedding() without return types