class_docstr: Quantized version of `torch.nn.LayerNorm`. Adds quantization-specific arguments on top of `torch.nn.LayerNorm`.
  
  Args:
      output_bit (`int`, *optional*, defaults to `8`):
          Bitwidth for the layer output activation.
      quant_mode (`bool`, *optional*, defaults to `False`):
          Whether or not the layer is quantized.
      force_dequant (`str`, *optional*, defaults to `"none"`):
          Force dequantize the layer if either "layernorm" or "nonlinear" is given.
class_docstr_tok: ["Quantized","version","of","`","torch.nn.LayerNorm","`",".","Adds","quantization-specific","arguments","on","top","of","`","torch.nn.LayerNorm","`",".","Args",":","output_bit","(","`","int","`",",","*","optional","*",",","defaults","to","`","8","`",")",":","Bitwidth","for","the","layer","output","activation",".","quant_mode","(","`","bool","`",",","*","optional","*",",","defaults","to","`","False","`",")",":","Whether","or","not","the","layer","is","quantized",".","force_dequant","(","`","str","`",",","*","optional","*",",","defaults","to","`","``","none","''","`",")",":","Force","dequantize","the","layer","if","either","``","layernorm","''","or","``","nonlinear","''","is","given","."]
code: def __init__(
      self,
      normalized_shape,
      eps,
      output_bit=8,
      quant_mode=False,
      force_dequant="none",
  ):
      super().__init__()
      self.normalized_shape = normalized_shape
      self.eps = eps
  
      self.weight = nn.Parameter(torch.zeros(normalized_shape))
      self.bias = nn.Parameter(torch.zeros(normalized_shape))
  
      self.quant_mode = quant_mode
      if force_dequant in ["nonlinear", "layernorm"]:
          logger.info("Force dequantize layernorm")
          self.quant_mode = False
  
      self.register_buffer("shift", torch.zeros(1))
      self.output_bit = output_bit
      self.max_bit = 32
      self.dim_sqrt = None
      self.activation = QuantAct(
          self.output_bit, quant_mode=self.quant_mode
      )
  
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 IntLayerNorm object from inherited base classes: nn with example: obj = IntLayerNorm(normalized_shape, eps, output_bit, quant_mode, force_dequant)