class_docstr: Linear layer with quantization aware training capability
class_docstr_tok: ["Linear","layer","with","quantization","aware","training","capability"]
docstr: fake quantized forward, fake quantizes weights and activations,
  learn quantization ranges if quantization mode is EMA.
  This function should only be used while training
code: def training_quantized_forward(self, input):
      """fake quantized forward, fake quantizes weights and activations,
      learn quantization ranges if quantization mode is EMA.
      This function should only be used while training"""
      assert self.training, "should only be called when training"
      if self.mode == QuantizationMode.EMA:
          self._update_ema(self.input_thresh, input.detach())
      input_scale = self._get_input_scale(input)
      out = F.linear(
          _fake_quantize(input, input_scale, self.activation_bits),
          self.fake_quantized_weight,
          self.bias,
      )
      if self.requantize_output:
          if self.mode == QuantizationMode.EMA:
              self._update_ema(self.output_thresh, out.detach())
          out = _fake_quantize(
              out, self._get_output_scale(out), self.activation_bits
          )
      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 2 for calling the QuantizedLinear obj's underlying member method code with example usage: obj.training_quantized_forward(input) and returns: out