class_docstr: Linear layer with quantization aware training capability
class_docstr_tok: ["Linear","layer","with","quantization","aware","training","capability"]
docstr: Simulate quantized inference. quantize input and perform calculation with only integer numbers.
  This function should only be used while doing inference
code: def inference_quantized_forward(self, input):
      """Simulate quantized inference. quantize input and perform calculation with only integer numbers.
      This function should only be used while doing inference"""
      assert (
          not self.training
      ), "should only be called when not training"
      input_scale = self._get_input_scale(input)
      self.bias_scale = self.weight_scale * input_scale
      quantized_input = quantize(
          input, input_scale, self.activation_bits
      )
      out = F.linear(
          quantized_input, self.quantized_weight, self.quantized_bias
      )
      # TODO(ofir) fuse the operation of requantization with dequantiz
      out = dequantize(out, self.bias_scale)
      if self.requantize_output:
          output_scale = self._get_output_scale(out)
          out = dequantize(
              quantize(out, output_scale, self.activation_bits),
              output_scale,
          )
      return out
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  from enum import Enum, auto
  import logging
  from abc import ABC, abstractmethod
  import torch
  from torch import nn
  from torch.nn import functional
  from nlp_architect.common import Config
label_desc: Use image node_id 3 for calling the QuantizedLinear obj's underlying member method code with example usage: obj.inference_quantized_forward(input) and returns: out