docstr: Trace a torch.nn.Module and convert it into an accelerated module for inference.
  
  For example, this function returns a PytorchOpenVINOModel when accelerator=='openvino'.
  
  :param model: A torch.nn.Module model, including pl.LightningModule.
  :param input_sample: A set of inputs for trace, defaults to None if you have trace before or
                       model is a LightningModule with any dataloader attached.
  :param accelerator: The accelerator to use, defaults to None meaning staying in Pytorch
                      backend. 'openvino', 'onnxruntime' and 'jit' are supported for now.
  :param use_ipex: Whether we use ipex as accelerator for inferencing. Only valid when
                   accelerator='jit'/None, otherwise will be ignored. Default: ``False``.
  :param channels_last: Whether use channels last memory format, i.e. NHWC (batch size,
                        height, width, channels), as an alternative way to store tensors in
                        classic/contiguous NCHW order. This setting only works for 4-dim
                        Tensor. Default: ``False``.
  :param thread_num: (optional) An int represents how many threads(cores) is needed for
                     inference. This parameter only controls the usage of thread number in
                     later inference process of your obtained accelerated model. In other
                     words, the process of model conversion won't be restricted by this
                     parameter.
  :param device: (optional) A string represents the device of the inference. Default to 'CPU',
                            vaild choices are 'CPU'/'GPU'. 'GPU' is only valid when
                            accelerator="openvino"/None. IPEX will be forcely used if
                            accelerator=None.
  :param onnxruntime_session_options: The session option for onnxruntime, only valid when
                                      accelerator='onnxruntime', otherwise will be ignored.
  :param openvino_config: The config to be inputted in core.compile_model. Only valid when
                          accelerator='openvino', otherwise will be ignored.
  :param simplification: Whether we use onnxsim to simplify the ONNX model, only valid when
                         accelerator='onnxruntime', otherwise will be ignored. If this option
                         is set to True, new dependency 'onnxsim' need to be installed.
  :param jit_strict: Whether recording your mutable container types. This parameter will be
                     passed to ``torch.jit.trace``. if ``accelerator != 'jit'`` or
                     ``jit_method='script'``, it will be ignored. Default to True.
  :param jit_method: Whether to use ``jit.trace`` or ``jit.script`` to convert a model
                     to TorchScript. Accepected values are ``'trace'``, ``'script'``,
                     and ``None``. Default to be ``None`` meaning the try-except logic
                     to use ``jit.trace`` or ``jit.script``. If ``accelerator != 'jit'``,
                     this parameter will be ignored.
  :param dynamic_axes: dict or boolean, default to True. By default the exported onnx model
                       will have the first dim of each Tensor input as a dynamic batch_size.
                       If dynamic_axes=False, the exported model will have the shapes of all
                       input and output tensors set to exactly match those given in
                       input_sample. To specify axes of tensors as dynamic (i.e. known only
                       at run-time), set dynamic_axes to a dict with schema:
  
                       | KEY (str): an input or output name. Each name must also be provided
                       | in input_names or output_names.
                       |
                       | VALUE (dict or list): If a dict, keys are axis indices and values
                       | are axis names. If a list, each element is an axis index.
  
                       If accelerator != 'openvino'/'onnxruntime', it will be ignored.
  :param logging: Whether to log detailed information of model conversion, only valid when
                  accelerator='openvino', otherwise will be ignored. Default: ``True``.
  :param inplace: whether to perform inplace optimization. Default: ``False``.
  :param weights_prepack: Whether to perform weight prepack for convolution and linear to
                          avoid oneDNN weights reorder. The default value is None. Explicitly
                          setting this knob overwrites the configuration set by level knob.
                          Only valid when ``use_ipex=True``, otherwise will be ignored.
                          You can try to reduce the occupied memory size by setting this
                          parameter to ``False``.
  :param enable_onednn: Whether to use PyTorch JIT graph fuser based on oneDNN Graph API,
                        which provides a flexible API for aggressive fusion. Default to
                        ``False``, only valid when accelerator='jit', otherwise will be
                        ignored. For more details, please refer https://github.com/pytorch/
                        pytorch/tree/master/torch/csrc/jit/codegen/
                        onednn#pytorch---onednn-graph-api-bridge.
  :param output_tensors: boolean, default to ``True`` and output of the model will be Tensors,
                         only valid when accelerator='onnxruntime' or accelerator='openvino',
                         otherwise will be ignored. If output_tensors=False, output of the
                         export model will be ndarray.
  :param strict_check: some checking in ``trace`` is non-trivial while not critical for the
                       optimization (e.g., if the model is a nn.Module or its subclass). This
                       param helps to eliminate the not critical checking, which may enable
                       more models to be optimized while may bring some strange error
                       message. Default to ``True``.
  :param example_kwarg_inputs: a pack of keyword arguments of example inputs that will be
                               passed to ``torch.jit.trace``. Default: ``None``. Either
                               this argument or ``input_sample`` should be specified. The
                               dict will be unpacking by the arguments name of the traced
                               function. Only valid when accelerator='jit' and torch>=2.0,
                               otherwise will be ignored.
  :param **kwargs: Other extra advanced settings include:
                   1. those be passed to torch.onnx.export function,
                   only valid when accelerator='onnxruntime'/'openvino',
                   otherwise will be ignored.
                   Possible arguments are: input_names, output_names, opset_version,
                   et al. For more details, please refer
                   https://pytorch.org/docs/stable/onnx.html#torch.onnx.export.
                   2. those be passed to model optimizer function of openvino,
                   only valid when accelerator='openvino',
                   otherwise will be ignored.
                   Possible arguments are: mean_values, layout, input, output, et al.
                   For more details about model optimizer, you can see mo --help .
  :return: Model with different acceleration.
