-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Common test infrastructure suggestions #14343
Common test infrastructure suggestions #14343
Conversation
@iefode could you take a look please? |
@@ -61,6 +61,16 @@ class SubgraphBaseTest : public CommonTestUtils::TestsCommon { | |||
virtual std::vector<ov::Tensor> get_plugin_outputs(); | |||
}; | |||
|
|||
inline std::vector<InputShape> dynamic_shapes_to_test_representation(const std::vector<ov::PartialShape>& shapes) { |
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.
Is there a example of usage?
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.
std::vector<InputShape> result; | ||
for (const auto& staticShape : shapes) { | ||
if (staticShape.is_dynamic()) | ||
throw std::runtime_error("dynamic_shapes_to_test_representation can process only static shapes"); |
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.
Not clear to understand why we can work with static shapes only in dynamic_shapes_to_test_representation
. What should do this function? Please provide3 more applicable name..
And:
result.push_back({{staticShape}, {staticShape.get_shape()}});
?? why do use such construction? if shapes are static? We can extend static_shapes_to_test_representation
for the case
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.
Right, static_shapes_to_test_representation
is used to transform std::vector<ov::Shape>
-> std::vector<InputShape>
. However, shapes are represented as std::vector<ov::PartialShape>
in dynamic tests, so I thought it would be nice to have a similar function that transforms std::vector<ov::PartialShape>
-> std::vector<InputShape>
.
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.
No problem, I can add static_shapes_to_test_representation
overload that takes std::vector<ov::PartialShape>
as an argument.
@@ -61,6 +61,16 @@ class SubgraphBaseTest : public CommonTestUtils::TestsCommon { | |||
virtual std::vector<ov::Tensor> get_plugin_outputs(); | |||
}; | |||
|
|||
inline std::vector<InputShape> static_shapes_to_test_representation(const std::vector<ov::PartialShape>& shapes) { |
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.
If i am correct, Shape is inherited from Partial shape
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.
That'll be too easy for us)
Shape is derived from vector<size_t> and PartialShape is not derived from anything.
Ok, so |
30fd8b9
to
8c713c1
Compare
Details: