diff options
author | Louis Verhaard <louis.verhaard@arm.com> | 2020-09-30 09:01:52 +0200 |
---|---|---|
committer | Louis Verhaard <louis.verhaard@arm.com> | 2020-10-08 16:29:29 +0200 |
commit | aee5d7537ff81ffda5ba222721b72f914ce50fb8 (patch) | |
tree | 495b9dfff2a188c6916f8ca2e390ee88f7da8ccc /ethosu/vela/test/test_tflite_reader.py | |
parent | 36ad73a0fb46d3f844845c97c56d92de2a7a9b3d (diff) | |
download | ethos-u-vela-aee5d7537ff81ffda5ba222721b72f914ce50fb8.tar.gz |
MLBEDSW-3148: Refactor Operation
- op.type is now an enum instead of a string
- Removed unused operator codes
- Refactored some attributes like npu_block_type, fused_activation_function
- Refactored operator index calculation
- Refactored a number of operator sets
Change-Id: I641f65ee375794b7aec42abc0664251ae37d78e8
Signed-off-by: Louis Verhaard <louis.verhaard@arm.com>
Diffstat (limited to 'ethosu/vela/test/test_tflite_reader.py')
-rw-r--r-- | ethosu/vela/test/test_tflite_reader.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/ethosu/vela/test/test_tflite_reader.py b/ethosu/vela/test/test_tflite_reader.py index d63c0007..23abb4a0 100644 --- a/ethosu/vela/test/test_tflite_reader.py +++ b/ethosu/vela/test/test_tflite_reader.py @@ -20,6 +20,7 @@ from unittest.mock import patch import pytest +from ethosu.vela.operation import Op from ethosu.vela.tflite_reader import TFLiteSubgraph @@ -41,13 +42,13 @@ class TestTFLiteSubgraph: parse_op_testdata = [ # op_type, opt_serializer, inputs, output, expected - ("FullyConnected", None, [0, 1, 2], 3, 3), # FC - ("FullyConnected", None, [0, 1, -1], 3, 3), # FC disabled Bias - ("FullyConnected", None, [0, 1], 3, 3), # FC no Bias - ("Conv2D", None, [2, 1, 3], 0, 3), # Conv2D - ("Conv2DBackprop", None, [0, 1, 2, 3], 4, 4), # TransposeConv - ("Conv2DBackprop", None, [0, 1, 2], 4, 4), # TransposeConv no Bias - pytest.param("Conv2D", None, [0, -1, 1], 3, 3, marks=pytest.mark.xfail), # Conv2D no Weights + (Op.FullyConnected, None, [0, 1, 2], 3, 3), # FC + (Op.FullyConnected, None, [0, 1, -1], 3, 3), # FC disabled Bias + (Op.FullyConnected, None, [0, 1], 3, 3), # FC no Bias + (Op.Conv2D, None, [2, 1, 3], 0, 3), # Conv2D + (Op.Conv2DBackpropInput, None, [0, 1, 2, 3], 4, 4), # TransposeConv + (Op.Conv2DBackpropInput, None, [0, 1, 2], 4, 4), # TransposeConv no Bias + pytest.param(Op.Conv2D, None, [0, -1, 1], 3, 3, marks=pytest.mark.xfail), # Conv2D no Weights ] @pytest.mark.parametrize("op_type, opt_serializer, inputs, output, expected", parse_op_testdata) @@ -56,7 +57,7 @@ class TestTFLiteSubgraph: # Mock a TFLiteSubGraph sg = TFLiteSubgraph(None, None) sg.graph = MagicMock() - sg.graph.operator_codes = [(op_type, opt_serializer)] + sg.graph.operator_codes = [(op_type, opt_serializer, "")] # Mock a couple of tensors sg.tensors = [MagicMock() for _ in range(5)] |