-
Notifications
You must be signed in to change notification settings - Fork 159
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
[onert] Introduce tests for Reshape, Squeeze and ExpandDims #14227
[onert] Introduce tests for Reshape, Squeeze and ExpandDims #14227
Conversation
This commit adds more tests for Reshape, Squeeze and ExpandDims. The purpose is to cover the cases where memory copying of those ops can be skipped. ONE-DCO-1.0-Signed-off-by: Mateusz Bencer [email protected]
int reshape_out = cgen.addTensor({{2, 2}, circle::TensorType::TensorType_FLOAT32}); | ||
int cos2_out = cgen.addTensor({{2, 2}, circle::TensorType::TensorType_FLOAT32}); | ||
|
||
cgen.addOperatorCos({{input}, {cos1_out}}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for curiosity,
Is there a specific reason to choose cos
operator?
Did you choose cos
because it is element-wise operator - which works without additional arguments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This cos node is needed just to not set Reshape input/output as a input/output of the whole model (in such a case sharing memory is disabled). But I see your confusion so I've wrapped it in helper function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I see your confusion so I've wrapped it in helper function.
Sorry, I've forgot to push the code last time ;)
@mbencer Please add negative test: same or more negative test with positive test to fulfill release criteria. |
I see the argument about release criteria. Due to fact that compilation/inference should run without errors both with and without my optimization it's hard to write such negative unit test explicitly. To fulfill the requirements I've just added some general negative tests for the related operators. |
FYI: I will be on vacation until 26 (Nov) so please expect delays in communication ;-) |
@hseok-oh Please let me know if you are ok with such approach ;) |
@nnfw-bot test onert-x64-release |
@@ -75,6 +75,25 @@ TEST_F(GenModelTest, OneOp_neg_ExpandDims_Axis) | |||
SUCCEED(); | |||
} | |||
|
|||
TEST_F(GenModelTest, OneOp_neg_ExpandDims_NegAxis) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Negative test's name should start with neg_
. Please remove OneOp_
prefix. (Same on other negative tests)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@zetwhite @glistening ping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This commit adds more tests for Reshape, Squeeze and ExpandDims. The purpose is to cover the cases where memory copying of those ops can be skipped.
ONE-DCO-1.0-Signed-off-by: Mateusz Bencer [email protected]
Draft: #14057