code: def test_model_quantize_openvino_vpu(self):
      # test whether contains VPU
      from openvino.runtime import Core
  
      core = Core()
      devices = core.available_devices
      vpu_avaliable = any("VPUX" in x for x in devices)
  
      if vpu_avaliable is False:
          return
  
      # test VPUX int8
      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)
      )
  
      openvino_model = InferenceOptimizer.trace(
          model, accelerator="openvino"
      )
      openvino_quantized_model = InferenceOptimizer.quantize(
          openvino_model,
          accelerator="openvino",
          x=train_dataset,
          thread_num=8,
          device="VPUX",
          precision="int8",
      )
      y_hat = openvino_quantized_model(train_examples[:10])
      assert y_hat.shape == (10, 10)
  
      # test VPUX fp16
      with pytest.raises(RuntimeError):
          openvino_quantized_model = InferenceOptimizer.quantize(
              openvino_model,
              accelerator="openvino",
              x=train_dataset,
              thread_num=8,
              device="VPUX",
              precision="fp16",
          )
  
      openvino_quantized_model = InferenceOptimizer.quantize(
          openvino_model,
          accelerator="openvino",
          x=train_dataset,
          thread_num=8,
          device="VPUX",
          precision="fp16",
          mean_value=[127.5, 127.5, 127.5],
      )
      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 6 for calling the TestOpenVINO obj's underlying member method code with example usage: obj.test_model_quantize_openvino_vpu() without return types