aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/scaling.py
diff options
context:
space:
mode:
Diffstat (limited to 'ethosu/vela/scaling.py')
-rw-r--r--ethosu/vela/scaling.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/ethosu/vela/scaling.py b/ethosu/vela/scaling.py
index 7019c217..fcf054e0 100644
--- a/ethosu/vela/scaling.py
+++ b/ethosu/vela/scaling.py
@@ -33,7 +33,7 @@ def quantise_scale(scale):
exponent_q31 = exponent - 31
shift = exponent_q31 * -1
- if shift >= (1 << 6):
+ if not (0 <= shift < (1 << 6)):
# Shift outside of valid range, set scale to 0
return 0, 16