Skip to content

Commit c54f142

Browse files
committed
[Test] extend quant weight conv testcase, now passing
1 parent 5e5bb55 commit c54f142

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/transformation/test_conv_lowering.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,19 @@
4343
from qonnx.transformation.infer_shapes import InferShapes
4444
from qonnx.transformation.lower_convs_to_matmul import LowerConvsToMatMul
4545
from qonnx.util.basic import gen_finn_dt_tensor, qonnx_make_model
46-
from qonnx.util.test import download_model
46+
from qonnx.util.test import download_model, get_golden_in_and_output
4747

4848

4949
def test_conv_lowering_quant_weights():
5050
model_name = "FINN-CNV_W2A2"
5151
model = download_model(model_name, return_modelwrapper=True, do_cleanup=True)
5252
model = model.transform(LowerConvsToMatMul())
5353
assert model.get_nodes_by_op_type("Conv") == []
54+
input_t, golden_t = get_golden_in_and_output(model_name)
55+
input_dict = {model.graph.input[0].name: input_t}
56+
prod_dict = oxe.execute_onnx(model, input_dict)
57+
prod_t = prod_dict[model.graph.output[0].name]
58+
assert (prod_t == golden_t).all()
5459

5560

5661
def test_conv_lowering_convmnist():

0 commit comments

Comments
 (0)