diff options
author | Patrik Gustavsson <patrik.gustavsson@arm.com> | 2020-07-10 10:12:17 +0200 |
---|---|---|
committer | Patrik Gustavsson <patrik.gustavsson@arm.com> | 2020-07-10 10:12:17 +0200 |
commit | 5ff994417eae32175b5c72dc433edc4a9f12a8cc (patch) | |
tree | 27807000b40462adce741a63f04cfa2ad4a78a7e /ethosu/vela/weight_compressor.py | |
parent | d89c09eb8d9f5a705c16ebbdac90876034971765 (diff) | |
download | ethos-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.py | 2 |
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 |