aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/weight_compressor.py
diff options
context:
space:
mode:
authorPatrik Gustavsson <patrik.gustavsson@arm.com>2020-07-10 10:12:17 +0200
committerPatrik Gustavsson <patrik.gustavsson@arm.com>2020-07-10 10:12:17 +0200
commit5ff994417eae32175b5c72dc433edc4a9f12a8cc (patch)
tree27807000b40462adce741a63f04cfa2ad4a78a7e /ethosu/vela/weight_compressor.py
parentd89c09eb8d9f5a705c16ebbdac90876034971765 (diff)
downloadethos-u-vela-5ff994417eae32175b5c72dc433edc4a9f12a8cc.tar.gz
MLBEDSW-2634 Avoid encoding empty weights stream
Avoid encoding empty weights stream. Signed-off-by: Patrik Gustavsson <patrik.gustavsson@arm.com> Change-Id: I120ede14f19705e169c5f03ed344036a58b5f84f
Diffstat (limited to 'ethosu/vela/weight_compressor.py')
-rw-r--r--ethosu/vela/weight_compressor.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/ethosu/vela/weight_compressor.py b/ethosu/vela/weight_compressor.py
index 93000408..8ebd7511 100644
--- a/ethosu/vela/weight_compressor.py
+++ b/ethosu/vela/weight_compressor.py
@@ -76,6 +76,8 @@ class CompressedWeightCache:
def encode(weight_stream):
+ if len(weight_stream) == 0:
+ return []
assert np.amin(weight_stream) >= -255
assert np.amax(weight_stream) <= 255