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 dynamic shape StridedSlice #14156

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
47 changes: 47 additions & 0 deletions res/TensorFlowLiteRecipes/Inf_StridedSlice_000/test.recipe
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
operand {
name: "ifm"
type: FLOAT32
shape { dim: 1 dim: 0 dim: 0 dim: 5 }
shape_signature { dim: 1 dim: -1 dim: -1 dim: 5 }
}
operand {
name: "begin"
type: INT32
shape { dim: 4 }
filler { tag: "explicit" arg: "0" arg: "0" arg: "0" arg: "0" }
}
operand {
name: "end"
type: INT32
shape { dim: 4 }
filler { tag: "explicit" arg: "1" arg: "8" arg: "3" arg: "5" }
}
operand {
name: "strides"
type: INT32
shape { dim: 4 }
filler { tag: "explicit" arg: "1" arg: "1" arg: "1" arg: "1" }
}
operand {
name: "ofm"
type: FLOAT32
shape { dim: 1 dim: 0 dim: 0 dim: 5 }
shape_signature { dim: 1 dim: -1 dim: -1 dim: 5 }
}
operation {
type: "StridedSlice"
input: "ifm"
input: "begin"
input: "end"
input: "strides"
output: "ofm"
strided_slice_options {
begin_mask: 0
end_mask: 0
ellipsis_mask: 0
new_axis_mask: 0
shrink_axis_mask: 0
}
}
input: "ifm"
output: "ofm"
5 changes: 5 additions & 0 deletions res/TensorFlowLiteRecipes/Inf_StridedSlice_000/test.rule
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# To check if dynamic dimension properly inferred if input has dynamic shape

RULE "VERIFY_FILE_FORMAT" $(verify_file_format) '=' 1

RULE "STRIDED_SLICE_SHAPE" $(tensor_shape ofm) '=' [1,-1,-1,5]
46 changes: 46 additions & 0 deletions res/TensorFlowLiteRecipes/Inf_StridedSlice_001/test.recipe
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
operand {
name: "ifm"
type: FLOAT32
shape { dim: 1 dim: 8 dim: 3 dim: 5 }
}
operand {
name: "begin"
type: INT32
shape { dim: 4 }
}
operand {
name: "end"
type: INT32
shape { dim: 4 }
filler { tag: "explicit" arg: "1" arg: "8" arg: "3" arg: "5" }
}
operand {
name: "strides"
type: INT32
shape { dim: 4 }
filler { tag: "explicit" arg: "1" arg: "1" arg: "1" arg: "1" }
}
operand {
name: "ofm"
type: FLOAT32
shape { dim: 0 dim: 0 dim: 0 dim: 0 }
shape_signature { dim: -1 dim: -1 dim: -1 dim: -1 }
}
operation {
type: "StridedSlice"
input: "ifm"
input: "begin"
input: "end"
input: "strides"
output: "ofm"
strided_slice_options {
begin_mask: 0
end_mask: 0
ellipsis_mask: 0
new_axis_mask: 0
shrink_axis_mask: 0
}
}
input: "ifm"
input: "begin"
output: "ofm"
5 changes: 5 additions & 0 deletions res/TensorFlowLiteRecipes/Inf_StridedSlice_001/test.rule
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# To check if dynamic dimension properly inferred if begin is non-const

RULE "VERIFY_FILE_FORMAT" $(verify_file_format) '=' 1

RULE "STRIDED_SLICE_SHAPE" $(tensor_shape ofm) '=' [-1,-1,-1,-1]