Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functionalize #748

Closed
wants to merge 14 commits into from
Prev Previous commit
Next Next commit
Fix for wbiol in test_nn_quantizers
Giuseppe5 committed Jan 26, 2024
commit f4ade406655293a1d2daff3ba78dfc8b80818105
9 changes: 7 additions & 2 deletions tests/brevitas/nn/test_nn_quantizers.py
Original file line number Diff line number Diff line change
@@ -41,8 +41,13 @@ def test_quant_wbiol(model_input, current_cases):

is_input_quanttensor = kwargs['io_quant'] is not None or kwargs['input_quantized']

if (not is_input_quanttensor or
kwargs['weight_quant'] is None) and kwargs['bias_quant'] == 'quant_external':
if (not (is_input_quanttensor and kwargs['weight_quant'] is not None) and
kwargs['io_quant'] is None) and kwargs['return_quant_tensor']:
with pytest.raises(RuntimeError, match='QuantLayer is not correctly configured'):
output = model(input)
return
elif (not is_input_quanttensor or
kwargs['weight_quant'] is None) and kwargs['bias_quant'] == 'quant_external':
with pytest.raises(RuntimeError, match='Input scale required'):
output = model(input)
return