Skip to content
Snippets Groups Projects
Commit 939d8c91 authored by Yaman Umuroglu's avatar Yaman Umuroglu
Browse files

[Test] call DoubleToSingleFloat for cnv import test

parent f8ac1998
No related branches found
No related tags found
No related merge requests found
......@@ -37,6 +37,8 @@ import finn.core.onnx_exec as oxe
from finn.core.modelwrapper import ModelWrapper
from finn.transformation.fold_constants import FoldConstants
from finn.transformation.infer_shapes import InferShapes
from finn.transformation.general import GiveUniqueNodeNames
from finn.transformation.double_to_single_float import DoubleToSingleFloat
from finn.util.test import get_test_model_trained, get_test_model_untrained
export_onnx_path = "test_output_cnv.onnx"
......@@ -58,9 +60,10 @@ def test_brevitas_cnv_w1a1_export_exec():
cnv = get_test_model_trained("CNV", 1, 1)
bo.export_finn_onnx(cnv, (1, 3, 32, 32), export_onnx_path)
model = ModelWrapper(export_onnx_path)
model = model.transform(GiveUniqueNodeNames())
model = model.transform(DoubleToSingleFloat())
model = model.transform(InferShapes())
model = model.transform(FoldConstants())
model.save(export_onnx_path)
fn = pk.resource_filename("finn", "data/cifar10/cifar10-test-data-class3.npz")
input_tensor = np.load(fn)["arr_0"].astype(np.float32)
assert input_tensor.shape == (1, 3, 32, 32)
......
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