-
Notifications
You must be signed in to change notification settings - Fork 157
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
[compiler] Support the dynamic shape of StridedSlice #13932
Comments
Note#13914 was the first DRAFT to support this. |
I'm going to try to create a similar but simpler model to replicate this scenario. |
Does the "axis" in the sentence
refers to the "axis" in the sentence below?
|
yes! |
I've modify this a little bit.. I found that if the dimension marked with the red circle is dynamic in #13932 (comment), the The For example:
In this case, the shape of the However, since the Note: the notation of |
ConclusionRegardless of whether the input is static or dynamic, This means all the dimensions should be |
To-doI made a test model for this. Test Model: strided_slice.zip
Unzip and run above command, then you will get Just like the This should be (<?x?x?>). |
This comment was marked as off-topic.
This comment was marked as off-topic.
Oh, I mis-understood your question. Yes, that's right. It's up to you to decide what to do, but we usually follow the policy of leaving it as is in this case. 😅 |
IMHO, In some cases, part of the output's dimensions can be determined. Example 1: When the dimension of begin, end, or strides is smaller than the input's rank: Example 2: When a new axis is added: |
Yes, some dimensions can be calculated as you mentioned. I think we should first implement the requirements in To-do and then think about this further. FYI, in the optimization process, not only For these detailed parts, it would be better to first proceed with the To-do requirement, then create a model corresponding to the actual test case you've mentioned, run it, and proceed further if there is a problem. |
@Samsung/ssafy_2024 You can generate tflite using For StrideSlice,
|
I don't understand how to modify bytes in I changed
to
then How can I make a |
try this.
|
I don't know the details of Out of curiosity, I searched and found ONE/compiler/tflchef/proto/tflchef.proto Lines 41 to 47 in 72349cc
Please notice that I didn't know this. My guide was based on circle schema. circle schema says: ONE/nnpackage/schema/circle_schema.fbs Lines 224 to 228 in 72349cc
It is the reason I said a few bytes. Please modify (Or you may edit a few bytes by editing circle directly using hex editor.) Footnotes
|
Close this issue as related PRs merged |
What
Let's try to support dynamic shape inference for the StridedSlice operation.
The main goal of this work is to support models inference of dynamic shapes from #13697.
The below image is a part of some model we are looking into,
and the dimension marked with red circle can be dynamic.
like
<1x18x?x80>
.Conditions
The StridedSlice operation cuts a portion of a tensor along a specific axis,
and since there are many cases, the implementation can be complicated.
In this issue, let's focus only when the following conditions are satisfied.
(I removed most of below conditions, because of #13932 (comment))
begin
is a constant (static)end
is a constant (static)end
end
is a constant (static), only if the input shape is all staticend
is a input node, if any dimension of the input is dynamicstride
is a constant and all the values are1
the input dimension of "axis" should NOT be dynamic, others can be dynamic(Added)
Regardless of whether the input is static or dynamic,
if either
begin
orend
is not constant,the
output
ofStridedSlice
should be converted to dynamic shape.This means all the dimensions should be
?
.i.e., if the input rank is 3, the shape of output will be
<?x?x?>
Related from #13697
The text was updated successfully, but these errors were encountered: