Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[res] Add TFLiteRecipe for FullyConnected dynamic shape #14157

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not strictly necessary, but
It might also be a good to add another recipe that corresponds to the case where keep_num_dims: true.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add the case with 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_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]