-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[res] Add TFLiteRecipe for dynamic shape StridedSlice (#14156)
This commit adds TFLiteRecipe for dynamic shape StridedSlice. ONE-DCO-1.0-Signed-off-by: sunki <[email protected]>
- Loading branch information
Showing
4 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
res/TensorFlowLiteRecipes/Inf_StridedSlice_000/test.recipe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
46
res/TensorFlowLiteRecipes/Inf_StridedSlice_001/test.recipe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |