diff options
Diffstat (limited to 'ethosu/vela/tflite_model_semantic.py')
-rw-r--r-- | ethosu/vela/tflite_model_semantic.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ethosu/vela/tflite_model_semantic.py b/ethosu/vela/tflite_model_semantic.py index 6e2467bb..51d1f072 100644 --- a/ethosu/vela/tflite_model_semantic.py +++ b/ethosu/vela/tflite_model_semantic.py @@ -282,7 +282,7 @@ class TFLiteSemantic: "Input and Output tensors must have quantization scales that fit within float32 precision" if op.ofm is not None and op.ofm.is_quantized(): ofm_scale = op.ofm.quantization.scale_f32 - if ofm_scale < np.finfo(np.float32).tiny: + if np.any(ofm_scale < np.finfo(np.float32).tiny): return ( False, f"The quantization scale of the output tensor is {ofm_scale}, " @@ -290,7 +290,7 @@ class TFLiteSemantic: ) if op.ifm is not None and op.ifm.is_quantized(): ifm_scale = op.ifm.quantization.scale_f32 - if np.isinf(ifm_scale / ofm_scale): + if np.any(np.isinf(ifm_scale / ofm_scale)): return ( False, f"IFM scale divided by OFM scale is infinite, ifm_scale={ifm_scale} ofm_scale={ofm_scale}", |