Common test infrastructure suggestions (#14343)

* 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
This commit is contained in:
Ivan Novoselov 2023-01-11 10:50:39 +00:00 committed by GitHub
parent 7fad6f9b29
commit 1d59a5a29b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -62,6 +62,16 @@ protected:
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) {

View File

@ -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;