docstr_tok: ["Trace","a","torch.nn.Module","and","convert","it","into","an","accelerated","module","for","inference",".","For","example",",","this","function","returns","a","PytorchOpenVINOModel","when","accelerator=='openvino","'",".",":","param","model",":","A","torch.nn.Module","model",",","including","pl.LightningModule",".",":","param","input_sample",":","A","set","of","inputs","for","trace",",","defaults","to","None","if","you","have","trace","before","or","model","is","a","LightningModule","with","any","dataloader","attached",".",":","param","accelerator",":","The","accelerator","to","use",",","defaults","to","None","meaning","staying","in","Pytorch","backend",".","'openvino","'",",","'onnxruntime","'","and","'jit","'","are","supported","for","now",".",":","param","use_ipex",":","Whether","we","use","ipex","as","accelerator","for","inferencing",".","Only","valid","when","accelerator='jit'\/None",",","otherwise","will","be","ignored",".","Default",":","``","False","``",".",":","param","channels_last",":","Whether","use","channels","last","memory","format",",","i.e",".","NHWC","(","batch","size",",","height",",","width",",","channels",")",",","as","an","alternative","way","to","store","tensors","in","classic\/contiguous","NCHW","order",".","This","setting","only","works","for","4-dim","Tensor",".","Default",":","``","False","``",".",":","param","thread_num",":","(","optional",")","An","int","represents","how","many","threads","(","cores",")","is","needed","for","inference",".","This","parameter","only","controls","the","usage","of","thread","number","in","later","inference","process","of","your","obtained","accelerated","model",".","In","other","words",",","the","process","of","model","conversion","wo","n't","be","restricted","by","this","parameter",".",":","param","device",":","(","optional",")","A","string","represents","the","device","of","the","inference",".","Default","to","'CPU","'",",","vaild","choices","are","'CPU'\/'GPU","'",".","'GPU","'","is","only","valid","when","accelerator=","''","openvino","''","\/None",".","IPEX","will","be","forcely","used","if","accelerator=None",".",":","param","onnxruntime_session_options",":","The","session","option","for","onnxruntime",",","only","valid","when","accelerator='onnxruntime","'",",","otherwise","will","be","ignored",".",":","param","openvino_config",":","The","config","to","be","inputted","in","core.compile_model",".","Only","valid","when","accelerator='openvino","'",",","otherwise","will","be","ignored",".",":","param","simplification",":","Whether","we","use","onnxsim","to","simplify","the","ONNX","model",",","only","valid","when","accelerator='onnxruntime","'",",","otherwise","will","be","ignored",".","If","this","option","is","set","to","True",",","new","dependency","'onnxsim","'","need","to","be","installed",".",":","param","jit_strict",":","Whether","recording","your","mutable","container","types",".","This","parameter","will","be","passed","to","``","torch.jit.trace","``",".","if","``","accelerator","!","=","'jit","'","``","or","``","jit_method='script","'","``",",","it","will","be","ignored",".","Default","to","True",".",":","param","jit_method",":","Whether","to","use","``","jit.trace","``","or","``","jit.script","``","to","convert","a","model","to","TorchScript",".","Accepected","values","are","``","'trace","'","``",",","``","'script","'","``",",","and","``","None","``",".","Default","to","be","``","None","``","meaning","the","try-except","logic","to","use","``","jit.trace","``","or","``","jit.script","``",".","If","``","accelerator","!","=","'jit","'","``",",","this","parameter","will","be","ignored",".",":","param","dynamic_axes",":","dict","or","boolean",",","default","to","True",".","By","default","the","exported","onnx","model","will","have","the","first","dim","of","each","Tensor","input","as","a","dynamic","batch_size",".","If","dynamic_axes=False",",","the","exported","model","will","have","the","shapes","of","all","input","and","output","tensors","set","to","exactly","match","those","given","in","input_sample",".","To","specify","axes","of","tensors","as","dynamic","(","i.e",".","known","only","at","run-time",")",",","set","dynamic_axes","to","a","dict","with","schema",":","|","KEY","(","str",")",":","an","input","or","output","name",".","Each","name","must","also","be","provided","|","in","input_names","or","output_names",".","|","|","VALUE","(","dict","or","list",")",":","If","a","dict",",","keys","are","axis","indices","and","values","|","are","axis","names",".","If","a","list",",","each","element","is","an","axis","index",".","If","accelerator","!","=","'openvino'\/'onnxruntime","'",",","it","will","be","ignored",".",":","param","logging",":","Whether","to","log","detailed","information","of","model","conversion",",","only","valid","when","accelerator='openvino","'",",","otherwise","will","be","ignored",".","Default",":","``","True","``",".",":","param","inplace",":","whether","to","perform","inplace","optimization",".","Default",":","``","False","``",".",":","param","weights_prepack",":","Whether","to","perform","weight","prepack","for","convolution","and","linear","to","avoid","oneDNN","weights","reorder",".","The","default","value","is","None",".","Explicitly","setting","this","knob","overwrites","the","configuration","set","by","level","knob",".","Only","valid","when","``","use_ipex=True","``",",","otherwise","will","be","ignored",".","You","can","try","to","reduce","the","occupied","memory","size","by","setting","this","parameter","to","``","False","``",".",":","param","enable_onednn",":","Whether","to","use","PyTorch","JIT","graph","fuser","based","on","oneDNN","Graph","API",",","which","provides","a","flexible","API","for","aggressive","fusion",".","Default","to","``","False","``",",","only","valid","when","accelerator='jit","'",",","otherwise","will","be","ignored",".","For","more","details",",","please","refer","https",":","\/\/github.com\/pytorch\/","pytorch\/tree\/master\/torch\/csrc\/jit\/codegen\/","onednn","#","pytorch","--","-onednn-graph-api-bridge",".",":","param","output_tensors",":","boolean",",","default","to","``","True","``","and","output","of","the","model","will","be","Tensors",",","only","valid","when","accelerator='onnxruntime","'","or","accelerator='openvino","'",",","otherwise","will","be","ignored",".","If","output_tensors=False",",","output","of","the","export","model","will","be","ndarray",".",":","param","strict_check",":","some","checking","in","``","trace","``","is","non-trivial","while","not","critical","for","the","optimization","(","e.g.",",","if","the","model","is","a","nn.Module","or","its","subclass",")",".","This","param","helps","to","eliminate","the","not","critical","checking",",","which","may","enable","more","models","to","be","optimized","while","may","bring","some","strange","error","message",".","Default","to","``","True","``",".",":","param","example_kwarg_inputs",":","a","pack","of","keyword","arguments","of","example","inputs","that","will","be","passed","to","``","torch.jit.trace","``",".","Default",":","``","None","``",".","Either","this","argument","or","``","input_sample","``","should","be","specified",".","The","dict","will","be","unpacking","by","the","arguments","name","of","the","traced","function",".","Only","valid","when","accelerator='jit","'","and","torch",">","=2.0",",","otherwise","will","be","ignored",".",":","param","*","*","kwargs",":","Other","extra","advanced","settings","include",":","1.","those","be","passed","to","torch.onnx.export","function",",","only","valid","when","accelerator='onnxruntime'\/'openvino","'",",","otherwise","will","be","ignored",".","Possible","arguments","are",":","input_names",",","output_names",",","opset_version",",","et","al",".","For","more","details",",","please","refer","https",":","\/\/pytorch.org\/docs\/stable\/onnx.html","#","torch.onnx.export",".","2.","those","be","passed","to","model","optimizer","function","of","openvino",",","only","valid","when","accelerator='openvino","'",",","otherwise","will","be","ignored",".","Possible","arguments","are",":","mean_values",",","layout",",","input",",","output",",","et","al",".","For","more","details","about","model","optimizer",",","you","can","see","mo","--","help",".",":","return",":","Model","with","different","acceleration","."]
code: def trace(
      model: nn.Module,
      input_sample=None,
      accelerator: Optional[str] = None,
      use_ipex: bool = False,
      channels_last: bool = False,
      thread_num: Optional[int] = None,
      device: Optional[str] = "CPU",
      onnxruntime_session_options=None,
      openvino_config=None,
      simplification: bool = True,
      jit_strict: bool = True,
      jit_method: Optional[str] = None,
      dynamic_axes: Union[bool, dict] = True,
      logging: bool = True,
      inplace: bool = False,
      weights_prepack: Optional[bool] = None,
      enable_onednn: bool = False,
      output_tensors: bool = True,
      strict_check: bool = True,
      example_kwarg_inputs=None,
      **kwargs,
  ):
      """
      Trace a torch.nn.Module and convert it into an accelerated module for inference.
  
      For example, this function returns a PytorchOpenVINOModel when accelerator=='openvino'.
  
      :param model: A torch.nn.Module model, including pl.LightningModule.
      :param input_sample: A set of inputs for trace, defaults to None if you have trace before or
                           model is a LightningModule with any dataloader attached.
      :param accelerator: The accelerator to use, defaults to None meaning staying in Pytorch
                          backend. 'openvino', 'onnxruntime' and 'jit' are supported for now.
      :param use_ipex: Whether we use ipex as accelerator for inferencing. Only valid when
                       accelerator='jit'/None, otherwise will be ignored. Default: ``False``.
      :param channels_last: Whether use channels last memory format, i.e. NHWC (batch size,
                            height, width, channels), as an alternative way to store tensors in
                            classic/contiguous NCHW order. This setting only works for 4-dim
                            Tensor. Default: ``False``.
      :param thread_num: (optional) An int represents how many threads(cores) is needed for
                         inference. This parameter only controls the usage of thread number in
                         later inference process of your obtained accelerated model. In other
                         words, the process of model conversion won't be restricted by this
                         parameter.
      :param device: (optional) A string represents the device of the inference. Default to 'CPU',
                                vaild choices are 'CPU'/'GPU'. 'GPU' is only valid when
                                accelerator="openvino"/None. IPEX will be forcely used if
                                accelerator=None.
      :param onnxruntime_session_options: The session option for onnxruntime, only valid when
                                          accelerator='onnxruntime', otherwise will be ignored.
      :param openvino_config: The config to be inputted in core.compile_model. Only valid when
                              accelerator='openvino', otherwise will be ignored.
      :param simplification: Whether we use onnxsim to simplify the ONNX model, only valid when
                             accelerator='onnxruntime', otherwise will be ignored. If this option
                             is set to True, new dependency 'onnxsim' need to be installed.
      :param jit_strict: Whether recording your mutable container types. This parameter will be
                         passed to ``torch.jit.trace``. if ``accelerator != 'jit'`` or
                         ``jit_method='script'``, it will be ignored. Default to True.
      :param jit_method: Whether to use ``jit.trace`` or ``jit.script`` to convert a model
                         to TorchScript. Accepected values are ``'trace'``, ``'script'``,
                         and ``None``. Default to be ``None`` meaning the try-except logic
                         to use ``jit.trace`` or ``jit.script``. If ``accelerator != 'jit'``,
                         this parameter will be ignored.
      :param dynamic_axes: dict or boolean, default to True. By default the exported onnx model
                           will have the first dim of each Tensor input as a dynamic batch_size.
                           If dynamic_axes=False, the exported model will have the shapes of all
                           input and output tensors set to exactly match those given in
                           input_sample. To specify axes of tensors as dynamic (i.e. known only
                           at run-time), set dynamic_axes to a dict with schema:
  
                           | KEY (str): an input or output name. Each name must also be provided
                           | in input_names or output_names.
                           |
                           | VALUE (dict or list): If a dict, keys are axis indices and values
                           | are axis names. If a list, each element is an axis index.
  
                           If accelerator != 'openvino'/'onnxruntime', it will be ignored.
      :param logging: Whether to log detailed information of model conversion, only valid when
                      accelerator='openvino', otherwise will be ignored. Default: ``True``.
      :param inplace: whether to perform inplace optimization. Default: ``False``.
      :param weights_prepack: Whether to perform weight prepack for convolution and linear to
                              avoid oneDNN weights reorder. The default value is None. Explicitly
                              setting this knob overwrites the configuration set by level knob.
                              Only valid when ``use_ipex=True``, otherwise will be ignored.
                              You can try to reduce the occupied memory size by setting this
                              parameter to ``False``.
      :param enable_onednn: Whether to use PyTorch JIT graph fuser based on oneDNN Graph API,
                            which provides a flexible API for aggressive fusion. Default to
                            ``False``, only valid when accelerator='jit', otherwise will be
                            ignored. For more details, please refer https://github.com/pytorch/
                            pytorch/tree/master/torch/csrc/jit/codegen/
                            onednn#pytorch---onednn-graph-api-bridge.
      :param output_tensors: boolean, default to ``True`` and output of the model will be Tensors,
                             only valid when accelerator='onnxruntime' or accelerator='openvino',
                             otherwise will be ignored. If output_tensors=False, output of the
                             export model will be ndarray.
      :param strict_check: some checking in ``trace`` is non-trivial while not critical for the
                           optimization (e.g., if the model is a nn.Module or its subclass). This
                           param helps to eliminate the not critical checking, which may enable
                           more models to be optimized while may bring some strange error
                           message. Default to ``True``.
      :param example_kwarg_inputs: a pack of keyword arguments of example inputs that will be
                                   passed to ``torch.jit.trace``. Default: ``None``. Either
                                   this argument or ``input_sample`` should be specified. The
                                   dict will be unpacking by the arguments name of the traced
                                   function. Only valid when accelerator='jit' and torch>=2.0,
                                   otherwise will be ignored.
      :param **kwargs: Other extra advanced settings include:
                       1. those be passed to torch.onnx.export function,
                       only valid when accelerator='onnxruntime'/'openvino',
                       otherwise will be ignored.
                       Possible arguments are: input_names, output_names, opset_version,
                       et al. For more details, please refer
                       https://pytorch.org/docs/stable/onnx.html#torch.onnx.export.
                       2. those be passed to model optimizer function of openvino,
                       only valid when accelerator='openvino',
                       otherwise will be ignored.
                       Possible arguments are: mean_values, layout, input, output, et al.
                       For more details about model optimizer, you can see mo --help .
      :return: Model with different acceleration.
      """
      if strict_check:
          invalidInputError(
              isinstance(model, nn.Module)
              and not isinstance(model, AcceleratedLightningModule),
              "Expect a nn.Module instance that is not traced or quantized"
              "but got type {}".format(type(model)),
          )
      # device name might be: CPU, GPU, GPU.0 ...
      invalidInputError(
          device == "CPU" or "GPU" in device,
          "Now we only support fp32 for CPU and GPU, not {}".format(
              device
          ),
      )
      # can't set precision for trace
      invalidInputError(
          "precision" not in kwargs,
          "Don't pass precision when call InferenceOptimizer.trace, otherwise you "
          "should call InferenceOptimizer.quantize(precision=...)",
      )
      if device != "CPU" and accelerator not in ("openvino", None):
          invalidInputError(
              False,
              "Now we only support {} device when accelerator "
              "is openvino or None.".format(device),
          )
      try:
          model.eval()  # change model to eval mode
      except Exception:
          pass
      if (
          accelerator == "openvino"
      ):  # openvino backend will not care about ipex usage
          final_openvino_option = {"INFERENCE_PRECISION_HINT": "f32"}
          if openvino_config is not None:
              final_openvino_option.update(openvino_config)
          return PytorchOpenVINOModel(
              model,
              input_sample,
              thread_num=thread_num,
              device=device,
              dynamic_axes=dynamic_axes,
              logging=logging,
              config=final_openvino_option,
              output_tensors=output_tensors,
              **kwargs,
          )
      if (
          accelerator == "onnxruntime"
      ):  # onnxruntime backend will not care about ipex usage
          if onnxruntime_session_options is None:
              import onnxruntime
  
              onnxruntime_session_options = onnxruntime.SessionOptions()
          if thread_num is not None:
              onnxruntime_session_options.intra_op_num_threads = (
                  thread_num
              )
              onnxruntime_session_options.inter_op_num_threads = (
                  thread_num
              )
          return PytorchONNXRuntimeModel(
              model,
              input_sample,
              onnxruntime_session_options,
              simplification=simplification,
              dynamic_axes=dynamic_axes,
              output_tensors=output_tensors,
              **kwargs,
          )
      if accelerator is None and device == "GPU":
          return PytorchIPEXPUModel(
              model, thread_num=thread_num, use_ipex=use_ipex
          ).to("xpu")
      if (
          accelerator == "jit"
          or use_ipex is True
          or channels_last is True
      ) and device == "CPU":
          if use_ipex:
              invalidInputError(
                  not TORCH_VERSION_LESS_1_10,
                  "torch version should >= 1.10 to use ipex",
              )
          use_jit = accelerator == "jit"
          if use_jit:
              invalidInputError(
                  jit_method in [None, "trace", "script"],
                  "jit_method {} is invalid.".format(jit_method),
              )
          return PytorchIPEXJITModel(
              model,
              input_sample=input_sample,
              use_ipex=use_ipex,
              use_jit=use_jit,
              channels_last=channels_last,
              thread_num=thread_num,
              inplace=inplace,
              jit_strict=jit_strict,
              jit_method=jit_method,
              weights_prepack=weights_prepack,
              enable_onednn=enable_onednn,
              example_kwarg_inputs=example_kwarg_inputs,
          )
      invalidInputError(
          False, "Accelerator {} is invalid.".format(accelerator)
      )
  
