Skip to content
Snippets Groups Projects
Commit 0e681d8e authored by auphelia's avatar auphelia
Browse files

[Execution] Input values from context are stored in temporary file

parent 501c788b
No related branches found
No related tags found
No related merge requests found
# import onnx.helper as helper
import sys
import os
import tempfile
import numpy as np
import finn.core.multithreshold as multiThresh
import finn.core.utils as util
import finn.backend.fpgadataflow.code_gen_for_single_node_execution as code_gen
......@@ -11,8 +14,18 @@ def execute_custom_node(node, context, graph):
if (util.get_by_name(node.attribute, 'backend')) is not None:
if node.op_type == "StreamingMaxPool":
in_ind = 0
temp_files = []
for inputs in node.input:
np.save("input_{}.npy".format(in_ind), context[inputs].astype(np.float32))
temp_files.append("input_{}.npy".format(in_ind))
in_ind += 1
code_gen.execute(node, context, graph)
sys.exit(0)
# deleting temporary files
for temp_file in temp_files:
os.remove(temp_file)
sys.exit(1)
else:
# exception if op_type is not supported
raise Exception("This hls lib custom node is currently not supported.")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment