class_docstr: Initialize the Lightseq Quant Linear Layer.
  
  Static variable:
      layer_id: The layer-index counter starting from 0 and incrementing by 1 every time a layer object is instantiated,
  Arguments:
      config: An object of LSQuantLinearLayer config, see get_config
class_docstr_tok: ["Initialize","the","Lightseq","Quant","Linear","Layer",".","Static","variable",":","layer_id",":","The","layer-index","counter","starting","from","0","and","incrementing","by","1","every","time","a","layer","object","is","instantiated",",","Arguments",":","config",":","An","object","of","LSQuantLinearLayer","config",",","see","get_config"]
code: def forward(self, inputs, **kwargs):
      self.config.training = self.training
      self.config.is_grad_enabled = torch.is_grad_enabled()
      self.config.quant_mode = self.quant_mode
  
      bs, sl = inputs.size()[:2]
      new_bs = None
      if (
          self.quant_mode
          and (self.config.out_features * bs * sl) % 8 != 0
      ):
          new_bs = (bs // 8 + 1) * 8
          inputs = torch.nn.functional.pad(
              inputs,
              tuple(0 for _ in range((inputs.dim() - 1) * 2))
              + (0, new_bs - bs),
          )
      if bs * sl > self.config.max_batch_tokens:
          raise ValueError(
              f"Batch token numbers {bs * sl} exceeds the limit {self.config.max_batch_tokens}."
          )
      out = LSQuantLinearFunc.apply(
          self.config, inputs, self.weight, self.clip_max
      )
      if new_bs is not None:
          out = out[:bs, :, :]
      if self.bias is not None:
          out = out + self.bias
      return out
  
imports: from dataclasses import dataclass
  import math
  import torch
  from torch import nn
  from torch.autograd import Function
  from torch.nn import functional
  from lightseq.training.ops.pytorch.quantization import weight_quant_config, act_quant_config
  from lightseq.training.ops.pytorch.builder import TransformerBuilder
label_desc: Use image node_id 4 for calling the LSQuantLinearLayer obj's underlying member method code with example usage: obj.forward(inputs) and returns: out