qonnx.core.onnx_exec (module)
- qonnx.core.onnx_exec.compare_execution(model_a, model_b, input_dict, compare_fxn=<function <lambda>>)
Executes two ONNX models and compare their outputs using given function.
compare_fxn should take in two tensors and return a Boolean
- qonnx.core.onnx_exec.execute_node(node, context, graph, return_full_exec_context=False, opset_version=11)
Executes a single node by using onnxruntime or with a custom function.
Input/output provided via context.
- qonnx.core.onnx_exec.execute_onnx(model, input_dict, return_full_exec_context=False, start_node=None, end_node=None)
Executes given ONNX ModelWrapper with given named inputs.
If return_full_exec_context is False, a dict of named outputs is returned as indicated by the model.graph.output.
If return return_full_exec_context is True, the full set of tensors used by the execution (including inputs, weights, activations and final outputs) will be returned as a dict.
When start_node and end_node are set to None, the whole graph is executed. If they are set to particular ONNX nodes, only the subgraph between (and including) those nodes is executed.
- qonnx.core.onnx_exec.execute_onnx_and_make_model(model, input_dict)
Executes given ONNX ModelWrapper with given named inputs and return a new ModelWrapper where an initializer is provided for each tensor as taken from the execution. This new model is useful for debugging, since it contains all the intermediate activation values.