MLBEDSW-2634 Avoid encoding empty weights stream
Avoid encoding empty weights stream.
Signed-off-by: Patrik Gustavsson <patrik.gustavsson@arm.com>
Change-Id: I120ede14f19705e169c5f03ed344036a58b5f84f
diff --git a/ethosu/vela/weight_compressor.py b/ethosu/vela/weight_compressor.py
index 9300040..8ebd751 100644
--- a/ethosu/vela/weight_compressor.py
+++ b/ethosu/vela/weight_compressor.py
@@ -76,6 +76,8 @@
def encode(weight_stream):
+ if len(weight_stream) == 0:
+ return []
assert np.amin(weight_stream) >= -255
assert np.amax(weight_stream) <= 255