Skip to content

Commit

Permalink
[res] Add TFLiteRecipes for FullyConnected dynamic shape (#14157)
Browse files Browse the repository at this point in the history
This commit adds TFLiteRecipes for FullyConnected dynamic shape.

ONE-DCO-1.0-Signed-off-by: HanJin Choi [email protected]
  • Loading branch information
Hanjin-Choi authored Oct 7, 2024
1 parent ad1d197 commit 49d45bf
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 0 deletions.
45 changes: 45 additions & 0 deletions res/TensorFlowLiteRecipes/Inf_FullyConnected_000/test.recipe
Original file line number Diff line number Diff line change
@@ -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"
5 changes: 5 additions & 0 deletions res/TensorFlowLiteRecipes/Inf_FullyConnected_000/test.rule
Original file line number Diff line number Diff line change
@@ -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]
45 changes: 45 additions & 0 deletions res/TensorFlowLiteRecipes/Inf_FullyConnected_001/test.recipe
Original file line number Diff line number Diff line change
@@ -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"
5 changes: 5 additions & 0 deletions res/TensorFlowLiteRecipes/Inf_FullyConnected_001/test.rule
Original file line number Diff line number Diff line change
@@ -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]

0 comments on commit 49d45bf

Please sign in to comment.