class_docstr: Base class for overriding backward function of quantization operation.
code: def forward(ctx, tensor, quant_type, wrapper, **kwargs):
      if quant_type == QuantType.QUANT_INPUT:
          output = wrapper.quantizer.quantize_input(
              tensor, wrapper, **kwargs
          )
      elif quant_type == QuantType.QUANT_WEIGHT:
          output = wrapper.quantizer.quantize_weight(wrapper, **kwargs)
      elif quant_type == QuantType.QUANT_OUTPUT:
          output = wrapper.quantizer.quantize_output(
              tensor, wrapper, **kwargs
          )
      else:
          raise ValueError("unrecognized QuantType.")
  
      bits = QuantGrad.get_bits_length(
          wrapper.config, QType_Dict[quant_type]
      )
      qmin, qmax = torch.Tensor([0]).to(tensor.device), torch.Tensor(
          [(1 << bits) - 1]
      ).to(tensor.device)
      if hasattr(wrapper.module, "scale") and hasattr(
          wrapper.module, "zero_point"
      ):
          scale = wrapper.module.scale
          zero_point = wrapper.module.zero_point
      else:
          scale, zero_point = None, None
      ctx.save_for_backward(
          tensor,
          torch.Tensor([quant_type]),
          scale,
          zero_point,
          qmin,
          qmax,
      )
      return output
  
imports: import types
  import logging
  import torch
  from .None import default_layers
label_desc: Use image node_id 4 for calling the QuantGrad obj's underlying member method code with example usage: obj.forward(ctx, tensor, quant_type, wrapper) and returns: output