diff options
author | Johan Alfven <johan.alfven@arm.com> | 2023-05-15 11:22:48 +0200 |
---|---|---|
committer | Johan Alfven <johan.alfven@arm.com> | 2023-05-15 17:22:23 +0200 |
commit | 0426fe9de82e0f6b339edbd2bec78a5d322fb05f (patch) | |
tree | 6db358672e936e8941724335963dc6d93045532b /ethosu | |
parent | 3e7d544134f602eb40ce2a242b6c5f0433fe3543 (diff) | |
download | ethos-u-vela-0426fe9de82e0f6b339edbd2bec78a5d322fb05f.tar.gz |
MLBEDSW-7613: Crash when compiling model with resource variables
Fixed serializing of attribute container and shared_name that
accidently got lost when fixing the crash for a faulty LSTM model.
Change-Id: Ibd11da65735112bed4b1c8bcc4ef048bc093ebc4
Signed-off-by: Johan Alfven <johan.alfven@arm.com>
Diffstat (limited to 'ethosu')
-rw-r--r-- | ethosu/vela/tflite_writer.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ethosu/vela/tflite_writer.py b/ethosu/vela/tflite_writer.py index 8c03f051..ae529a43 100644 --- a/ethosu/vela/tflite_writer.py +++ b/ethosu/vela/tflite_writer.py @@ -314,12 +314,14 @@ class TFLiteSerialiser: attrs["dilation_w_factor"] = attrs["dilation"][2] if "channel_multiplier" in attrs: attrs["depth_multiplier"] = attrs["channel_multiplier"] - if "container" in attrs: - attrs["container"] = builder.CreateString(attrs["container"]) - if "shared_name" in attrs: - attrs["shared_name"] = builder.CreateString(attrs["shared_name"]) attrs["fused_activation_function"] = op.activation.op_type if op.activation is not None else None + # Serialize VarHandleOptions (only op that have attributes with type String) + if "container" in attrs: + attrs["container"] = builder.CreateString(attrs["container"]) + if "shared_name" in attrs: + attrs["shared_name"] = builder.CreateString(attrs["shared_name"]) + builtin_opt_offset, custom_opt_offset = opt_serializer.serialize(builder, attrs) # report any missing attributes that could not be written during serialize(). |