From 49d45bf94d98a2dc346897899ea3a682ea51f4a0 Mon Sep 17 00:00:00 2001 From: HanJin Choi <156498561+Hanjin-Choi@users.noreply.github.com> Date: Tue, 8 Oct 2024 07:35:40 +0900 Subject: [PATCH] [res] Add TFLiteRecipes for FullyConnected dynamic shape (#14157) This commit adds TFLiteRecipes for FullyConnected dynamic shape. ONE-DCO-1.0-Signed-off-by: HanJin Choi hanjin4647@gmail.com --- .../Inf_FullyConnected_000/test.recipe | 45 +++++++++++++++++++ .../Inf_FullyConnected_000/test.rule | 5 +++ .../Inf_FullyConnected_001/test.recipe | 45 +++++++++++++++++++ .../Inf_FullyConnected_001/test.rule | 5 +++ 4 files changed, 100 insertions(+) create mode 100644 res/TensorFlowLiteRecipes/Inf_FullyConnected_000/test.recipe create mode 100644 res/TensorFlowLiteRecipes/Inf_FullyConnected_000/test.rule create mode 100644 res/TensorFlowLiteRecipes/Inf_FullyConnected_001/test.recipe create mode 100644 res/TensorFlowLiteRecipes/Inf_FullyConnected_001/test.rule diff --git a/res/TensorFlowLiteRecipes/Inf_FullyConnected_000/test.recipe b/res/TensorFlowLiteRecipes/Inf_FullyConnected_000/test.recipe new file mode 100644 index 00000000000..e42fbcd9775 --- /dev/null +++ b/res/TensorFlowLiteRecipes/Inf_FullyConnected_000/test.recipe @@ -0,0 +1,45 @@ +operand { + name: "ifm" + type: FLOAT32 + shape { dim: 1 dim: 2 dim: 3 } + shape_signature { dim: -1 dim: 2 dim: 3} +} +operand { + name: "weight" + type: FLOAT32 + shape { dim: 4 dim: 3 } + filler { + tag: "gaussian" + arg: "0.0" + arg: "1.0" + } +} +operand { + name: "bias" + type: FLOAT32 + shape { dim: 4 } + filler { + tag: "gaussian" + arg: "0.0" + arg: "1.0" + } +} +operand { + name: "ofm" + type: FLOAT32 + shape { dim: 1 dim: 4 } + shape_signature { dim: -1 dim: 4 } +} +operation { + type: "FullyConnected" + fullyconnected_options { + activation: NONE + keep_num_dims: false + } + input: "ifm" + input: "weight" + input: "bias" + output: "ofm" +} +input: "ifm" +output: "ofm" diff --git a/res/TensorFlowLiteRecipes/Inf_FullyConnected_000/test.rule b/res/TensorFlowLiteRecipes/Inf_FullyConnected_000/test.rule new file mode 100644 index 00000000000..85172f18056 --- /dev/null +++ b/res/TensorFlowLiteRecipes/Inf_FullyConnected_000/test.rule @@ -0,0 +1,5 @@ +# To check if dynamic dimension properly inferred + +RULE "VERIFY_FILE_FORMAT" $(verify_file_format) '=' 1 + +RULE "FC_SHAPE" $(tensor_shape ofm) '=' [-1,4] diff --git a/res/TensorFlowLiteRecipes/Inf_FullyConnected_001/test.recipe b/res/TensorFlowLiteRecipes/Inf_FullyConnected_001/test.recipe new file mode 100644 index 00000000000..e66d279d86e --- /dev/null +++ b/res/TensorFlowLiteRecipes/Inf_FullyConnected_001/test.recipe @@ -0,0 +1,45 @@ +operand { + name: "ifm" + type: FLOAT32 + shape { dim: 1 dim: 2 dim: 3 } + shape_signature { dim: -1 dim: 2 dim: 3} +} +operand { + name: "weight" + type: FLOAT32 + shape { dim: 4 dim: 3 } + filler { + tag: "gaussian" + arg: "0.0" + arg: "1.0" + } +} +operand { + name: "bias" + type: FLOAT32 + shape { dim: 4 } + filler { + tag: "gaussian" + arg: "0.0" + arg: "1.0" + } +} +operand { + name: "ofm" + type: FLOAT32 + shape { dim: 1 dim: 2 dim: 4 } + shape_signature { dim: -1 dim: 2 dim: 4 } +} +operation { + type: "FullyConnected" + fullyconnected_options { + activation: NONE + keep_num_dims: true + } + input: "ifm" + input: "weight" + input: "bias" + output: "ofm" +} +input: "ifm" +output: "ofm" diff --git a/res/TensorFlowLiteRecipes/Inf_FullyConnected_001/test.rule b/res/TensorFlowLiteRecipes/Inf_FullyConnected_001/test.rule new file mode 100644 index 00000000000..19fdc69e878 --- /dev/null +++ b/res/TensorFlowLiteRecipes/Inf_FullyConnected_001/test.rule @@ -0,0 +1,5 @@ +# To check if dynamic dimension properly inferred + +RULE "VERIFY_FILE_FORMAT" $(verify_file_format) '=' 1 + +RULE "FC_SHAPE" $(tensor_shape ofm) '=' [-1,2,4]