Skip to content

Commit

Permalink
Move build dir creation into test
Browse files Browse the repository at this point in the history
  • Loading branch information
fpjentzsch committed Jan 7, 2025
1 parent ee29287 commit abb96d6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions tests/brevitas/test_brevitas_fc.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@
from finn.util.basic import make_build_dir
from finn.util.test import get_test_model_trained

export_onnx_path = make_build_dir("test_brevitas_fc_")


@pytest.mark.brevitas_export
# act bits
Expand All @@ -61,6 +59,7 @@ def test_brevitas_fc_onnx_export_and_exec(size, wbits, abits):
if wbits > abits:
pytest.skip("No wbits > abits cases at the moment")
nname = "%s_%dW%dA" % (size, wbits, abits)
export_onnx_path = make_build_dir("test_brevitas_fc_")
finn_onnx = export_onnx_path + "/%s.onnx" % nname
fc = get_test_model_trained(size, wbits, abits)
ishape = (1, 1, 28, 28)
Expand Down
3 changes: 1 addition & 2 deletions tests/transformation/streamline/test_streamline_cnv.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@
from finn.util.basic import make_build_dir
from finn.util.test import get_test_model_trained

export_onnx_path = make_build_dir("test_streamline_cnv_")


@pytest.mark.streamline
# act bits
Expand All @@ -64,6 +62,7 @@ def test_streamline_cnv(size, wbits, abits):
if wbits > abits:
pytest.skip("No wbits > abits cases at the moment")
nname = "%s_%dW%dA" % (size, wbits, abits)
export_onnx_path = make_build_dir("test_streamline_cnv_")
finn_onnx = export_onnx_path + "/%s.onnx" % nname
fc = get_test_model_trained(size, wbits, abits)
export_qonnx(fc, torch.randn(1, 3, 32, 32), finn_onnx)
Expand Down
3 changes: 1 addition & 2 deletions tests/transformation/streamline/test_streamline_fc.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@
from finn.util.basic import make_build_dir
from finn.util.test import get_test_model_trained

export_onnx_path = make_build_dir("test_streamline_fc_")


@pytest.mark.streamline
# act bits
Expand All @@ -68,6 +66,7 @@ def test_streamline_fc(size, wbits, abits):
if wbits > abits:
pytest.skip("No wbits > abits cases at the moment")
nname = "%s_%dW%dA" % (size, wbits, abits)
export_onnx_path = make_build_dir("test_streamline_fc_")
finn_onnx = export_onnx_path + "/%s.onnx" % nname
fc = get_test_model_trained(size, wbits, abits)
export_qonnx(fc, torch.randn(1, 1, 28, 28), finn_onnx)
Expand Down

0 comments on commit abb96d6

Please sign in to comment.