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","."]
docstr: Load the model.
  
  Args:
      path (Path or str): Path to the directory where the model is
          stored.
      kwargs (Dict): Dictionary of additional arguments for consistency
          with other Learners.
  
  Returns:
      DeepSparseInferenceLearner: The optimized model.
docstr_tok: ["Load","the","model",".","Args",":","path","(","Path","or","str",")",":","Path","to","the","directory","where","the","model","is","stored",".","kwargs","(","Dict",")",":","Dictionary","of","additional","arguments","for","consistency","with","other","Learners",".","Returns",":","DeepSparseInferenceLearner",":","The","optimized","model","."]
code: def load(cls, path: Union[Path, str], **kwargs):
      """Load the model.
  
      Args:
          path (Path or str): Path to the directory where the model is
              stored.
          kwargs (Dict): Dictionary of additional arguments for consistency
              with other Learners.
  
      Returns:
          DeepSparseInferenceLearner: The optimized model.
      """
      if len(kwargs) > 0:
          logger.warning(
              f"No extra keywords expected for the load method. "
              f"Got {kwargs}."
          )
      onnx_path = os.path.join(str(path), ONNX_FILENAMES["model_name"])
      metadata = LearnerMetadata.read(path)
      input_tfms = metadata.input_tfms
      if input_tfms is not None:
          input_tfms = MultiStageTransformation.from_dict(
              metadata.input_tfms
          )
      device = Device.from_str(metadata.device)
      return cls(
          input_tfms=input_tfms,
          network_parameters=ModelParams(**metadata.network_parameters),
          onnx_path=onnx_path,
          input_names=metadata["input_names"],
          output_names=metadata["output_names"],
          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 5 for calling the DeepSparseInferenceLearner obj's underlying member method code with example usage: obj.load(cls, path) and returns: cls