aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwilisa01 <william.isaksson@arm.com>2023-02-09 15:12:08 +0000
committerRickard Bolin <rickard.bolin@arm.com>2023-02-13 10:45:48 +0000
commit49396338b8b37544fff06dff45c0dc05c31e64e9 (patch)
tree6c97517698f650d715961459eddf71cef5a8ec62
parent899500deca4d93aa3e399c02ac67d164230dc87c (diff)
downloadethos-u-vela-49396338b8b37544fff06dff45c0dc05c31e64e9.tar.gz
MLBEDSW-7250: pytest RuntimeWarning: overflow encountered in float_scalars
Since test works by creating an overflow, sets NumPy to ignore overflow for this test case Change-Id: I74d03e8d73455295168352542dcb844283d54d33 Signed-off-by: wilisa01 <william.isaksson@arm.com>
-rw-r--r--ethosu/vela/test/test_tflite_model_semantic.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/ethosu/vela/test/test_tflite_model_semantic.py b/ethosu/vela/test/test_tflite_model_semantic.py
index e26a327f..fd23d042 100644
--- a/ethosu/vela/test/test_tflite_model_semantic.py
+++ b/ethosu/vela/test/test_tflite_model_semantic.py
@@ -138,7 +138,13 @@ def test_constraint_quant_scale_inf():
op = testutil.create_op_with_quant_tensors(Op.Relu, [1, 8, 8, 8], [1, 8, 8, 8])
op.ifm.quantization.scale_f32 = np.float32(1e9)
op.ofm.quantization.scale_f32 = np.float32(1e-35)
- assert not semantic_checker.is_operator_semantic_valid(op)
+ # Temporarily ignore overflow in NumPy
+ old_settings = np.seterr(over="ignore", under="ignore")
+ valid = semantic_checker.is_operator_semantic_valid(op)
+ # Reset NumPy settings
+ np.seterr(**old_settings)
+
+ assert not valid
def test_constraint_ofm_scale_too_small():