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 set_shift(self, y_int):
      with torch.no_grad():
          y_sq_int = y_int**2
          var_int = torch.sum(y_sq_int, axis=2, keepdim=True)
          shift = (
              torch.log2(torch.sqrt(var_int / 2**self.max_bit)).ceil()
          ).max()
          shift_old = self.shift
          self.shift = torch.max(self.shift, shift)
          logger.info(
              f"Dynamic shift adjustment: {int(shift_old)} -> {int(self.shift)}"
          )
  
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 2 for calling the IntLayerNorm obj's underlying member method code with example usage: obj.set_shift(y_int) without return types