code: def export(
      model,
      input_sample=None,
      xml_path="model.xml",
      precision="fp32",
      dynamic_axes=True,
      logging=True,
      **kwargs,
  ):
      """
      Function to export pytorch model into openvino and save it to local.
      Any instance of torch.nn.Module including Lightning Module is acceptable.
  
      :param model: Model instance of torch.nn.module to be exported.
      :param input_sample: torch.Tensor or a list for the model tracing.
      :param xml_path: The path to save openvino model file.
      :param precision: Global precision of model, supported type: 'fp32', 'fp16',
                        defaults to 'fp32'.
      :param dynamic_axes: parameter of torch.onnx.export.
      :param logging: whether to log detailed information of model conversion. default: True.
      :param **kwargs: will be passed to torch.onnx.export function or model optimizer function.
      """
      # export a model with dynamic axes to enable IR to accept different batches and resolutions
      with TemporaryDirectory() as folder:
          folder = Path(folder)
          onnx_path = str(folder / "tmp.onnx")
          # split kwargs to torch.onnx.export and mo
          export_args = inspect.getfullargspec(torch.onnx.export).args
          export_defaults = inspect.getfullargspec(
              torch.onnx.export
          ).defaults
          export_args = export_args[
              len(export_args) - len(export_defaults) :
          ]
          export_kwargs = {}
          mo_kwargs = {}
          for key, value in kwargs.items():
              if key in export_args:
                  export_kwargs[key] = value
              else:
                  mo_kwargs[key] = value
          export_to_onnx(
              model,
              input_sample,
              onnx_path,
              dynamic_axes=dynamic_axes,
              **export_kwargs,
          )
          convert_onnx_to_xml(
              onnx_path,
              xml_path,
              precision=precision,
              logging=logging,
              **mo_kwargs,
          )
  
imports: from tempfile import TemporaryDirectory
  from ..core.utils import convert_onnx_to_xml
  from bigdl.nano.utils.pytorch import export_to_onnx
  from pathlib import Path
  import torch
  import inspect
label_desc: Use image node_id 1 for calling a global function with example usage: export(model, input_sample, xml_path, precision, dynamic_axes, logging) without return types