[MLBEDSW-3813] Fix LSTM operator pass through

Fixed pass through of LSTM operator.

Change-Id: I23140c69ab6cdc83f6bb8129256b4cc6a7c5ffac
Signed-off-by: Fredrik Svedberg <fredrik.svedberg@arm.com>
diff --git a/ethosu/vela/tflite_reader.py b/ethosu/vela/tflite_reader.py
index ae99c33..daea1bf 100644
--- a/ethosu/vela/tflite_reader.py
+++ b/ethosu/vela/tflite_reader.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2020 Arm Limited or its affiliates. All rights reserved.
+# Copyright (C) 2020-2021 Arm Limited or its affiliates. All rights reserved.
 #
 # SPDX-License-Identifier: Apache-2.0
 #
@@ -109,6 +109,7 @@
         dtype = datatype_map[tens_dtype]
         tens = Tensor(shape, dtype, name)
         quant = tens_data.Quantization()
+        tens.is_variable = tens_data.IsVariable()
 
         tens.quantization = QuantizationParameters()
         if quant is not None:
@@ -144,6 +145,10 @@
         op_type, opt_serializer, custom_code = self.graph.operator_codes[op_data.OpcodeIndex()]
         inputs = [self.tensors[idx] if idx != -1 else None for idx in op_data.InputsAsNumpy()]
         outputs = [self.tensors[idx] if idx != -1 else None for idx in op_data.OutputsAsNumpy()]
+        intermediates = []
+        if op_data.IntermediatesLength():
+            intermediates = [self.tensors[idx] if idx != -1 else None for idx in op_data.IntermediatesAsNumpy()]
+
         name = "unknown_op_name"
         if len(outputs):
             name = outputs[0].name
@@ -151,6 +156,7 @@
         op.op_index = op_index
         op.inputs = inputs
         op.outputs = outputs
+        op.intermediates = intermediates
         for out in op.outputs:
             out.ops = [op]