class_docstr: Linear layer with quantization aware training capability
class_docstr_tok: ["Linear","layer","with","quantization","aware","training","capability"]
docstr: hook to be registered to module when exporting the model to 8bit,             can be overrided to customize to layer behaviour
code: def _state_dict_hook(module, state_dict, prefix, local_metadata):
      """hook to be registered to module when exporting the model to 8bit,\
               can be overrided to customize to layer behaviour"""
      super()._state_dict_hook(
          module, state_dict, prefix, local_metadata
      )
      if module.mode_8bit:
          if module.mode == QuantizationMode.EMA:
              state_dict.pop(prefix + "bias", None)
              try:
                  state_dict[prefix + "_quantized_bias"] = state_dict[
                      prefix + "_quantized_bias"
                  ].int()
              except KeyError:
                  # in case there is no bias dont do anything
                  pass
      else:
          state_dict.pop(prefix + "_quantized_bias", None)
          state_dict.pop(prefix + "bias_scale", None)
  
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 5 for calling the QuantizedLinear obj's underlying member method code with example usage: obj._state_dict_hook(module, state_dict, prefix, local_metadata) without return types