class_docstr: Quantized version of `torch.nn.GELU`. Adds quantization-specific arguments on top of `torch.nn.GELU`.
  
  Args:
      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 "gelu" or "nonlinear" is given.
class_docstr_tok: ["Quantized","version","of","`","torch.nn.GELU","`",".","Adds","quantization-specific","arguments","on","top","of","`","torch.nn.GELU","`",".","Args",":","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","``","gelu","''","or","``","nonlinear","''","is","given","."]
code: def forward(self, x, scaling_factor=None):
      if not self.quant_mode:
          return self.activation_fn(x), None
  
      x_int = x / scaling_factor
      sigmoid_int, sigmoid_scaling_factor = self.int_erf(
          x_int, scaling_factor / self.k
      )
  
      shift_int = 1.0 // sigmoid_scaling_factor
  
      x_int = x_int * (sigmoid_int + shift_int)
      scaling_factor = scaling_factor * sigmoid_scaling_factor / 2
  
      return x_int * scaling_factor, scaling_factor
  
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 3 for calling the IntGELU obj's underlying member method code with example usage: obj.forward(x, scaling_factor) and returns: unknown,  scaling_factor, self,  None