class_docstr: Quantized counterpart of the nn.Conv2d module that applies QuantNoise during training.
  
  Args:
      - standard nn.Conv2d parameters
      - 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-thgourh 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
class_docstr_tok: ["Quantized","counterpart","of","the","nn.Conv2d","module","that","applies","QuantNoise","during","training",".","Args",":","-","standard","nn.Conv2d","parameters","-","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-thgourh","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_channels,
      out_channels,
      kernel_size,
      stride=1,
      padding=0,
      dilation=1,
      groups=1,
      bias=True,
      padding_mode="zeros",
      p=0,
      bits=8,
      method="histogram",
      update_step=1000,
  ):
      kernel_size = _pair(kernel_size)
      stride = _pair(stride)
      padding = _pair(padding)
      dilation = _pair(dilation)
      super(IntConv2d, self).__init__(
          in_channels,
          out_channels,
          kernel_size,
          stride,
          padding,
          dilation,
          False,
          _pair(0),
          groups,
          bias,
          padding_mode,
      )
  
      # 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/qconv.py
imports: import torch
  import torch.nn.functional
  from torch.nn.modules.conv import _ConvNd
  from torch.nn.modules.utils import _pair
  from ..ops import emulate_int
label_desc: Use image node_id 1 to create a new IntConv2d object from inherited base classes: _ConvNd with example: obj = IntConv2d(in_channels, out_channels, kernel_size, stride, padding, dilation, groups, bias, padding_mode, p, bits, method, update_step)