docstr: Call before self.__call__() to check if the object is well-initialized
  for quantization.
docstr_tok: ["Call","before","self.__call__","(",")","to","check","if","the","object","is","well-initialized","for","quantization","."]
code: def sanity_check_before_execution(
      self, model, calib_dataloader, metric
  ):
      """
      Call before self.__call__() to check if the object is well-initialized
      for quantization.
      """
      if self.cfg.quantization.approach == "post_training_static_quant":
          invalidInputError(
              calib_dataloader is not None,
              "calib_dataloader must not be None"
              " when approach is post-training static quantization.",
          )
      if (
          self.cfg.quantization.approach
          == "post_training_dynamic_quant"
      ):
          if not metric:
              invalidInputError(
                  calib_dataloader is None,
                  "calib_dataloader should be None when approach is"
                  " post-training dynamic quantization and metric is None.",
              )
  
      if metric and not calib_dataloader:
          invalidInputError(
              False,
              "calib_dataloader must be specified for evaluation"
              " when metric is not None.",
          )
  
file_path: BigDL/python/nano/src/bigdl/nano/deps/neural_compressor/core/quantization.py
imports: from bigdl.nano.utils.common import invalidInputError
  from neural_compressor.conf.config import Quantization_Conf
  from neural_compressor.experimental import Quantization, common
label_desc: Use image node_id 6 for calling the BaseQuantization obj's underlying member method code with example usage: obj.sanity_check_before_execution(model, calib_dataloader, metric) without return types