From 782eb5c6a244ccb0fe28d9d6fe5ff974fa679658 Mon Sep 17 00:00:00 2001 From: auphelia <jakobapk@web.de> Date: Fri, 1 Nov 2019 14:12:24 +0000 Subject: [PATCH] [Test] Added first draft of shape inference test and onnx model in data path with one custom and one standard node --- .../data/onnx/mixed-model/mixed_model.onnx | 31 +++++++++++++++++++ tests/test_infer_shapes.py | 17 ++++++++++ 2 files changed, 48 insertions(+) create mode 100644 src/finn/data/onnx/mixed-model/mixed_model.onnx create mode 100644 tests/test_infer_shapes.py diff --git a/src/finn/data/onnx/mixed-model/mixed_model.onnx b/src/finn/data/onnx/mixed-model/mixed_model.onnx new file mode 100644 index 000000000..79b1fa977 --- /dev/null +++ b/src/finn/data/onnx/mixed-model/mixed_model.onnx @@ -0,0 +1,31 @@ +onnx-example:È ++ +v + +thresholdsout0"MultiThreshold:finn + +out0out1"Relu +test-modelZ +v + + + + +Z + +thresholds + + +b +out1 + + + + +j +out0 + + + + +B \ No newline at end of file diff --git a/tests/test_infer_shapes.py b/tests/test_infer_shapes.py new file mode 100644 index 000000000..1c91a0740 --- /dev/null +++ b/tests/test_infer_shapes.py @@ -0,0 +1,17 @@ +from pkgutil import get_data + +import numpy as np +import onnx +import onnx.numpy_helper as np_helper + +import finn.core.onnx_exec as oxe +import finn.transformation.infer_shapes as si +from finn.core.modelwrapper import ModelWrapper + + +def test_infer_shapes(): + # load the onnx model + raw_m = get_data("finn", "data/onnx/mixed-model/mixed_model.onnx") + model = ModelWrapper(raw_m) + model = model.transform_single(si.infer_shapes) + -- GitLab