Skip to content

Commit

Permalink
Common test infrastructure suggestions (#14343)
Browse files Browse the repository at this point in the history
* Common test infrastructure: test helper for partial shapes, data generation fix

* Overload static_shapes_to_test_representation to accept PartialShape vector

* Rename to static_partial_shapes_to_test_representation
  • Loading branch information
IvanNovoselov authored Jan 11, 2023
1 parent 7fad6f9 commit 1d59a5a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ class SubgraphBaseTest : public CommonTestUtils::TestsCommon {
virtual std::vector<ov::Tensor> get_plugin_outputs();
};

inline std::vector<InputShape> static_partial_shapes_to_test_representation(const std::vector<ov::PartialShape>& shapes) {
std::vector<InputShape> result;
for (const auto& staticShape : shapes) {
if (staticShape.is_dynamic())
throw std::runtime_error("static_partial_shapes_to_test_representation can process only static partial shapes");
result.push_back({{staticShape}, {staticShape.get_shape()}});
}
return result;
}

inline std::vector<std::vector<InputShape>> static_shapes_to_test_representation(const std::vector<std::vector<ov::Shape>>& shapes) {
std::vector<std::vector<InputShape>> result;
for (const auto& staticShapes : shapes) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ ov::runtime::Tensor generate(const std::shared_ptr<ov::Node>& node,
namespace Activation {
ov::runtime::Tensor generate(const ov::element::Type& elemType,
const ov::Shape& targetShape,
InputGenerateData inGenData = InputGenerateData(10, 20, 32768, 1)) {
InputGenerateData inGenData = InputGenerateData(-1, 2*32768, 32768, 1)) {
if (!elemType.is_signed()) {
inGenData.range = 15;
inGenData.start_from = 0;
Expand Down

0 comments on commit 1d59a5a

Please sign in to comment.