code: def test_tsppl_quantize_data_creator(self):
      # s2s not support quantize
      with pytest.raises(RuntimeError):
          tsppl_s2s = TSPipeline.load(
              os.path.join(
                  self.resource_path, "tsppl_ckpt/s2s_tsppl_ckpt"
              )
          )
          tsppl_s2s.quantize(
              calib_data=train_data_creator,
              metric=["smape"],
              framework=["pytorch_fx", "onnxrt_qlinearops"],
          )
          del tsppl_s2s
  
      tsppl_lstm = TSPipeline.load(
          os.path.join(self.resource_path, "tsppl_ckpt/lstm_tsppl_ckpt")
      )
      assert tsppl_lstm._best_config["batch_size"] == 32
  
      yhat = tsppl_lstm.predict(valid_data_creator, batch_size=64)
      smape = tsppl_lstm.evaluate(valid_data_creator, metrics=["smape"])
  
      tsppl_lstm.quantize(
          calib_data=train_data_creator,
          metric="mae",
          framework=["pytorch_fx", "onnxrt_qlinearops"],
      )
      # only quantize
      q_yhat = tsppl_lstm.predict(
          valid_data_creator, batch_size=32, quantize=True
      )
      q_smape = tsppl_lstm.evaluate(
          valid_data_creator,
          metrics=["smape"],
          batch_size=128,
          quantize=True,
      )
  
      # quantize_onnx
      q_onnx_yhat = tsppl_lstm.predict_with_onnx(
          valid_data_creator, batch_size=64, quantize=True
      )
  
      q_onnx_smape = tsppl_lstm.evaluate_with_onnx(
          valid_data_creator,
          metrics=["smape"],
          batch_size=64,
          quantize=True,
      )
      assert tsppl_lstm._best_config["batch_size"] == 64
  
      tsppl_lstm.fit(train_data_creator, epochs=2, batch_size=64)
  
      assert q_yhat.shape == yhat.shape == q_onnx_yhat.shape
      assert all(
          [
              np.mean(q_smape) < 100.0,
              np.mean(q_onnx_smape) < 100.0,
              np.mean(smape) < 100.0,
          ]
      )
  
imports: import numpy
  from unittest import TestCase
  import pytest
  from bigdl.chronos.utils import LazyImport
  import os
  import pandas
  import numpy
  from bigdl.chronos.data import TSDataset
  from ..None import op_torch, op_inference
label_desc: Use image node_id 7 for calling the TestTSPipeline obj's underlying member method code with example usage: obj.test_tsppl_quantize_data_creator() without return types