code: def test_model_quantize_openvino(self):
      model = MobileNetV2(
          weights=None, input_shape=[40, 40, 3], classes=10
      )
      model = Model(inputs=model.inputs, outputs=model.outputs)
      train_examples = np.random.random((100, 40, 40, 3))
      train_labels = np.random.randint(0, 10, size=(100,))
      train_dataset = tf.data.Dataset.from_tensor_slices(
          (train_examples, train_labels)
      )
  
      # Case1: Trace and quantize
      openvino_model = InferenceOptimizer.trace(
          model, accelerator="openvino"
      )
      openvino_quantized_model = InferenceOptimizer.quantize(
          openvino_model,
          accelerator="openvino",
          x=train_dataset,
          thread_num=8,
      )
  
      y_hat = openvino_quantized_model(train_examples[:10])
      assert y_hat.shape == (10, 10)
  
      y_hat = openvino_quantized_model.predict(
          train_examples, batch_size=5
      )
      assert y_hat.shape == (100, 10)
  
      # Case2: Quantize directly from tensorflow
      openvino_quantized_model = InferenceOptimizer.quantize(
          model, accelerator="openvino", x=train_dataset
      )
  
      y_hat = openvino_quantized_model(train_examples[:10])
      assert y_hat.shape == (10, 10)
  
      preds = model.predict(train_examples)
      openvino_preds = openvino_quantized_model.predict(train_examples)
      np.testing.assert_allclose(preds, openvino_preds, rtol=1e-2)
  
      # Case 3: with config
      openvino_quantized_model = InferenceOptimizer.quantize(
          openvino_model,
          accelerator="openvino",
          x=train_dataset,
          openvino_config={"PERFORMANCE_HINT": "LATENCY"},
      )
      y_hat = openvino_quantized_model(train_examples[:10])
      assert y_hat.shape == (10, 10)
  
      # Case 4: with kargs
      openvino_quantized_model = InferenceOptimizer.quantize(
          openvino_model,
          accelerator="openvino",
          x=train_dataset,
          thread_num=8,
          mean_value=[123.68, 116.78, 103.94],
      )  # mo param
      y_hat = openvino_quantized_model(train_examples[:10])
      assert y_hat.shape == (10, 10)
  
file_path: BigDL/python/nano/test/openvino/tf/test_openvino_quantize.py
imports: from unittest import TestCase
  import tensorflow
  import pytest
  from tensorflow.keras.applications.mobilenet_v2 import MobileNetV2
  import numpy
  from bigdl.nano.tf.keras import Model, InferenceOptimizer
  import tempfile
  from bigdl.nano.deps.openvino.tf.model import KerasOpenVINOModel
label_desc: Use image node_id 1 for calling the TestOpenVINO obj's underlying member method code with example usage: obj.test_model_quantize_openvino() without return types