From 9e94af8f10f0a21a117b3bc7ea42004844fdc3bb Mon Sep 17 00:00:00 2001 From: Jerry Ge Date: Thu, 27 Oct 2022 09:57:00 -0700 Subject: Reference model update for control flow operators support Rationale for making this change: - In the original design, for control flow operators like WhileOp, child blocks couldn't read the tensor variables (global consts) in the root level block, this patch added the machanism for child blocks to access their parent level block's tensors. - This change also relies on another serialization change on adding another layer of abtraction called Region: - Serialization patch: [region] Add TosaSerializationRegion to serialization_lib - Updated the corresponding python version of the serialization code: TosaSerializerRegion to python version of serialization_lib - This change also relies on the TOSA MLIR Translator change: Add RegionBuilder to TOSA MLIR Translator - Added the WhileOp related test cases: While, LSTM, GRU, RNN - Other related fixes Signed-off-by: Jerry Ge Change-Id: I13ae33628ad07e41d248e88652ce1328654694ab --- verif/frameworks/tosa_verif_framework_generator.py | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'verif/frameworks/tosa_verif_framework_generator.py') diff --git a/verif/frameworks/tosa_verif_framework_generator.py b/verif/frameworks/tosa_verif_framework_generator.py index 760def6..26af5dd 100755 --- a/verif/frameworks/tosa_verif_framework_generator.py +++ b/verif/frameworks/tosa_verif_framework_generator.py @@ -807,6 +807,42 @@ TF_OP_LIST = { ] }, }, + "while": { + "operands": (1, 0), + "build_fcn": (TBuilder.While, TGen.tgBasic, ArgGen.agNone), + "types": { + "tflite": list(TYPE_F), + }, + }, + "lstm": { + "operands": (1, 0), + "build_fcn": (TBuilder.LSTM, TGen.tgRecurrent, ArgGen.agNone), + "types": { + "tflite": [ + tf.float32, + # tf.int32 + ] + }, + }, + "gru": { + "operands": (1, 0), + "build_fcn": (TBuilder.GRU, TGen.tgRecurrent, ArgGen.agNone), + "types": { + "tflite": [ + tf.float32, + # tf.int32 + ] + }, + }, + "rnn": { + "operands": (1, 0), + "build_fcn": (TBuilder.RNN, TGen.tgRecurrent, ArgGen.agNone), + "types": { + "tflite": [ + tf.float32, + ] + }, + }, } # Shapes to be tested; default can be overwritten -- cgit v1.2.1