module onnxrt.validate.side_by_side#

Short summary#

module mlprodict.onnxrt.validate.side_by_side

Helpers to compare executions.

source on GitHub

Functions#

function

truncated documentation

_side_by_side_by_values_inputs

merge_results

Merges results by name. The first ones are used to keep the order.

side_by_side_by_values

Compares the execution of two sessions. It calls method OnnxInference.run

Documentation#

Helpers to compare executions.

source on GitHub

mlprodict.onnxrt.validate.side_by_side._side_by_side_by_values_inputs(sess, inputs, i)#
mlprodict.onnxrt.validate.side_by_side.merge_results(results)#

Merges results by name. The first ones are used to keep the order.

Parameters

results – results of intermediate variables

Returns

list of tuple

source on GitHub

mlprodict.onnxrt.validate.side_by_side.side_by_side_by_values(sessions, *args, inputs=None, return_results=False, **kwargs)#

Compares the execution of two sessions. It calls method OnnxInference.run with value intermediate=True and compares the results.

Parameters
  • sessions – list of class OnnxInference

  • inputs – inputs

  • args – additional parameters for OnnxInference.run <mlprodict.onnxrt.onnx_inference.OnnxInference.run()

  • return_results – if True, returns the results as well.

  • kwargs – additional parameters for OnnxInference.run <mlprodict.onnxrt.onnx_inference.OnnxInference.run()

Returns

list of dictionaries

The first session is considered as the baseline. See notebook ONNX side by side for an example. If inputs is None, the function assumes sessions is a list of tuple(sessions, inputs) because sometimes inputs must be different.

Changed in version 0.7: Parameter return_results was added. The function returns the execution order when available.

source on GitHub