From 3db6f927515aa8a63d64a25dce3d43519e07edfb Mon Sep 17 00:00:00 2001 From: auphelia <jakobapk@web.de> Date: Mon, 11 Nov 2019 14:57:39 +0000 Subject: [PATCH] [Test] Added values for input tensor and created call for execute_onnx of the maxpool model --- tests/test_layer_streaming_maxpool.py | 43 +++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/tests/test_layer_streaming_maxpool.py b/tests/test_layer_streaming_maxpool.py index 70557ca78..590066227 100644 --- a/tests/test_layer_streaming_maxpool.py +++ b/tests/test_layer_streaming_maxpool.py @@ -1,6 +1,8 @@ # import onnx +import numpy as np from onnx import TensorProto, helper +import finn.core.onnx_exec as oxe from finn.core.datatype import DataType from finn.core.modelwrapper import ModelWrapper @@ -33,3 +35,44 @@ def test_layer_streaming_maxpool(): model.set_tensor_datatype(tensor.name, DataType["BIPOLAR"]) # onnx.save(model.model, "max-pool-model.onnx") + + input_tensor = np.asarray( + [ + 1, + -1, + 1, + -1, + -1, + 1, + 1, + 1, + 1, + -1, + -1, + 1, + 1, + -1, + 1, + -1, + 1, + 1, + -1, + 1, + -1, + -1, + -1, + -1, + -1, + 1, + 1, + -1, + 1, + 1, + 1, + -1, + ], + dtype=np.float32, + ).reshape(2, 4, 4) + + input_dict = {"in": input_tensor} + output_dict = oxe.execute_onnx(model, input_dict) -- GitLab