class_docstr: Quantized counterpart of the nn.Linear module that applies QuantNoise during training.
  
  Args:
      - in_features: input features
      - out_features: output features
      - bias: bias or not
      - p: amount of noise to inject (0 = no quantization, 1 = quantize all the weights)
      - bits: number of bits
      - method: choose among {"tensor", "histogram", "channel"}
      - update_step: recompute scale and zero_point every update_steps iterations
  
  Remarks:
      - We use the straight-through estimator so that the gradients
        back-propagate nicely in the network, this is implemented with
        the detach() trick.
      - Parameters scale and zero_point are recomputed every update_step
        forward pass to reduce the overhead
      - At test time, the weights are fully quantized
code: def __init__(
      self,
      in_features,
      out_features,
      bias=True,
      p=0,
      update_step=3000,
      bits=8,
      method="histogram",
  ):
      super(IntLinear, self).__init__()
      self.in_features = int(in_features)
      self.out_features = int(out_features)
      self.weight = torch.nn.Parameter(
          torch.Tensor(out_features, in_features)
      )
      self.chosen_bias = bias
      if self.chosen_bias:
          self.bias = torch.nn.Parameter(torch.Tensor(out_features))
      else:
          self.register_parameter("bias", None)
      self.reset_parameters()
  
      # quantization parameters
      self.p = p
      self.bits = bits
      self.method = method
      self.update_step = update_step
      self.counter = 0
  
file_path: fairseq/fairseq/modules/quantization/scalar/modules/qlinear.py
imports: import torch
  import torch.nn
  import torch.nn.functional
  from ..ops import emulate_int
label_desc: Use image node_id 1 to create a new IntLinear object from inherited base classes: nn with example: obj = IntLinear(in_features, out_features, bias, p, update_step, bits, method)