experimental_experiment.reference.ort_evaluator

class experimental_experiment.reference.ort_evaluator.OrtEval(proto: str | ModelProto, providers: str | List[str] | None = None, options: onnxruntime.SessionOptions | None = None, verbose: int = 0, whole: bool = False, incremental: bool = False, optimized_model_filepath: str | None = None)[source]

This class loads an onnx model and the executes one by one the nodes with onnxruntime. This class is mostly meant for debugging.

Parameters:
  • proto – ModelProto or filaname

  • providers – providers

  • options – session options

  • verbose – verbosity

  • whole – run the whole model instead instead of node by node

  • incremental – run the model node by node, but for every node, executes the graph up to that node

  • optimized_model_filepath – export the optimized graph

run(outputs: List[str] | None, feed_inputs: Dict[str, Any], intermediate: bool = False) Dict[str, Any] | List[Any][source]

Runs the model. It only works with numpy arrays.

Parameters:
  • outputs – required outputs or None for all

  • feed_inputs – inputs

  • intermediate – returns all output instead of the last ones

Returns:

outputs, as a list if return_all is False, as a dictionary if return_all is True

run_dlpack(outputs: List[str] | None, feed_inputs: Dict[str, Any]) List[Any][source]

Runs the model using run_with_ortvaluevector. It only works with torch.Tensor.

Parameters:
  • outputs – required outputs or None for all

  • feed_inputs – inputs

Returns:

outputs