From e8a5a78dd16ec979c7a7bb1f5bd87e9b2909c32d Mon Sep 17 00:00:00 2001 From: Louis Verhaard Date: Mon, 2 Nov 2020 18:04:27 +0100 Subject: MLBEDSW-839: Code generation using external API Added external API to generate register command streams. Existing code generation has been refactored to make use of this API. Change-Id: Ibb4c2b167809869f16470b14da24f08a65c82b7b Signed-off-by: Louis Verhaard --- ethosu/vela/tflite_reader.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ethosu/vela/tflite_reader.py') diff --git a/ethosu/vela/tflite_reader.py b/ethosu/vela/tflite_reader.py index 24f9f874..b3b0720a 100644 --- a/ethosu/vela/tflite_reader.py +++ b/ethosu/vela/tflite_reader.py @@ -23,6 +23,7 @@ from .errors import InputFileError from .errors import TensorError from .nn_graph import Graph from .nn_graph import Subgraph +from .operation import create_activation_function from .operation import Op from .operation import Operation from .tensor import QuantizationParameters @@ -186,7 +187,9 @@ class TFLiteSubgraph: if "depth_multiplier" in op.attrs: op.attrs["channel_multiplier"] = op.attrs["depth_multiplier"] - op.activation = op.attrs.pop("fused_activation_function", None) + faf = op.attrs.pop("fused_activation_function", None) + if faf is not None: + op.activation = create_activation_function(faf) if custom_code is not None: op.attrs["custom_code"] = custom_code -- cgit v1.2.1