class_docstr: This is the accelerated model for tensorflow and onnxruntime.
class_docstr_tok: ["This","is","the","accelerated","model","for","tensorflow","and","onnxruntime","."]
docstr: Load an ONNX model for inference from directory.
  
  :param path: Path to model to be loaded.
  :return: KerasONNXRuntimeModel model for ONNX Runtime inference.
docstr_tok: ["Load","an","ONNX","model","for","inference","from","directory",".",":","param","path",":","Path","to","model","to","be","loaded",".",":","return",":","KerasONNXRuntimeModel","model","for","ONNX","Runtime","inference","."]
code: def _load(path):
      """
      Load an ONNX model for inference from directory.
  
      :param path: Path to model to be loaded.
      :return: KerasONNXRuntimeModel model for ONNX Runtime inference.
      """
      status = KerasONNXRuntimeModel._load_status(path)
      if status.get("onnx_path", None):
          onnx_path = Path(status["onnx_path"])
          invalidInputError(
              onnx_path.suffix == ".onnx",
              "Path of onnx model must be with '.onnx' suffix.",
          )
      else:
          invalidInputError(
              False,
              "nano_model_meta.yml must specify 'onnx_path' for loading.",
          )
      onnx_path = Path(path) / status["onnx_path"]
      onnxruntime_session_options = onnxruntime.SessionOptions()
      onnxruntime_session_options.intra_op_num_threads = status[
          "intra_op_num_threads"
      ]
      onnxruntime_session_options.inter_op_num_threads = status[
          "inter_op_num_threads"
      ]
      model = KerasONNXRuntimeModel(
          model=str(onnx_path),
          input_sample=None,
          onnxruntime_session_options=onnxruntime_session_options,
      )
      with open(Path(path) / status["attr_path"], "rb") as f:
          attrs = SafePickle.load(f)
      for attr_name, attr_value in attrs.items():
          setattr(model, attr_name, attr_value)
      if os.path.exists(Path(path) / status["compile_path"]):
          with open(Path(path) / status["compile_path"], "rb") as f:
              kwargs = SafePickle.load(f)
              model.compile(**kwargs)
      return model
  
imports: import os
  from bigdl.nano.utils.common import SafePickle
  from pathlib import Path
  from typing import Sequence, Any, Union, Dict
  from tempfile import TemporaryDirectory
  import tensorflow
  from bigdl.nano.utils.tf import convert_all
  from bigdl.nano.tf.model import KerasOptimizedModel
  from bigdl.nano.utils.common import invalidInputError
  from ..core.onnxruntime_model import ONNXRuntimeModel
  import onnxruntime
label_desc: Use image node_id 6 for calling the KerasONNXRuntimeModel obj's underlying member method code with example usage: obj._load(path) and returns: model