class_docstr: Tensor quantizer module
  
  This module uses tensor_quant or fake_tensor_quant function to quantize a tensor. And wrappers variable, moving
  statistics we'd want when training a quantized network.
  
  Experimental features:
      ``clip`` stage learns range before enabling quantization.
      ``calib`` stage runs calibration
  
  Args:
      quant_desc: An instance of :func:`QuantDescriptor <csrc.pytorch.pytorch_quantization.tensor_quant.QuantDescriptor>`.
      disabled: A boolean. If True, by pass the whole module returns input. Default False.
      if_quant: A boolean. If True, run main quantization body. Default True.
      if_clip: A boolean. If True, clip before quantization and learn amax. Default False.
      if_calib: A boolean. If True, run calibration. Not implemented yet. Settings of calibration will probably
          go to :func:`QuantDescriptor <csrc.pytorch.pytorch_quantization.tensor_quant.QuantDescriptor>`.
  
  Raises:
  
  Readonly Properties:
      - axis:
      - fake_quant:
      - scale:
      - step_size:
  
  Mutable Properties:
      - num_bits:
      - unsigned:
      - amax:
class_docstr_tok: ["Tensor","quantizer","module","This","module","uses","tensor_quant","or","fake_tensor_quant","function","to","quantize","a","tensor",".","And","wrappers","variable",",","moving","statistics","we","'d","want","when","training","a","quantized","network",".","Experimental","features",":","``","clip","``","stage","learns","range","before","enabling","quantization",".","``","calib","``","stage","runs","calibration","Args",":","quant_desc",":","An","instance","of",":","func",":","`","QuantDescriptor","<","csrc.pytorch.pytorch_quantization.tensor_quant.QuantDescriptor",">","`",".","disabled",":","A","boolean",".","If","True",",","by","pass","the","whole","module","returns","input",".","Default","False",".","if_quant",":","A","boolean",".","If","True",",","run","main","quantization","body",".","Default","True",".","if_clip",":","A","boolean",".","If","True",",","clip","before","quantization","and","learn","amax",".","Default","False",".","if_calib",":","A","boolean",".","If","True",",","run","calibration",".","Not","implemented","yet",".","Settings","of","calibration","will","probably","go","to",":","func",":","`","QuantDescriptor","<","csrc.pytorch.pytorch_quantization.tensor_quant.QuantDescriptor",">","`",".","Raises",":","Readonly","Properties",":","-","axis",":","-","fake_quant",":","-","scale",":","-","step_size",":","Mutable","Properties",":","-","num_bits",":","-","unsigned",":","-","amax",":"]
docstr: Load amax from calibrator.
  
  Updates the amax buffer with value computed by the calibrator, creating it if necessary.
  *args and **kwargs are directly passed to compute_amax, except "strict" in kwargs. Refer to
  compute_amax for more details.
code: def load_calib_amax(self, *args, **kwargs):
      """Load amax from calibrator.
  
      Updates the amax buffer with value computed by the calibrator, creating it if necessary.
      *args and **kwargs are directly passed to compute_amax, except "strict" in kwargs. Refer to
      compute_amax for more details.
      """
      strict = kwargs.pop("strict", True)
      if getattr(self, "_calibrator", None) is None:
          raise RuntimeError("Calibrator not created.")
      calib_amax = self._calibrator.compute_amax(*args, **kwargs)
      if calib_amax is None:
          err_msg = (
              "Calibrator returned None. This usually happens when calibrator hasn't"
              " seen any tensor."
          )
          if not strict:
              logger.warning(err_msg)
              logger.warning("Set amax to NaN!")
              calib_amax = torch.tensor(math.nan)
          else:
              raise RuntimeError(
                  err_msg
                  + " Passing 'strict=False' to `load_calib_amax()` will ignore the"
                  " error."
              )
      logger.warning(
          "Load calibrated amax, shape={}.".format(calib_amax.shape)
      )
  
      if not hasattr(self, "_amax"):
          self.register_buffer("_amax", calib_amax.data)
      else:
          self._amax.copy_(calib_amax)
  
imports: import math
  import logging
  import torch
  from torch import nn
  from csrc.pytorch.pytorch_quantization.tensor_quant import QuantDescriptor, tensor_quant, fake_tensor_quant
  from csrc.pytorch.pytorch_quantization.nn.modules.clip import Clip
  from csrc.pytorch.pytorch_quantization import calib
  import csrc.pytorch.pytorch_quantization.utils
label_desc: Use image node_id 22 for calling the TensorQuantizer obj's underlying member method code with example usage: obj.load_calib_amax() without return types