code: def test_onnx_inc_default_values(self):
      from bigdl.nano.utils.common import compare_version
      import operator
  
      if not compare_version(
          "neural_compressor", operator.ge, "1.14.0"
      ):
          # this ut will fail when inc version < 1.14, it's bug of inc itself
          return
  
      # default bool values
      class Net(nn.Module):
          def __init__(self):
              super().__init__()
  
          def forward(self, x, a=True, b=False):
              if a:
                  return x + 1
              if b:
                  return x - 1
              return x
  
      model = Net()
  
      data = torch.zeros(1, 3, 1, 1) - 1
      result_true = model(data)
      # sample with only required parameters (a Tensor)
      accmodel = InferenceOptimizer.quantize(
          model,
          accelerator="onnxruntime",
          calib_data=torch.rand(2, 3, 1, 1),
      )
      result_m = accmodel(data)
      assert abs(torch.sum(result_m).item()) < 1e-5
  
      # sample with only required parameters (in a tuple)
      accmodel = InferenceOptimizer.quantize(
          model,
          accelerator="onnxruntime",
          calib_data=torch.rand(2, 3, 1, 1),
          input_sample=(torch.rand(2, 3, 1, 1), False, True),
      )
      data = torch.zeros(1, 3, 1, 1) + 1
      result_m = accmodel(data)
      assert abs(torch.sum(result_m).item()) < 1e-5
  
      # default int values
      class Net(nn.Module):
          def __init__(self):
              super().__init__()
  
          def forward(self, x, a=3):
              return x + a
  
      model = Net()
  
      # sample with only required parameters (in a tuple with label)
      accmodel = InferenceOptimizer.quantize(
          model,
          accelerator="onnxruntime",
          calib_data=(
              (torch.rand(2, 3, 1, 1), 5),
              torch.zeros(2, 3, 1, 1),
          ),
      )
      data = torch.zeros(1, 3, 1, 1) - 5
      result_m = accmodel(data, 5)
      assert abs(torch.sum(result_m).item()) < 1e-5
  
      # sample with only required parameters (in a tuple)
      accmodel = InferenceOptimizer.quantize(
          model,
          accelerator="onnxruntime",
          calib_data=(torch.rand(2, 3, 1, 1), 5),
      )
      data = torch.zeros(1, 3, 1, 1) - 5
      result_m = accmodel(data, 5)
      assert abs(torch.sum(result_m).item()) < 1e-5
  
      # default None values
      class Net(nn.Module):
          def __init__(self):
              super().__init__()
  
          def forward(self, x, a=None):
              if a is None:
                  return x
              else:
                  return x + 1
  
      model = Net()
  
      data = torch.zeros(1, 3, 1, 1)
  
      # sample with only required parameters (in a tuple)
      accmodel = InferenceOptimizer.quantize(
          model,
          accelerator="onnxruntime",
          calib_data=torch.rand(2, 3, 1, 1),
      )
      result_m = accmodel(data)
      assert abs(torch.sum(result_m).item()) < 1e-5
  
      # default more None values
      class Net(nn.Module):
          def __init__(self):
              super().__init__()
  
          def forward(self, x1, x2, x3, x4, a=None, b=None, c=None):
              output = x1 + x2 + x3 + x4
              if a is not None:
                  output += a
              if b is not None:
                  output += b
              if c is not None:
                  output += c
              return output
  
      model = Net()
  
      x1 = torch.zeros(1, 3, 1, 1)
      x2 = torch.zeros(1, 3, 1, 1)
      x3 = torch.zeros(1, 3, 1, 1)
      x4 = torch.zeros(1, 3, 1, 1)
  
      # sample with only required parameters (in a tuple with a label)
      accmodel = InferenceOptimizer.quantize(
          model,
          accelerator="onnxruntime",
          calib_data=((x1, x2, x3, x4), torch.zeros(1, 3, 1, 1)),
      )
      result_m = accmodel(x1, x2, x3, x4)
      assert abs(torch.sum(result_m).item()) < 1e-5
  
      # sample with only required parameters (in a tuple with a label)
      accmodel = InferenceOptimizer.quantize(
          model,
          accelerator="onnxruntime",
          calib_data=((x1, x2, x3, x4, 1, 1), torch.zeros(1, 3, 1, 1)),
      )
      result_m = accmodel(x1, x2, x3, x4, 1, 1)
      assert abs(torch.sum(result_m).item()) < 1e-5 + 6
  
      # sample with only required parameters (in a tuple)
      accmodel = InferenceOptimizer.quantize(
          model, accelerator="onnxruntime", calib_data=(x1, x2, x3, x4)
      )
      result_m = accmodel(x1, x2, x3, x4)
      assert abs(torch.sum(result_m).item()) < 1e-5
  
      # sample with only required parameters (in a tuple)
      accmodel = InferenceOptimizer.quantize(
          model,
          accelerator="onnxruntime",
          calib_data=(x1, x2, x3, x4, 1),
      )
      result_m = accmodel(x1, x2, x3, x4, 2)
      assert abs(torch.sum(result_m).item()) < 1e-5 + 6
  
imports: import pytest
  import os
  from unittest import TestCase
  import tempfile
  import torch
  from torch import nn
  from torch.utils.data import TensorDataset, DataLoader, Dataset
  import torchmetrics
  import numpy
  from bigdl.nano.pytorch import Trainer
  from bigdl.nano.pytorch import InferenceOptimizer
  from bigdl.nano.pytorch.vision.models import vision
label_desc: Use image node_id 6 for calling the TestOnnx obj's underlying member method code with example usage: obj.test_onnx_inc_default_values() and returns: x, unknown, output, unknown, unknown, x, unknown