From 8a1f8d2211d7a2ca4dac033e9d98695bf3a18e63 Mon Sep 17 00:00:00 2001 From: auphelia <jakobapk@web.de> Date: Wed, 6 Nov 2019 09:02:18 +0000 Subject: [PATCH] [Test] removed onnx graph that was produced during the run-docker.sh and deleted an obsolete import in infer_shapes.py --- src/finn/transformation/infer_shapes.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/finn/transformation/infer_shapes.py b/src/finn/transformation/infer_shapes.py index 0043e063e..063fb9b8b 100644 --- a/src/finn/transformation/infer_shapes.py +++ b/src/finn/transformation/infer_shapes.py @@ -1,18 +1,19 @@ import onnx.helper as helper import onnx.shape_inference as si -import finn.core.onnx_exec as oxe from finn.core.modelwrapper import ModelWrapper + def _make_shape_compatible_op(node): """Return a shape-compatible non-FINN op for a given FINN op. Used for shape inference with custom ops.""" - assert(node.domain == "finn") + assert node.domain == "finn" if node.op_type == "MultiThreshold": return helper.make_node("ReLU", [node.input[0]], [node.output[0]]) else: raise Exception("No known shape-compatible op for %s" % node.op_type) + def _hide_finn_ops(model): """Replace any FINN ops by shape-compatible ones, and return a dict that can be used to map the string representations of the new (shape-compatible) @@ -28,6 +29,7 @@ def _hide_finn_ops(model): model.graph.node.remove(node) return hidden_ops + def _restore_finn_ops(model, hidden_ops): """Replace any shape-compatible ops with the FINN ops that originally generated them.""" -- GitLab