code: def test_export_to_8bit_with_bias(self):
      qlinear = QuantizedLinear(10, 5, mode="EMA")
      qlinear.eval()
      state_dict = qlinear.state_dict()
      self.assertTrue("weight" in state_dict)
      self.assertTrue("bias" in state_dict)
      self.assertTrue("quantized_weight" not in state_dict)
      self.assertTrue("_quantized_bias" not in state_dict)
      self.assertTrue("bias_scale" not in state_dict)
      qlinear.mode_8bit = True
      state_dict = qlinear.state_dict()
      self.assertTrue("weight" not in state_dict)
      self.assertTrue("bias" not in state_dict)
      self.assertTrue("quantized_weight" in state_dict)
      self.assertTrue(
          state_dict["quantized_weight"].dtype == torch.int8
      )
      self.assertTrue("_quantized_bias" in state_dict)
      self.assertTrue(
          state_dict["_quantized_bias"].dtype == torch.int32
      )
      self.assertTrue("bias_scale" in state_dict)
      qlinear.mode_8bit = False
      state_dict = qlinear.state_dict()
      self.assertTrue("weight" in state_dict)
      self.assertTrue("bias" in state_dict)
      self.assertTrue("quantized_weight" not in state_dict)
      self.assertTrue("_quantized_bias" not in state_dict)
      self.assertTrue("bias_scale" not in state_dict)
  
imports: import unittest
  import numpy
  import torch
  from torch import nn
  from torch.nn import functional
  from nlp_architect.nn.torch.quantization import FakeLinearQuantizationWithSTE, QuantizedLinear, get_dynamic_scale, get_scale, QuantizedEmbedding
label_desc: Use image node_id 11 for calling the QuantizedLinearTest obj's underlying member method code with example usage: obj.test_export_to_8bit_with_bias() without return types