module onnxrt.validate.validate_python#

Short summary#

module mlprodict.onnxrt.validate.validate_python

Helpers to validate python code.

source on GitHub

Functions#

function

truncated documentation

_make_callable

Same function as make_callable() but deals with function which an undefined number of arguments.

validate_python_inference

Validates the code produced by method to_python. …

Documentation#

Helpers to validate python code.

source on GitHub

mlprodict.onnxrt.validate.validate_python._make_callable(fct, obj, code, gl, debug)#

Same function as make_callable but deals with function which an undefined number of arguments.

source on GitHub

mlprodict.onnxrt.validate.validate_python.validate_python_inference(oinf, inputs, tolerance=0.0)#

Validates the code produced by method to_python. The function compiles and executes the code given as an argument and compares the results to what oinf returns. This function is mostly used for unit testing purpose but it is not robust enough to handle all cases.

Parameters:
  • oinfOnnxInference

  • inputs – inputs as dictionary

  • tolerance – discrepencies must be below or equal to this theshold

The function fails if the expected output are not the same.

source on GitHub