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

[Test] fix broken test_brevitas_act_export

parent d0f22ee5
No related branches found
No related tags found
No related merge requests found
......@@ -5,11 +5,11 @@ import brevitas.onnx as bo
from brevitas.nn import QuantHardTanh
from brevitas.core.restrict_val import RestrictValueType
from brevitas.core.scaling import ScalingImplType
from models.common import get_quant_type
import pytest
from finn.core.modelwrapper import ModelWrapper
import finn.core.onnx_exec as oxe
from finn.transformation.infer_shapes import InferShapes
from brevitas.core.quant import QuantType
export_onnx_path = "test_act.onnx"
......@@ -18,6 +18,14 @@ export_onnx_path = "test_act.onnx"
@pytest.mark.parametrize("narrow_range", [False, True])
@pytest.mark.parametrize("max_val", [1.0, 1 - 2 ** (-7)])
def test_brevitas_act_export(abits, narrow_range, max_val):
def get_quant_type(bit_width):
if bit_width is None:
return QuantType.FP
elif bit_width == 1:
return QuantType.BINARY
else:
return QuantType.INT
act_quant_type = get_quant_type(abits)
min_val = -1.0
ishape = (1, 10)
......
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