class_docstr: Model optimized on CPU using DeepSparse. DeepSparse is an engine
  accelerating sparse computations on CPUs.
  
  Attributes:
      network_parameters (ModelParams): The model parameters as batch
              size, input and output sizes.
      onnx_path (str or Path): Path to the onnx model.
      input_names (List[str]): Input names used when the onnx model
          was produced.
      output_names (List[str]): Output names used when the onnx model
          was produced.
class_docstr_tok: ["Model","optimized","on","CPU","using","DeepSparse",".","DeepSparse","is","an","engine","accelerating","sparse","computations","on","CPUs",".","Attributes",":","network_parameters","(","ModelParams",")",":","The","model","parameters","as","batch","size",",","input","and","output","sizes",".","onnx_path","(","str","or","Path",")",":","Path","to","the","onnx","model",".","input_names","(","List","[","str","]",")",":","Input","names","used","when","the","onnx","model","was","produced",".","output_names","(","List","[","str","]",")",":","Output","names","used","when","the","onnx","model","was","produced","."]
code: def __init__(
      self,
      onnx_path: Union[str, Path],
      input_names: List[str],
      output_names: List[str],
      device: Device,
      **kwargs,
  ):
      super().__init__(**kwargs)
      self.onnx_path = self._store_file(onnx_path)
  
      # Compile model
      cores_per_socket, _, _ = cpu.cpu_details()
      # Define the number of cores to use, by default it will make use of
      # all physical cores on the system
      num_cores = cores_per_socket
      batch_size = kwargs["network_parameters"].batch_size
      self.engine = compile_model(onnx_path, batch_size, num_cores)
  
      self.input_names = input_names
      self.output_names = output_names
      self.device = device
  
imports: import os
  import shutil
  from abc import ABC
  from pathlib import Path
  from typing import Union, List, Generator, Tuple, Dict, Type
  import numpy
  from loguru import logger
  from nebullvm.config import ONNX_FILENAMES
  from nebullvm.core.models import Device, ModelParams, DeepLearningFramework
  from nebullvm.operations.inference_learners.base import BaseInferenceLearner, LearnerMetadata, PytorchBaseInferenceLearner
  from nebullvm.optional_modules.deepsparse import cpu, compile_model
  from nebullvm.optional_modules.torch import torch
  from nebullvm.tools.transformations import MultiStageTransformation
label_desc: Use image node_id 1 to create a new DeepSparseInferenceLearner object from inherited base classes: BaseInferenceLearner, ABC with example: obj = DeepSparseInferenceLearner(onnx_path, input_names, output_names, device)