From 2f0c4bc11ba09959df121e0593fa7548c31e8fe0 Mon Sep 17 00:00:00 2001 From: auphelia <jakobapk@web.de> Date: Fri, 12 Jun 2020 15:53:41 +0100 Subject: [PATCH] [Core] Use util fct to round input values to match input finn dtype --- src/finn/core/onnx_exec.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/finn/core/onnx_exec.py b/src/finn/core/onnx_exec.py index c2f68a350..b5193a015 100644 --- a/src/finn/core/onnx_exec.py +++ b/src/finn/core/onnx_exec.py @@ -39,6 +39,7 @@ from finn.core.remote_exec import remote_exec from finn.core.rtlsim_exec import rtlsim_exec from finn.custom_op.registry import getCustomOp import finn.analysis.topology as ta +from finn.util.basic import update_execution_context def execute_node(node, context, graph): @@ -102,10 +103,7 @@ def execute_node(node, context, graph): raise Exception( """Output shapes disagree after node execution: found %s vs expected %s""" - % ( - str(output_list[list_ind].shape), - str(context[outp].shape), - ) + % (str(output_list[list_ind].shape), str(context[outp].shape),) ) context[outp] = output_list[list_ind] @@ -162,6 +160,8 @@ def execute_onnx(model, input_dict, return_full_exec_context=False): # we can simply walk down the list since the ONNX spec guarantees that it is # topologically sorted for node in graph.node: + # call util function match input values to quantization annotation + execution_context = update_execution_context(model, node, execution_context) execute_node(node, execution_context, graph) elif model_exec_mode == "remote_pynq": # use remote exec metadata built into model to execute on a remote PYNQ -- GitLab