imports: import torch
  from torch import nn
  import time
  import sigfig
  import multiprocessing
  from typing import Dict, Callable, Tuple, Optional, List, Union, Sequence, Mapping
  from torch.utils.data import DataLoader
  from torchmetrics.metric import Metric
  from bigdl.nano.utils.common import AccelerationOption, available_acceleration_combination, latency_calculate_helper, torch_loader_latency_calculate_helper, format_optimize_result, BaseInferenceOptimizer
  from bigdl.nano.utils.common import invalidInputError
  from bigdl.nano.pytorch.amp import BF16Model
  from bigdl.nano.pytorch.low_precision.jit_int8_api import PytorchJITINT8Model
  from bigdl.nano.deps.openvino.openvino_api import PytorchOpenVINOModel
  from bigdl.nano.deps.ipex.ipex_api import PytorchIPEXJITModel, PytorchIPEXJITBF16Model, PytorchIPEXQuantizationModel, PytorchIPEXPUModel
  from bigdl.nano.deps.onnxruntime.onnxruntime_api import PytorchONNXRuntimeModel
  from bigdl.nano.deps.neural_compressor.inc_api import quantize
  from bigdl.nano.pytorch.model import AcceleratedLightningModule
  from bigdl.nano.utils.pytorch import get_forward_args, get_input_example
  from bigdl.nano.utils.pytorch import NanoMetric
  from bigdl.nano.utils.pytorch import RepeatDataset, remove_batch_dim_fn
  from bigdl.nano.utils.pytorch import transform_multiple_input_dataloader_to_inc_mode, automatic_add_label_in_dataloader
  from bigdl.nano.utils.pytorch import TORCH_VERSION_LESS_1_10
  from bigdl.nano.utils.pytorch import save_model, load_model
  from bigdl.nano.utils.common import schedule_processors
  from bigdl.nano.utils.common import EnvContext
  from bigdl.nano.pytorch.context_manager import generate_context_manager, BaseContextManager, AutocastContextManager
  from .multi_instance import _MultiInstanceModel, _multi_instance_helper
  import traceback
  import warnings
  import os
label_desc: Use image node_id 3 for calling the InferenceOptimizer obj's underlying member method code with example usage: obj.trace(model, input_sample, accelerator, use_ipex, channels_last, thread_num, device, onnxruntime_session_options, openvino_config, simplification, jit_strict, jit_method, dynamic_axes, logging, inplace, weights_prepack, enable_onednn, output_tensors, strict_check, example_kwarg_inputs) and returns: PytorchOpenVINOModel, PytorchONNXRuntimeModel, PytorchIPEXPUModel, PytorchIPEXJITModel