class_docstr: Quantized version of `torch.nn.Linear`. Adds quantization-specific arguments on top of `torch.nn.Linear`.
  
  Args:
      weight_bit (`int`, *optional*, defaults to `8`):
          Bitwidth for the quantized weight.
      bias_bit (`int`, *optional*, defaults to `32`):
          Bitwidth for the quantized bias.
      per_channel (`bool`, *optional*, defaults to `False`):
          Whether or not to use channel-wise quantization.
      quant_mode (`bool`, *optional*, defaults to `False`):
          Whether or not the layer is quantized.
class_docstr_tok: ["Quantized","version","of","`","torch.nn.Linear","`",".","Adds","quantization-specific","arguments","on","top","of","`","torch.nn.Linear","`",".","Args",":","weight_bit","(","`","int","`",",","*","optional","*",",","defaults","to","`","8","`",")",":","Bitwidth","for","the","quantized","weight",".","bias_bit","(","`","int","`",",","*","optional","*",",","defaults","to","`","32","`",")",":","Bitwidth","for","the","quantized","bias",".","per_channel","(","`","bool","`",",","*","optional","*",",","defaults","to","`","False","`",")",":","Whether","or","not","to","use","channel-wise","quantization",".","quant_mode","(","`","bool","`",",","*","optional","*",",","defaults","to","`","False","`",")",":","Whether","or","not","the","layer","is","quantized","."]
code: def __init__(
      self,
      in_features,
      out_features,
      bias=True,
      weight_bit=8,
      bias_bit=32,
      per_channel=False,
      quant_mode=False,
  ):
      super().__init__()
      self.in_features = in_features
      self.out_features = out_features
  
      self.weight = nn.Parameter(
          torch.zeros([out_features, in_features])
      )
      self.register_buffer(
          "weight_integer", torch.zeros_like(self.weight)
      )
      self.register_buffer(
          "fc_scaling_factor", torch.zeros(self.out_features)
      )
      if bias:
          self.bias = nn.Parameter(torch.zeros(out_features))
          self.register_buffer(
              "bias_integer", torch.zeros_like(self.bias)
          )
  
      self.weight_bit = weight_bit
      self.quant_mode = quant_mode
      self.per_channel = per_channel
      self.bias_bit = bias_bit
      self.quant_mode = quant_mode
      self.percentile_mode = False
      self.weight_function = SymmetricQuantFunction.apply
  
imports: import decimal
  import numpy
  import torch
  from torch import nn
  from torch.autograd import Function
  from ...utils import logging
label_desc: Use image node_id 1 to create a new QuantLinear object from inherited base classes: nn with example: obj = QuantLinear(in_features, out_features, bias, weight_bit, bias_bit, per_channel, quant_mode)