Finalization of migration core unit tests (#19468)
This commit is contained in:
parent
e6f09ac197
commit
f30afa9ad3
@ -366,19 +366,17 @@ TEST(constant, int4_vector_broadcast_positive_number) {
|
|||||||
|
|
||||||
TEST(constant, int4_input_value_validation) {
|
TEST(constant, int4_input_value_validation) {
|
||||||
Shape shape{2};
|
Shape shape{2};
|
||||||
EXPECT_THROW(ov::op::v0::Constant c(element::i4, shape, 8), ::ngraph::CheckFailure);
|
EXPECT_THROW(ov::op::v0::Constant c(element::i4, shape, 8), ::ov::AssertFailure);
|
||||||
EXPECT_THROW(ov::op::v0::Constant c(element::i4, shape, -9), ::ngraph::CheckFailure);
|
EXPECT_THROW(ov::op::v0::Constant c(element::i4, shape, -9), ::ov::AssertFailure);
|
||||||
|
|
||||||
EXPECT_THROW(ov::op::v0::Constant c(element::i4, shape, std::vector<int>{-9}), ::ngraph::CheckFailure);
|
EXPECT_THROW(ov::op::v0::Constant c(element::i4, shape, std::vector<int>{-9}), ::ov::AssertFailure);
|
||||||
EXPECT_THROW(ov::op::v0::Constant c(element::i4, shape, std::vector<int>{8}), ::ngraph::CheckFailure);
|
EXPECT_THROW(ov::op::v0::Constant c(element::i4, shape, std::vector<int>{8}), ::ov::AssertFailure);
|
||||||
|
|
||||||
EXPECT_THROW(ov::op::v0::Constant c(element::i4, shape, std::vector<int>{-9, 1}), ::ngraph::CheckFailure);
|
EXPECT_THROW(ov::op::v0::Constant c(element::i4, shape, std::vector<int>{-9, 1}), ::ov::AssertFailure);
|
||||||
EXPECT_THROW(ov::op::v0::Constant c(element::i4, shape, std::vector<int>{8, 2}), ::ngraph::CheckFailure);
|
EXPECT_THROW(ov::op::v0::Constant c(element::i4, shape, std::vector<int>{8, 2}), ::ov::AssertFailure);
|
||||||
|
|
||||||
EXPECT_THROW(ov::op::v0::Constant c(element::i4, shape, std::vector<std::string>{"-9", "1"}),
|
EXPECT_THROW(ov::op::v0::Constant c(element::i4, shape, std::vector<std::string>{"-9", "1"}), ::ov::AssertFailure);
|
||||||
::ngraph::CheckFailure);
|
EXPECT_THROW(ov::op::v0::Constant c(element::i4, shape, std::vector<std::string>{"8", "1"}), ::ov::AssertFailure);
|
||||||
EXPECT_THROW(ov::op::v0::Constant c(element::i4, shape, std::vector<std::string>{"8", "1"}),
|
|
||||||
::ngraph::CheckFailure);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -855,19 +853,17 @@ TEST(constant, uint4_vector_broadcast) {
|
|||||||
|
|
||||||
TEST(constant, uint4_input_value_validation) {
|
TEST(constant, uint4_input_value_validation) {
|
||||||
Shape shape{2};
|
Shape shape{2};
|
||||||
EXPECT_THROW(ov::op::v0::Constant c(element::u4, shape, 16), ::ngraph::CheckFailure);
|
EXPECT_THROW(ov::op::v0::Constant c(element::u4, shape, 16), ::ov::AssertFailure);
|
||||||
EXPECT_THROW(ov::op::v0::Constant c(element::u4, shape, -1), ::ngraph::CheckFailure);
|
EXPECT_THROW(ov::op::v0::Constant c(element::u4, shape, -1), ::ov::AssertFailure);
|
||||||
|
|
||||||
EXPECT_THROW(ov::op::v0::Constant c(element::u4, shape, std::vector<int>{-1}), ::ngraph::CheckFailure);
|
EXPECT_THROW(ov::op::v0::Constant c(element::u4, shape, std::vector<int>{-1}), ::ov::AssertFailure);
|
||||||
EXPECT_THROW(ov::op::v0::Constant c(element::u4, shape, std::vector<int>{16}), ::ngraph::CheckFailure);
|
EXPECT_THROW(ov::op::v0::Constant c(element::u4, shape, std::vector<int>{16}), ::ov::AssertFailure);
|
||||||
|
|
||||||
EXPECT_THROW(ov::op::v0::Constant c(element::u4, shape, std::vector<int>{-1, 1}), ::ngraph::CheckFailure);
|
EXPECT_THROW(ov::op::v0::Constant c(element::u4, shape, std::vector<int>{-1, 1}), ::ov::AssertFailure);
|
||||||
EXPECT_THROW(ov::op::v0::Constant c(element::u4, shape, std::vector<int>{16, 2}), ::ngraph::CheckFailure);
|
EXPECT_THROW(ov::op::v0::Constant c(element::u4, shape, std::vector<int>{16, 2}), ::ov::AssertFailure);
|
||||||
|
|
||||||
EXPECT_THROW(ov::op::v0::Constant c(element::u4, shape, std::vector<std::string>{"-1", "1"}),
|
EXPECT_THROW(ov::op::v0::Constant c(element::u4, shape, std::vector<std::string>{"-1", "1"}), ::ov::AssertFailure);
|
||||||
::ngraph::CheckFailure);
|
EXPECT_THROW(ov::op::v0::Constant c(element::u4, shape, std::vector<std::string>{"16", "1"}), ::ov::AssertFailure);
|
||||||
EXPECT_THROW(ov::op::v0::Constant c(element::u4, shape, std::vector<std::string>{"16", "1"}),
|
|
||||||
::ngraph::CheckFailure);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include "openvino/pass/graph_rewrite.hpp"
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include "common_test_utils/ngraph_test_utils.hpp"
|
#include "common_test_utils/ngraph_test_utils.hpp"
|
||||||
@ -12,6 +14,7 @@
|
|||||||
#include "openvino/op/relu.hpp"
|
#include "openvino/op/relu.hpp"
|
||||||
#include "openvino/op/result.hpp"
|
#include "openvino/op/result.hpp"
|
||||||
#include "openvino/op/tanh.hpp"
|
#include "openvino/op/tanh.hpp"
|
||||||
|
#include "openvino/pass/manager.hpp"
|
||||||
#include "openvino/pass/pattern/op/label.hpp"
|
#include "openvino/pass/pattern/op/label.hpp"
|
||||||
|
|
||||||
using namespace ::testing;
|
using namespace ::testing;
|
||||||
@ -386,7 +389,7 @@ TEST(PassConfigTest, Test1) {
|
|||||||
|
|
||||||
class CheckConsumers : public ov::pass::MatcherPass {
|
class CheckConsumers : public ov::pass::MatcherPass {
|
||||||
public:
|
public:
|
||||||
NGRAPH_RTTI_DECLARATION;
|
OPENVINO_RTTI("CheckConsumers");
|
||||||
CheckConsumers() {
|
CheckConsumers() {
|
||||||
ov::matcher_pass_callback callback = [](pattern::Matcher& m) -> bool {
|
ov::matcher_pass_callback callback = [](pattern::Matcher& m) -> bool {
|
||||||
auto node = m.get_match_root();
|
auto node = m.get_match_root();
|
||||||
@ -433,8 +436,6 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
NGRAPH_RTTI_DEFINITION(CheckConsumers, "CheckConsumers");
|
|
||||||
|
|
||||||
TEST(GraphRewriteTest, nodes_use_count) {
|
TEST(GraphRewriteTest, nodes_use_count) {
|
||||||
auto f = get_model();
|
auto f = get_model();
|
||||||
pass::Manager m;
|
pass::Manager m;
|
||||||
|
@ -2,15 +2,17 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
||||||
#include "common_test_utils/common_utils.hpp"
|
#include "common_test_utils/common_utils.hpp"
|
||||||
#include "common_test_utils/data_utils.hpp"
|
#include "common_test_utils/data_utils.hpp"
|
||||||
#include "common_test_utils/file_utils.hpp"
|
#include "common_test_utils/file_utils.hpp"
|
||||||
#include "common_test_utils/graph_comparator.hpp"
|
#include "common_test_utils/graph_comparator.hpp"
|
||||||
#include "gtest/gtest.h"
|
#include "openvino/core/graph_util.hpp"
|
||||||
#include "ie_blob.h"
|
#include "openvino/runtime/core.hpp"
|
||||||
#include "ie_core.hpp"
|
#include "openvino/runtime/tensor.hpp"
|
||||||
|
|
||||||
class SerializationTensorIteratorTest : public ::testing::Test {
|
class SerializationTensorIteratorTest : public ::testing::Test {
|
||||||
protected:
|
protected:
|
||||||
@ -53,22 +55,21 @@ protected:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void serialize_and_compare(const std::string& model_path, InferenceEngine::Blob::Ptr weights) {
|
void serialize_and_compare(const std::string& model_path, ov::Tensor weights) {
|
||||||
std::stringstream buffer;
|
std::stringstream buffer;
|
||||||
InferenceEngine::Core ie;
|
ov::Core core;
|
||||||
|
|
||||||
std::ifstream model(model_path);
|
std::ifstream model(model_path);
|
||||||
ASSERT_TRUE(model);
|
ASSERT_TRUE(model);
|
||||||
buffer << model.rdbuf();
|
buffer << model.rdbuf();
|
||||||
|
|
||||||
auto expected = ie.ReadNetwork(buffer.str(), weights);
|
auto expected = core.read_model(buffer.str(), weights);
|
||||||
expected.serialize(m_out_xml_path, m_out_bin_path);
|
ov::serialize(expected, m_out_xml_path, m_out_bin_path);
|
||||||
auto result = ie.ReadNetwork(m_out_xml_path, m_out_bin_path);
|
auto result = core.read_model(m_out_xml_path, m_out_bin_path);
|
||||||
|
|
||||||
bool success;
|
bool success;
|
||||||
std::string message;
|
std::string message;
|
||||||
std::tie(success, message) =
|
std::tie(success, message) = compare_functions(result, expected, true, false, false, true, true);
|
||||||
compare_functions(result.getFunction(), expected.getFunction(), true, false, false, true, true);
|
|
||||||
ASSERT_TRUE(success) << message;
|
ASSERT_TRUE(success) << message;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -393,12 +394,10 @@ TEST_F(SerializationTensorIteratorTest, TiResnet) {
|
|||||||
|
|
||||||
size_t weights_size = 8396840;
|
size_t weights_size = 8396840;
|
||||||
|
|
||||||
auto weights = InferenceEngine::make_shared_blob<uint8_t>(
|
auto weights = ov::Tensor(ov::element::f32, {weights_size / sizeof(float)});
|
||||||
InferenceEngine::TensorDesc(InferenceEngine::Precision::U8, {weights_size}, InferenceEngine::Layout::C));
|
ov::test::utils::fill_data(weights.data<float>(), weights.get_size());
|
||||||
weights->allocate();
|
|
||||||
ov::test::utils::fill_data(weights->buffer().as<float*>(), weights->size() / sizeof(float));
|
|
||||||
|
|
||||||
auto* data = weights->buffer().as<int64_t*>();
|
auto* data = static_cast<int64_t*>(weights.data());
|
||||||
data[0] = 1;
|
data[0] = 1;
|
||||||
data[1] = 512;
|
data[1] = 512;
|
||||||
data[1049602] = 1;
|
data[1049602] = 1;
|
||||||
|
@ -259,7 +259,7 @@ TEST(PassConfig, EnableDisablePasses9) {
|
|||||||
|
|
||||||
class TestNestedMatcher : public ov::pass::MatcherPass {
|
class TestNestedMatcher : public ov::pass::MatcherPass {
|
||||||
public:
|
public:
|
||||||
NGRAPH_RTTI_DECLARATION;
|
OPENVINO_RTTI("TestNestedMatcher");
|
||||||
TestNestedMatcher() : MatcherPass() {
|
TestNestedMatcher() : MatcherPass() {
|
||||||
auto any_op = pattern::any_input();
|
auto any_op = pattern::any_input();
|
||||||
ov::matcher_pass_callback callback = [this](pattern::Matcher& m) {
|
ov::matcher_pass_callback callback = [this](pattern::Matcher& m) {
|
||||||
@ -282,18 +282,14 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
NGRAPH_RTTI_DEFINITION(TestNestedMatcher, "TestNestedMatcher");
|
|
||||||
|
|
||||||
class TestNestedGraphRewrite : public pass::GraphRewrite {
|
class TestNestedGraphRewrite : public pass::GraphRewrite {
|
||||||
public:
|
public:
|
||||||
NGRAPH_RTTI_DECLARATION;
|
OPENVINO_RTTI("TestNestedGraphRewrite");
|
||||||
TestNestedGraphRewrite() {
|
TestNestedGraphRewrite() {
|
||||||
add_matcher<TestNestedMatcher>();
|
add_matcher<TestNestedMatcher>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
NGRAPH_RTTI_DEFINITION(TestNestedGraphRewrite, "TestNestedGraphRewrite");
|
|
||||||
|
|
||||||
TEST(PassConfig, EnableDisablePasses10) {
|
TEST(PassConfig, EnableDisablePasses10) {
|
||||||
std::shared_ptr<Model> f;
|
std::shared_ptr<Model> f;
|
||||||
std::shared_ptr<Node> relu, sigmoid;
|
std::shared_ptr<Node> relu, sigmoid;
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
#include "common_test_utils/ngraph_test_utils.hpp"
|
#include "common_test_utils/ngraph_test_utils.hpp"
|
||||||
#include "common_test_utils/test_tools.hpp"
|
#include "common_test_utils/test_tools.hpp"
|
||||||
#include "ngraph/pass/graph_rewrite.hpp"
|
#include "ngraph/pass/graph_rewrite.hpp"
|
||||||
|
#include "openvino/core/except.hpp"
|
||||||
#include "openvino/op/abs.hpp"
|
#include "openvino/op/abs.hpp"
|
||||||
#include "openvino/op/add.hpp"
|
#include "openvino/op/add.hpp"
|
||||||
#include "openvino/op/broadcast.hpp"
|
#include "openvino/op/broadcast.hpp"
|
||||||
@ -78,7 +79,7 @@ public:
|
|||||||
|
|
||||||
auto callback = [pattern](pattern::Matcher& m) {
|
auto callback = [pattern](pattern::Matcher& m) {
|
||||||
OPENVINO_DEBUG << "In a callback for construct_multiply_by_one against " << m.get_match_root()->get_name();
|
OPENVINO_DEBUG << "In a callback for construct_multiply_by_one against " << m.get_match_root()->get_name();
|
||||||
NGRAPH_CHECK(m.get_match_root()->input_values().size() == 2);
|
OPENVINO_ASSERT(m.get_match_root()->input_values().size() == 2);
|
||||||
|
|
||||||
auto pattern_map = m.get_pattern_map();
|
auto pattern_map = m.get_pattern_map();
|
||||||
|
|
||||||
@ -105,7 +106,7 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ngraph::replace_node(m.get_match_root(), pattern_map[pattern]);
|
ov::replace_node(m.get_match_root(), pattern_map[pattern]);
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -136,7 +137,7 @@ public:
|
|||||||
|
|
||||||
auto callback = [pattern](pattern::Matcher& m) {
|
auto callback = [pattern](pattern::Matcher& m) {
|
||||||
OPENVINO_DEBUG << "In a callback for construct_add_zero against " << m.get_match_root()->get_name();
|
OPENVINO_DEBUG << "In a callback for construct_add_zero against " << m.get_match_root()->get_name();
|
||||||
NGRAPH_CHECK(m.get_match_root()->input_values().size() == 2);
|
OPENVINO_ASSERT(m.get_match_root()->input_values().size() == 2);
|
||||||
|
|
||||||
auto pattern_map = m.get_pattern_map();
|
auto pattern_map = m.get_pattern_map();
|
||||||
|
|
||||||
@ -163,7 +164,7 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ngraph::replace_node(m.get_match_root(), pattern_map[pattern]);
|
ov::replace_node(m.get_match_root(), pattern_map[pattern]);
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -214,13 +215,13 @@ TEST(pattern, graph_rewrite) {
|
|||||||
auto graph_a = make_shared<op::v1::Add>(a, iconst0);
|
auto graph_a = make_shared<op::v1::Add>(a, iconst0);
|
||||||
auto graph_b = make_shared<op::v1::Add>(b, iconst0);
|
auto graph_b = make_shared<op::v1::Add>(b, iconst0);
|
||||||
|
|
||||||
auto f = std::make_shared<Model>(ngraph::NodeVector{a, b, graph_a, c, graph_b}, ParameterVector{a, b, c});
|
auto f = std::make_shared<Model>(ov::NodeVector{a, b, graph_a, c, graph_b}, ParameterVector{a, b, c});
|
||||||
pass_manager.run_passes(f);
|
pass_manager.run_passes(f);
|
||||||
|
|
||||||
ASSERT_TRUE(graph_a->get_output_target_inputs(0).empty());
|
ASSERT_TRUE(graph_a->get_output_target_inputs(0).empty());
|
||||||
ASSERT_TRUE(graph_b->get_output_target_inputs(0).empty());
|
ASSERT_TRUE(graph_b->get_output_target_inputs(0).empty());
|
||||||
|
|
||||||
auto expected = ngraph::NodeVector{a, b, a, c, b};
|
auto expected = ov::NodeVector{a, b, a, c, b};
|
||||||
ASSERT_TRUE(count_ops_of_type<op::v1::Add>(f) == 0);
|
ASSERT_TRUE(count_ops_of_type<op::v1::Add>(f) == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -658,7 +659,7 @@ public:
|
|||||||
// matches are added in reverse order (i.e. the first match is the topmost node)
|
// matches are added in reverse order (i.e. the first match is the topmost node)
|
||||||
auto arg = rm.get_bound_nodes_for_pattern(rpattern).at(number_of_adds - 1);
|
auto arg = rm.get_bound_nodes_for_pattern(rpattern).at(number_of_adds - 1);
|
||||||
OPENVINO_DEBUG << "Replacing " << rm.get_match_root()->get_name() << " with " << arg->get_name();
|
OPENVINO_DEBUG << "Replacing " << rm.get_match_root()->get_name() << " with " << arg->get_name();
|
||||||
ngraph::replace_node(rm.get_match_root(), arg);
|
ov::replace_node(rm.get_match_root(), arg);
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -694,7 +695,7 @@ TEST(pattern, recurrent_graph_rewrite) {
|
|||||||
|
|
||||||
auto graph = make_shared<op::v1::Multiply>(abs_add_a3, abs_add_b2);
|
auto graph = make_shared<op::v1::Multiply>(abs_add_a3, abs_add_b2);
|
||||||
|
|
||||||
auto f = std::make_shared<Model>(ngraph::NodeVector{graph}, ParameterVector{a, b});
|
auto f = std::make_shared<Model>(ov::NodeVector{graph}, ParameterVector{a, b});
|
||||||
pass_manager.run_passes(f);
|
pass_manager.run_passes(f);
|
||||||
|
|
||||||
auto left_abs = graph->input_value(0).get_node_shared_ptr();
|
auto left_abs = graph->input_value(0).get_node_shared_ptr();
|
||||||
|
@ -5,7 +5,9 @@
|
|||||||
#include "ngraph/specialize_function.hpp"
|
#include "ngraph/specialize_function.hpp"
|
||||||
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
#include "ngraph/ngraph.hpp"
|
#include "ngraph/op/add.hpp"
|
||||||
|
#include "ngraph/op/constant.hpp"
|
||||||
|
#include "ngraph/op/convert.hpp"
|
||||||
|
|
||||||
using namespace ngraph;
|
using namespace ngraph;
|
||||||
NGRAPH_SUPPRESS_DEPRECATED_START;
|
NGRAPH_SUPPRESS_DEPRECATED_START;
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
#include "common_test_utils/test_tools.hpp"
|
#include "common_test_utils/test_tools.hpp"
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
#include "ngraph/node.hpp"
|
#include "ngraph/runtime/host_tensor.hpp"
|
||||||
#include "openvino/core/model.hpp"
|
#include "openvino/core/model.hpp"
|
||||||
#include "openvino/op/parameter.hpp"
|
#include "openvino/op/parameter.hpp"
|
||||||
#include "openvino/op/relu.hpp"
|
#include "openvino/op/relu.hpp"
|
||||||
@ -46,7 +46,7 @@ TEST(tensor, wrap_tensor_with_unspecified_type) {
|
|||||||
|
|
||||||
TEST(tensor, wrap_tensor_with_unspecified_type_from_host_tensor) {
|
TEST(tensor, wrap_tensor_with_unspecified_type_from_host_tensor) {
|
||||||
OPENVINO_SUPPRESS_DEPRECATED_START
|
OPENVINO_SUPPRESS_DEPRECATED_START
|
||||||
auto host_tensor = std::make_shared<ngraph::HostTensor>(element::undefined, ov::PartialShape{});
|
auto host_tensor = std::make_shared<ngraph::runtime::HostTensor>(element::undefined, ov::PartialShape{});
|
||||||
auto tensor = ov::util::wrap_tensor(host_tensor);
|
auto tensor = ov::util::wrap_tensor(host_tensor);
|
||||||
OPENVINO_SUPPRESS_DEPRECATED_END
|
OPENVINO_SUPPRESS_DEPRECATED_END
|
||||||
// !tensor means that the tensor is not initialized
|
// !tensor means that the tensor is not initialized
|
||||||
|
@ -1,17 +1,6 @@
|
|||||||
//*****************************************************************************
|
// Copyright (C) 2018-2023 Intel Corporation
|
||||||
// Copyright 2017-2022 Intel Corporation
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License.
|
|
||||||
// You may obtain a copy of the License at
|
|
||||||
//
|
//
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
//*****************************************************************************
|
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
|
@ -224,7 +224,7 @@ TEST(type_prop, bin_convolution_invalid_inputs_et) {
|
|||||||
} catch (...) {
|
} catch (...) {
|
||||||
FAIL() << "Data batch element type validation check failed for unexpected reason";
|
FAIL() << "Data batch element type validation check failed for unexpected reason";
|
||||||
}
|
}
|
||||||
// TODO: Add test with check filters element type once u1 is supported in nGraph Python API
|
// TODO: Add test with check filters element type once u1 is supported in OpenVINO Python API
|
||||||
// (#49517)
|
// (#49517)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2022 Intel Corporation
|
// Copyright (C) 2018-2023 Intel Corporation
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
//
|
//
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ TEST(type_prop, generate_proposals) {
|
|||||||
scores = std::make_shared<ov::op::v0::Parameter>(element::f32, Shape{1, 3, 200, 336});
|
scores = std::make_shared<ov::op::v0::Parameter>(element::f32, Shape{1, 3, 200, 336});
|
||||||
|
|
||||||
ASSERT_THROW(proposals = std::make_shared<GenerateProposals>(im_info, anchors, deltas, scores, attrs, element::i32),
|
ASSERT_THROW(proposals = std::make_shared<GenerateProposals>(im_info, anchors, deltas, scores, attrs, element::i32),
|
||||||
ngraph::CheckFailure)
|
ov::AssertFailure)
|
||||||
<< "GenerateProposals node was created with invalid data.";
|
<< "GenerateProposals node was created with invalid data.";
|
||||||
|
|
||||||
im_info = std::make_shared<ov::op::v0::Parameter>(element::f32, Shape{1, 4});
|
im_info = std::make_shared<ov::op::v0::Parameter>(element::f32, Shape{1, 4});
|
||||||
@ -111,7 +111,7 @@ TEST(type_prop, generate_proposals) {
|
|||||||
scores = std::make_shared<ov::op::v0::Parameter>(element::f32, Shape{1, 3, 200, 336});
|
scores = std::make_shared<ov::op::v0::Parameter>(element::f32, Shape{1, 3, 200, 336});
|
||||||
|
|
||||||
ASSERT_THROW(proposals = std::make_shared<GenerateProposals>(im_info, anchors, deltas, scores, attrs, element::i32),
|
ASSERT_THROW(proposals = std::make_shared<GenerateProposals>(im_info, anchors, deltas, scores, attrs, element::i32),
|
||||||
ngraph::CheckFailure)
|
ov::AssertFailure)
|
||||||
<< "GenerateProposals node was created with invalid data.";
|
<< "GenerateProposals node was created with invalid data.";
|
||||||
|
|
||||||
im_info = std::make_shared<ov::op::v0::Parameter>(element::f32, Shape{1, 4});
|
im_info = std::make_shared<ov::op::v0::Parameter>(element::f32, Shape{1, 4});
|
||||||
@ -120,7 +120,7 @@ TEST(type_prop, generate_proposals) {
|
|||||||
scores = std::make_shared<ov::op::v0::Parameter>(element::f32, Shape{1, 4, 200, 336});
|
scores = std::make_shared<ov::op::v0::Parameter>(element::f32, Shape{1, 4, 200, 336});
|
||||||
|
|
||||||
ASSERT_THROW(proposals = std::make_shared<GenerateProposals>(im_info, anchors, deltas, scores, attrs, element::i32),
|
ASSERT_THROW(proposals = std::make_shared<GenerateProposals>(im_info, anchors, deltas, scores, attrs, element::i32),
|
||||||
ngraph::CheckFailure)
|
ov::AssertFailure)
|
||||||
<< "GenerateProposals node was created with invalid data.";
|
<< "GenerateProposals node was created with invalid data.";
|
||||||
|
|
||||||
im_info = std::make_shared<ov::op::v0::Parameter>(element::f32, Shape{1, 2});
|
im_info = std::make_shared<ov::op::v0::Parameter>(element::f32, Shape{1, 2});
|
||||||
@ -129,7 +129,7 @@ TEST(type_prop, generate_proposals) {
|
|||||||
scores = std::make_shared<ov::op::v0::Parameter>(element::f32, Shape{1, 4, 200, 336});
|
scores = std::make_shared<ov::op::v0::Parameter>(element::f32, Shape{1, 4, 200, 336});
|
||||||
|
|
||||||
ASSERT_THROW(proposals = std::make_shared<GenerateProposals>(im_info, anchors, deltas, scores, attrs, element::i32),
|
ASSERT_THROW(proposals = std::make_shared<GenerateProposals>(im_info, anchors, deltas, scores, attrs, element::i32),
|
||||||
ngraph::CheckFailure)
|
ov::AssertFailure)
|
||||||
<< "GenerateProposals node was created with invalid data.";
|
<< "GenerateProposals node was created with invalid data.";
|
||||||
|
|
||||||
im_info = std::make_shared<ov::op::v0::Parameter>(element::f32, Shape{2, 4});
|
im_info = std::make_shared<ov::op::v0::Parameter>(element::f32, Shape{2, 4});
|
||||||
@ -138,7 +138,7 @@ TEST(type_prop, generate_proposals) {
|
|||||||
scores = std::make_shared<ov::op::v0::Parameter>(element::f32, Shape{1, 4, 200, 336});
|
scores = std::make_shared<ov::op::v0::Parameter>(element::f32, Shape{1, 4, 200, 336});
|
||||||
|
|
||||||
ASSERT_THROW(proposals = std::make_shared<GenerateProposals>(im_info, anchors, deltas, scores, attrs, element::i32),
|
ASSERT_THROW(proposals = std::make_shared<GenerateProposals>(im_info, anchors, deltas, scores, attrs, element::i32),
|
||||||
ngraph::CheckFailure)
|
ov::AssertFailure)
|
||||||
<< "GenerateProposals node was created with invalid data.";
|
<< "GenerateProposals node was created with invalid data.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include "common_test_utils/type_prop.hpp"
|
#include "common_test_utils/type_prop.hpp"
|
||||||
|
#include "openvino/core/except.hpp"
|
||||||
#include "openvino/op/parameter.hpp"
|
#include "openvino/op/parameter.hpp"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
@ -265,7 +266,7 @@ TEST(type_prop, gru_sequence_invalid_input_dimension) {
|
|||||||
for (size_t i = 0; i < gru_sequence->get_input_size(); i++) {
|
for (size_t i = 0; i < gru_sequence->get_input_size(); i++) {
|
||||||
gru_sequence = gru_seq_tensor_initialization(param);
|
gru_sequence = gru_seq_tensor_initialization(param);
|
||||||
gru_sequence->set_argument(i, invalid_rank0_tensor);
|
gru_sequence->set_argument(i, invalid_rank0_tensor);
|
||||||
ASSERT_THROW(gru_sequence->validate_and_infer_types(), ngraph::CheckFailure)
|
ASSERT_THROW(gru_sequence->validate_and_infer_types(), ov::AssertFailure)
|
||||||
<< "GRUSequence node was created with invalid data.";
|
<< "GRUSequence node was created with invalid data.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ TEST(type_prop, if_simple_test) {
|
|||||||
// That which we iterate over
|
// That which we iterate over
|
||||||
auto X = make_shared<ov::op::v0::Parameter>(element::f32, Shape{32, 40, 10});
|
auto X = make_shared<ov::op::v0::Parameter>(element::f32, Shape{32, 40, 10});
|
||||||
auto Y = make_shared<ov::op::v0::Parameter>(element::f32, Shape{32, 40, 10});
|
auto Y = make_shared<ov::op::v0::Parameter>(element::f32, Shape{32, 40, 10});
|
||||||
auto cond = std::make_shared<ov::op::v0::Constant>(ngraph::element::boolean, ngraph::Shape{1}, true);
|
auto cond = std::make_shared<ov::op::v0::Constant>(ov::element::boolean, ov::Shape{1}, true);
|
||||||
|
|
||||||
// Set up the cell body, a function from (Xi, Yi) -> (Zo)
|
// Set up the cell body, a function from (Xi, Yi) -> (Zo)
|
||||||
// Body parameters
|
// Body parameters
|
||||||
@ -35,12 +35,12 @@ TEST(type_prop, if_simple_test) {
|
|||||||
auto convert_then_op = std::make_shared<op::v0::Convert>(then_op, element::f32);
|
auto convert_then_op = std::make_shared<op::v0::Convert>(then_op, element::f32);
|
||||||
auto then_op_res = std::make_shared<op::v0::Result>(convert_then_op);
|
auto then_op_res = std::make_shared<op::v0::Result>(convert_then_op);
|
||||||
|
|
||||||
auto then_body = make_shared<ngraph::Function>(OutputVector{then_op_res}, ParameterVector{Xt, Yt});
|
auto then_body = make_shared<ov::Model>(OutputVector{then_op_res}, ParameterVector{Xt, Yt});
|
||||||
|
|
||||||
auto else_op = std::make_shared<op::v1::Maximum>(Xe, Ye);
|
auto else_op = std::make_shared<op::v1::Maximum>(Xe, Ye);
|
||||||
auto convert_else_op = std::make_shared<op::v0::Convert>(else_op, element::f32);
|
auto convert_else_op = std::make_shared<op::v0::Convert>(else_op, element::f32);
|
||||||
auto else_op_res = std::make_shared<ov::op::v0::Result>(convert_else_op);
|
auto else_op_res = std::make_shared<ov::op::v0::Result>(convert_else_op);
|
||||||
auto else_body = make_shared<ngraph::Function>(OutputVector{else_op_res}, ParameterVector{Xe, Ye});
|
auto else_body = make_shared<ov::Model>(OutputVector{else_op_res}, ParameterVector{Xe, Ye});
|
||||||
auto if_op = make_shared<op::v8::If>(cond);
|
auto if_op = make_shared<op::v8::If>(cond);
|
||||||
if_op->set_then_body(then_body);
|
if_op->set_then_body(then_body);
|
||||||
if_op->set_else_body(else_body);
|
if_op->set_else_body(else_body);
|
||||||
@ -74,11 +74,11 @@ TEST(type_prop, if_non_const_condition_test) {
|
|||||||
// Body
|
// Body
|
||||||
auto then_op = std::make_shared<op::v1::Add>(Xt, Yt);
|
auto then_op = std::make_shared<op::v1::Add>(Xt, Yt);
|
||||||
auto then_body_res = make_shared<ov::op::v0::Result>(then_op);
|
auto then_body_res = make_shared<ov::op::v0::Result>(then_op);
|
||||||
auto then_body = make_shared<ngraph::Function>(OutputVector{then_body_res}, ParameterVector{Xt, Yt});
|
auto then_body = make_shared<ov::Model>(OutputVector{then_body_res}, ParameterVector{Xt, Yt});
|
||||||
|
|
||||||
auto else_op = std::make_shared<op::v1::Maximum>(Xe, Ye);
|
auto else_op = std::make_shared<op::v1::Maximum>(Xe, Ye);
|
||||||
auto else_body_res = make_shared<ov::op::v0::Result>(else_op);
|
auto else_body_res = make_shared<ov::op::v0::Result>(else_op);
|
||||||
auto else_body = make_shared<ngraph::Function>(OutputVector{else_body_res}, ParameterVector{Xe, Ye});
|
auto else_body = make_shared<ov::Model>(OutputVector{else_body_res}, ParameterVector{Xe, Ye});
|
||||||
|
|
||||||
auto if_op = make_shared<op::v8::If>(cond);
|
auto if_op = make_shared<op::v8::If>(cond);
|
||||||
if_op->set_then_body(then_body);
|
if_op->set_then_body(then_body);
|
||||||
@ -108,10 +108,10 @@ TEST(type_prop, if_clone_test) {
|
|||||||
// Body
|
// Body
|
||||||
auto then_op = std::make_shared<op::v1::Add>(Xt, Yt);
|
auto then_op = std::make_shared<op::v1::Add>(Xt, Yt);
|
||||||
auto then_body_res = make_shared<ov::op::v0::Result>(then_op);
|
auto then_body_res = make_shared<ov::op::v0::Result>(then_op);
|
||||||
auto then_body = make_shared<ngraph::Function>(OutputVector{then_body_res}, ParameterVector{Xt, Yt});
|
auto then_body = make_shared<ov::Model>(OutputVector{then_body_res}, ParameterVector{Xt, Yt});
|
||||||
auto else_op = std::make_shared<op::v1::Maximum>(Xe, Ye);
|
auto else_op = std::make_shared<op::v1::Maximum>(Xe, Ye);
|
||||||
auto else_body_res = make_shared<ov::op::v0::Result>(else_op);
|
auto else_body_res = make_shared<ov::op::v0::Result>(else_op);
|
||||||
auto else_body = make_shared<ngraph::Function>(OutputVector{else_body_res}, ParameterVector{Xe, Ye});
|
auto else_body = make_shared<ov::Model>(OutputVector{else_body_res}, ParameterVector{Xe, Ye});
|
||||||
auto if_op = make_shared<op::v8::If>(cond);
|
auto if_op = make_shared<op::v8::If>(cond);
|
||||||
if_op->set_then_body(then_body);
|
if_op->set_then_body(then_body);
|
||||||
if_op->set_else_body(else_body);
|
if_op->set_else_body(else_body);
|
||||||
@ -139,15 +139,13 @@ TEST(type_prop, if_multiple_outputs) {
|
|||||||
auto then_op = std::make_shared<op::v1::Add>(Xt, Yt);
|
auto then_op = std::make_shared<op::v1::Add>(Xt, Yt);
|
||||||
auto then_body_res_1 = make_shared<ov::op::v0::Result>(then_op);
|
auto then_body_res_1 = make_shared<ov::op::v0::Result>(then_op);
|
||||||
auto then_body_res_2 = make_shared<ov::op::v0::Result>(Xt);
|
auto then_body_res_2 = make_shared<ov::op::v0::Result>(Xt);
|
||||||
auto then_body =
|
auto then_body = make_shared<ov::Model>(OutputVector{then_body_res_1, then_body_res_2}, ParameterVector{Xt, Yt});
|
||||||
make_shared<ngraph::Function>(OutputVector{then_body_res_1, then_body_res_2}, ParameterVector{Xt, Yt});
|
|
||||||
auto else_op = std::make_shared<op::v1::Maximum>(Xe, Ye);
|
auto else_op = std::make_shared<op::v1::Maximum>(Xe, Ye);
|
||||||
auto else_const =
|
auto else_const =
|
||||||
std::make_shared<ov::op::v0::Constant>(ngraph::element::f32, ngraph::Shape{1, 1, 1}, std::vector<float>{0.5f});
|
std::make_shared<ov::op::v0::Constant>(ov::element::f32, ov::Shape{1, 1, 1}, std::vector<float>{0.5f});
|
||||||
auto else_body_res_1 = make_shared<ov::op::v0::Result>(else_op);
|
auto else_body_res_1 = make_shared<ov::op::v0::Result>(else_op);
|
||||||
auto else_body_res_2 = make_shared<ov::op::v0::Result>(else_const);
|
auto else_body_res_2 = make_shared<ov::op::v0::Result>(else_const);
|
||||||
auto else_body =
|
auto else_body = make_shared<ov::Model>(OutputVector{else_body_res_1, else_body_res_2}, ParameterVector{Xe, Ye});
|
||||||
make_shared<ngraph::Function>(OutputVector{else_body_res_1, else_body_res_2}, ParameterVector{Xe, Ye});
|
|
||||||
|
|
||||||
auto if_op = make_shared<op::v8::If>(cond);
|
auto if_op = make_shared<op::v8::If>(cond);
|
||||||
if_op->set_then_body(then_body);
|
if_op->set_then_body(then_body);
|
||||||
@ -180,11 +178,11 @@ TEST(type_prop, if_scalar_condition) {
|
|||||||
// Body
|
// Body
|
||||||
auto then_op = std::make_shared<op::v1::Add>(Xt, Yt);
|
auto then_op = std::make_shared<op::v1::Add>(Xt, Yt);
|
||||||
auto then_body_res = make_shared<ov::op::v0::Result>(then_op);
|
auto then_body_res = make_shared<ov::op::v0::Result>(then_op);
|
||||||
auto then_body = make_shared<ngraph::Function>(OutputVector{then_body_res}, ParameterVector{Xt, Yt});
|
auto then_body = make_shared<ov::Model>(OutputVector{then_body_res}, ParameterVector{Xt, Yt});
|
||||||
|
|
||||||
auto else_op = std::make_shared<op::v1::Maximum>(Xe, Ye);
|
auto else_op = std::make_shared<op::v1::Maximum>(Xe, Ye);
|
||||||
auto else_body_res = make_shared<ov::op::v0::Result>(else_op);
|
auto else_body_res = make_shared<ov::op::v0::Result>(else_op);
|
||||||
auto else_body = make_shared<ngraph::Function>(OutputVector{else_body_res}, ParameterVector{Xe, Ye});
|
auto else_body = make_shared<ov::Model>(OutputVector{else_body_res}, ParameterVector{Xe, Ye});
|
||||||
|
|
||||||
auto if_op = make_shared<op::v8::If>(cond);
|
auto if_op = make_shared<op::v8::If>(cond);
|
||||||
if_op->set_then_body(then_body);
|
if_op->set_then_body(then_body);
|
||||||
@ -213,11 +211,11 @@ TEST(type_prop, if_dynamic_output) {
|
|||||||
// Body
|
// Body
|
||||||
auto then_op = std::make_shared<op::v1::Add>(Xt, Xt);
|
auto then_op = std::make_shared<op::v1::Add>(Xt, Xt);
|
||||||
auto then_body_res = make_shared<ov::op::v0::Result>(then_op);
|
auto then_body_res = make_shared<ov::op::v0::Result>(then_op);
|
||||||
auto then_body = make_shared<ngraph::Function>(OutputVector{then_body_res}, ParameterVector{Xt});
|
auto then_body = make_shared<ov::Model>(OutputVector{then_body_res}, ParameterVector{Xt});
|
||||||
|
|
||||||
auto else_op = std::make_shared<op::v1::Maximum>(Ye, Ye);
|
auto else_op = std::make_shared<op::v1::Maximum>(Ye, Ye);
|
||||||
auto else_body_res = make_shared<ov::op::v0::Result>(else_op);
|
auto else_body_res = make_shared<ov::op::v0::Result>(else_op);
|
||||||
auto else_body = make_shared<ngraph::Function>(OutputVector{else_body_res}, ParameterVector{Ye});
|
auto else_body = make_shared<ov::Model>(OutputVector{else_body_res}, ParameterVector{Ye});
|
||||||
|
|
||||||
auto if_op = make_shared<op::v8::If>(cond);
|
auto if_op = make_shared<op::v8::If>(cond);
|
||||||
if_op->set_then_body(then_body);
|
if_op->set_then_body(then_body);
|
||||||
@ -259,11 +257,11 @@ TEST(type_prop, if_dynamic_inputs) {
|
|||||||
// Body
|
// Body
|
||||||
auto then_op = std::make_shared<op::v1::Add>(Xt, Yt);
|
auto then_op = std::make_shared<op::v1::Add>(Xt, Yt);
|
||||||
auto then_body_res = make_shared<ov::op::v0::Result>(then_op);
|
auto then_body_res = make_shared<ov::op::v0::Result>(then_op);
|
||||||
auto then_body = make_shared<ngraph::Function>(OutputVector{then_body_res}, ParameterVector{Xt, Yt});
|
auto then_body = make_shared<ov::Model>(OutputVector{then_body_res}, ParameterVector{Xt, Yt});
|
||||||
|
|
||||||
auto else_op = std::make_shared<op::v1::Multiply>(Xe, Ye);
|
auto else_op = std::make_shared<op::v1::Multiply>(Xe, Ye);
|
||||||
auto else_body_res = make_shared<ov::op::v0::Result>(else_op);
|
auto else_body_res = make_shared<ov::op::v0::Result>(else_op);
|
||||||
auto else_body = make_shared<ngraph::Function>(OutputVector{else_body_res}, ParameterVector{Xe, Ye});
|
auto else_body = make_shared<ov::Model>(OutputVector{else_body_res}, ParameterVector{Xe, Ye});
|
||||||
|
|
||||||
auto if_op = make_shared<op::v8::If>(cond);
|
auto if_op = make_shared<op::v8::If>(cond);
|
||||||
if_op->set_then_body(then_body);
|
if_op->set_then_body(then_body);
|
||||||
@ -294,11 +292,11 @@ TEST(type_prop, if_scalar_and_1d_union) {
|
|||||||
// Body
|
// Body
|
||||||
auto then_op = std::make_shared<op::v1::Add>(Xt, Xt);
|
auto then_op = std::make_shared<op::v1::Add>(Xt, Xt);
|
||||||
auto then_body_res = make_shared<ov::op::v0::Result>(then_op);
|
auto then_body_res = make_shared<ov::op::v0::Result>(then_op);
|
||||||
auto then_body = make_shared<ngraph::Function>(OutputVector{then_body_res}, ParameterVector{Xt});
|
auto then_body = make_shared<ov::Model>(OutputVector{then_body_res}, ParameterVector{Xt});
|
||||||
|
|
||||||
auto else_op = std::make_shared<op::v1::Maximum>(Ye, Ye);
|
auto else_op = std::make_shared<op::v1::Maximum>(Ye, Ye);
|
||||||
auto else_body_res = make_shared<ov::op::v0::Result>(else_op);
|
auto else_body_res = make_shared<ov::op::v0::Result>(else_op);
|
||||||
auto else_body = make_shared<ngraph::Function>(OutputVector{else_body_res}, ParameterVector{Ye});
|
auto else_body = make_shared<ov::Model>(OutputVector{else_body_res}, ParameterVector{Ye});
|
||||||
|
|
||||||
auto if_op = make_shared<op::v8::If>(cond);
|
auto if_op = make_shared<op::v8::If>(cond);
|
||||||
if_op->set_then_body(then_body);
|
if_op->set_then_body(then_body);
|
||||||
@ -324,11 +322,11 @@ TEST(type_prop, if_scalar_and_1d_static_union) {
|
|||||||
// Body
|
// Body
|
||||||
auto then_op = std::make_shared<op::v1::Add>(Xt, Xt);
|
auto then_op = std::make_shared<op::v1::Add>(Xt, Xt);
|
||||||
auto then_body_res = make_shared<ov::op::v0::Result>(then_op);
|
auto then_body_res = make_shared<ov::op::v0::Result>(then_op);
|
||||||
auto then_body = make_shared<ngraph::Function>(OutputVector{then_body_res}, ParameterVector{Xt});
|
auto then_body = make_shared<ov::Model>(OutputVector{then_body_res}, ParameterVector{Xt});
|
||||||
|
|
||||||
auto else_op = std::make_shared<op::v1::Maximum>(Ye, Ye);
|
auto else_op = std::make_shared<op::v1::Maximum>(Ye, Ye);
|
||||||
auto else_body_res = make_shared<ov::op::v0::Result>(else_op);
|
auto else_body_res = make_shared<ov::op::v0::Result>(else_op);
|
||||||
auto else_body = make_shared<ngraph::Function>(OutputVector{else_body_res}, ParameterVector{Ye});
|
auto else_body = make_shared<ov::Model>(OutputVector{else_body_res}, ParameterVector{Ye});
|
||||||
|
|
||||||
auto if_op = make_shared<op::v8::If>(cond);
|
auto if_op = make_shared<op::v8::If>(cond);
|
||||||
if_op->set_then_body(then_body);
|
if_op->set_then_body(then_body);
|
||||||
@ -346,7 +344,7 @@ TEST(type_prop, if_element_type_dynamic) {
|
|||||||
// That which we iterate over
|
// That which we iterate over
|
||||||
auto X = make_shared<ov::op::v0::Parameter>(element::f16, Shape{32, 40, 10});
|
auto X = make_shared<ov::op::v0::Parameter>(element::f16, Shape{32, 40, 10});
|
||||||
auto Y = make_shared<ov::op::v0::Parameter>(element::f16, Shape{32, 40, 10});
|
auto Y = make_shared<ov::op::v0::Parameter>(element::f16, Shape{32, 40, 10});
|
||||||
auto cond = std::make_shared<ov::op::v0::Constant>(ngraph::element::boolean, ngraph::Shape{1}, false);
|
auto cond = std::make_shared<ov::op::v0::Constant>(ov::element::boolean, ov::Shape{1}, false);
|
||||||
|
|
||||||
// Set up the cell body, a function from (Xi, Yi) -> (Zo)
|
// Set up the cell body, a function from (Xi, Yi) -> (Zo)
|
||||||
// Body parameters
|
// Body parameters
|
||||||
@ -358,11 +356,11 @@ TEST(type_prop, if_element_type_dynamic) {
|
|||||||
auto then_op = std::make_shared<op::v1::Add>(Xt, Yt);
|
auto then_op = std::make_shared<op::v1::Add>(Xt, Yt);
|
||||||
auto then_op_res = std::make_shared<ov::op::v0::Result>(then_op);
|
auto then_op_res = std::make_shared<ov::op::v0::Result>(then_op);
|
||||||
|
|
||||||
auto then_body = make_shared<ngraph::Function>(OutputVector{then_op_res}, ParameterVector{Xt, Yt});
|
auto then_body = make_shared<ov::Model>(OutputVector{then_op_res}, ParameterVector{Xt, Yt});
|
||||||
|
|
||||||
auto else_op = std::make_shared<op::v1::Maximum>(Xe, Ye);
|
auto else_op = std::make_shared<op::v1::Maximum>(Xe, Ye);
|
||||||
auto else_op_res = std::make_shared<ov::op::v0::Result>(else_op);
|
auto else_op_res = std::make_shared<ov::op::v0::Result>(else_op);
|
||||||
auto else_body = make_shared<ngraph::Function>(OutputVector{else_op_res}, ParameterVector{Xe, Ye});
|
auto else_body = make_shared<ov::Model>(OutputVector{else_op_res}, ParameterVector{Xe, Ye});
|
||||||
auto if_op = make_shared<op::v8::If>(cond);
|
auto if_op = make_shared<op::v8::If>(cond);
|
||||||
if_op->set_then_body(then_body);
|
if_op->set_then_body(then_body);
|
||||||
if_op->set_else_body(else_body);
|
if_op->set_else_body(else_body);
|
||||||
@ -383,7 +381,7 @@ TEST(type_prop, if_invalid_false_body) {
|
|||||||
// That which we iterate over
|
// That which we iterate over
|
||||||
auto X = make_shared<ov::op::v0::Parameter>(element::f16, Shape{32, 40, 10});
|
auto X = make_shared<ov::op::v0::Parameter>(element::f16, Shape{32, 40, 10});
|
||||||
auto Y = make_shared<ov::op::v0::Parameter>(element::f16, Shape{32, 40});
|
auto Y = make_shared<ov::op::v0::Parameter>(element::f16, Shape{32, 40});
|
||||||
auto cond = std::make_shared<ov::op::v0::Constant>(ngraph::element::boolean, ngraph::Shape{1}, false);
|
auto cond = std::make_shared<ov::op::v0::Constant>(ov::element::boolean, ov::Shape{1}, false);
|
||||||
|
|
||||||
// Set up the cell body, a function from (Xi, Yi) -> (Zo)
|
// Set up the cell body, a function from (Xi, Yi) -> (Zo)
|
||||||
// Body parameters
|
// Body parameters
|
||||||
@ -392,18 +390,18 @@ TEST(type_prop, if_invalid_false_body) {
|
|||||||
auto Xe = make_shared<ov::op::v0::Parameter>(element::dynamic, PartialShape::dynamic());
|
auto Xe = make_shared<ov::op::v0::Parameter>(element::dynamic, PartialShape::dynamic());
|
||||||
auto Ye = make_shared<ov::op::v0::Parameter>(element::dynamic, PartialShape::dynamic());
|
auto Ye = make_shared<ov::op::v0::Parameter>(element::dynamic, PartialShape::dynamic());
|
||||||
// Body
|
// Body
|
||||||
auto axes_4d = ov::op::v0::Constant::create(element::i32, ngraph::Shape{2}, {2, 3});
|
auto axes_4d = ov::op::v0::Constant::create(element::i32, ov::Shape{2}, {2, 3});
|
||||||
auto then_reduce_op = std::make_shared<op::v1::ReduceMean>(Xt, Yt);
|
auto then_reduce_op = std::make_shared<op::v1::ReduceMean>(Xt, Yt);
|
||||||
auto then_op = std::make_shared<op::v1::Add>(then_reduce_op, Yt);
|
auto then_op = std::make_shared<op::v1::Add>(then_reduce_op, Yt);
|
||||||
auto then_op_res = std::make_shared<ov::op::v0::Result>(then_op);
|
auto then_op_res = std::make_shared<ov::op::v0::Result>(then_op);
|
||||||
|
|
||||||
auto then_body = make_shared<ngraph::Function>(OutputVector{then_op_res}, ParameterVector{Xt, Yt});
|
auto then_body = make_shared<ov::Model>(OutputVector{then_op_res}, ParameterVector{Xt, Yt});
|
||||||
|
|
||||||
auto axes_3d = ov::op::v0::Constant::create(element::i32, ngraph::Shape{1}, {2});
|
auto axes_3d = ov::op::v0::Constant::create(element::i32, ov::Shape{1}, {2});
|
||||||
auto else_reduce_op = std::make_shared<op::v1::ReduceMean>(Xe, axes_3d);
|
auto else_reduce_op = std::make_shared<op::v1::ReduceMean>(Xe, axes_3d);
|
||||||
auto else_op = std::make_shared<op::v1::Add>(else_reduce_op, Ye);
|
auto else_op = std::make_shared<op::v1::Add>(else_reduce_op, Ye);
|
||||||
auto else_op_res = std::make_shared<ov::op::v0::Result>(else_op);
|
auto else_op_res = std::make_shared<ov::op::v0::Result>(else_op);
|
||||||
auto else_body = make_shared<ngraph::Function>(OutputVector{else_op_res}, ParameterVector{Xe, Ye});
|
auto else_body = make_shared<ov::Model>(OutputVector{else_op_res}, ParameterVector{Xe, Ye});
|
||||||
auto if_op = make_shared<op::v8::If>(cond);
|
auto if_op = make_shared<op::v8::If>(cond);
|
||||||
if_op->set_then_body(then_body);
|
if_op->set_then_body(then_body);
|
||||||
if_op->set_else_body(else_body);
|
if_op->set_else_body(else_body);
|
||||||
|
@ -1,18 +1,6 @@
|
|||||||
//*****************************************************************************
|
// Copyright (C) 2018-2023 Intel Corporation
|
||||||
// Copyright 2017-2022 Intel Corporation
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
//
|
//
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License.
|
|
||||||
// You may obtain a copy of the License at
|
|
||||||
//
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
//*****************************************************************************
|
|
||||||
|
|
||||||
#include "openvino/op/irdft.hpp"
|
#include "openvino/op/irdft.hpp"
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2022 Intel Corporation
|
// Copyright (C) 2018-2023 Intel Corporation
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
//
|
//
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ using namespace testing;
|
|||||||
using LogicalNotTestParam = std::tuple<element::Type, PartialShape>;
|
using LogicalNotTestParam = std::tuple<element::Type, PartialShape>;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
using namespace ngraph::element;
|
using namespace ov::element;
|
||||||
constexpr size_t exp_num_of_outputs = 1;
|
constexpr size_t exp_num_of_outputs = 1;
|
||||||
|
|
||||||
const auto types = Values(boolean, i16, i32, i64, u16, u32, u64, f32, f64);
|
const auto types = Values(boolean, i16, i32, i64, u16, u32, u64, f32, f64);
|
||||||
|
@ -173,42 +173,42 @@ TEST(type_prop, lstm_cell_invalid_input_rank0) {
|
|||||||
// Invalid rank0 for W tensor.
|
// Invalid rank0 for W tensor.
|
||||||
W = make_shared<opset4::Parameter>(element::f32, PartialShape{});
|
W = make_shared<opset4::Parameter>(element::f32, PartialShape{});
|
||||||
ASSERT_THROW(const auto unused = make_shared<opset4::LSTMCell>(X, H_t, C_t, W, R, hidden_size),
|
ASSERT_THROW(const auto unused = make_shared<opset4::LSTMCell>(X, H_t, C_t, W, R, hidden_size),
|
||||||
ngraph::NodeValidationFailure)
|
ov::NodeValidationFailure)
|
||||||
<< "LSTMCell node was created with invalid data.";
|
<< "LSTMCell node was created with invalid data.";
|
||||||
|
|
||||||
// Invalid rank0 for X tensor.
|
// Invalid rank0 for X tensor.
|
||||||
W = make_shared<opset4::Parameter>(element::f32, PartialShape{gates_count * hidden_size, input_size});
|
W = make_shared<opset4::Parameter>(element::f32, PartialShape{gates_count * hidden_size, input_size});
|
||||||
X = make_shared<opset4::Parameter>(element::f32, PartialShape{});
|
X = make_shared<opset4::Parameter>(element::f32, PartialShape{});
|
||||||
ASSERT_THROW(const auto unused = make_shared<opset4::LSTMCell>(X, H_t, C_t, W, R, hidden_size),
|
ASSERT_THROW(const auto unused = make_shared<opset4::LSTMCell>(X, H_t, C_t, W, R, hidden_size),
|
||||||
ngraph::NodeValidationFailure)
|
ov::NodeValidationFailure)
|
||||||
<< "LSTMCell node was created with invalid data.";
|
<< "LSTMCell node was created with invalid data.";
|
||||||
|
|
||||||
// Invalid rank0 for H_t tensor.
|
// Invalid rank0 for H_t tensor.
|
||||||
X = make_shared<opset4::Parameter>(element::f32, PartialShape{batch_size, input_size});
|
X = make_shared<opset4::Parameter>(element::f32, PartialShape{batch_size, input_size});
|
||||||
H_t = make_shared<opset4::Parameter>(element::f32, PartialShape{});
|
H_t = make_shared<opset4::Parameter>(element::f32, PartialShape{});
|
||||||
ASSERT_THROW(const auto unused = make_shared<opset4::LSTMCell>(X, H_t, C_t, W, R, hidden_size),
|
ASSERT_THROW(const auto unused = make_shared<opset4::LSTMCell>(X, H_t, C_t, W, R, hidden_size),
|
||||||
ngraph::NodeValidationFailure)
|
ov::NodeValidationFailure)
|
||||||
<< "LSTMCell node was created with invalid data.";
|
<< "LSTMCell node was created with invalid data.";
|
||||||
|
|
||||||
// Invalid rank0 for C_t tensor.
|
// Invalid rank0 for C_t tensor.
|
||||||
H_t = make_shared<opset4::Parameter>(element::f32, PartialShape{batch_size, hidden_size});
|
H_t = make_shared<opset4::Parameter>(element::f32, PartialShape{batch_size, hidden_size});
|
||||||
C_t = make_shared<opset4::Parameter>(element::f32, PartialShape{});
|
C_t = make_shared<opset4::Parameter>(element::f32, PartialShape{});
|
||||||
ASSERT_THROW(const auto unused = make_shared<opset4::LSTMCell>(X, H_t, C_t, W, R, hidden_size),
|
ASSERT_THROW(const auto unused = make_shared<opset4::LSTMCell>(X, H_t, C_t, W, R, hidden_size),
|
||||||
ngraph::NodeValidationFailure)
|
ov::NodeValidationFailure)
|
||||||
<< "LSTMCell node was created with invalid data.";
|
<< "LSTMCell node was created with invalid data.";
|
||||||
|
|
||||||
// Invalid rank0 for R tensor.
|
// Invalid rank0 for R tensor.
|
||||||
C_t = make_shared<opset4::Parameter>(element::f32, PartialShape{batch_size, hidden_size});
|
C_t = make_shared<opset4::Parameter>(element::f32, PartialShape{batch_size, hidden_size});
|
||||||
R = make_shared<opset4::Parameter>(element::f32, PartialShape{});
|
R = make_shared<opset4::Parameter>(element::f32, PartialShape{});
|
||||||
ASSERT_THROW(const auto unused = make_shared<opset4::LSTMCell>(X, H_t, C_t, W, R, hidden_size),
|
ASSERT_THROW(const auto unused = make_shared<opset4::LSTMCell>(X, H_t, C_t, W, R, hidden_size),
|
||||||
ngraph::NodeValidationFailure)
|
ov::NodeValidationFailure)
|
||||||
<< "LSTMCell node was created with invalid data.";
|
<< "LSTMCell node was created with invalid data.";
|
||||||
|
|
||||||
// Invalid rank0 for B tensor.
|
// Invalid rank0 for B tensor.
|
||||||
R = make_shared<opset4::Parameter>(element::f32, PartialShape{gates_count * hidden_size, hidden_size});
|
R = make_shared<opset4::Parameter>(element::f32, PartialShape{gates_count * hidden_size, hidden_size});
|
||||||
auto B = make_shared<opset4::Parameter>(element::f32, PartialShape{});
|
auto B = make_shared<opset4::Parameter>(element::f32, PartialShape{});
|
||||||
ASSERT_THROW(const auto unused = make_shared<opset4::LSTMCell>(X, H_t, C_t, W, R, B, hidden_size),
|
ASSERT_THROW(const auto unused = make_shared<opset4::LSTMCell>(X, H_t, C_t, W, R, B, hidden_size),
|
||||||
ngraph::NodeValidationFailure)
|
ov::NodeValidationFailure)
|
||||||
<< "LSTMCell node was created with invalid data.";
|
<< "LSTMCell node was created with invalid data.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ struct recurrent_sequence_parameters {
|
|||||||
Dimension seq_length = 12;
|
Dimension seq_length = 12;
|
||||||
Dimension input_size = 8;
|
Dimension input_size = 8;
|
||||||
Dimension hidden_size = 256;
|
Dimension hidden_size = 256;
|
||||||
ngraph::element::Type et = element::f32;
|
ov::element::Type et = element::f32;
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -459,7 +459,7 @@ TEST(type_prop, lstm_sequence_invalid_input_dimension) {
|
|||||||
for (size_t i = 0; i < lstm_sequence->get_input_size(); i++) {
|
for (size_t i = 0; i < lstm_sequence->get_input_size(); i++) {
|
||||||
lstm_sequence = lstm_seq_tensor_initialization(param);
|
lstm_sequence = lstm_seq_tensor_initialization(param);
|
||||||
lstm_sequence->set_argument(i, invalid_rank0_tensor);
|
lstm_sequence->set_argument(i, invalid_rank0_tensor);
|
||||||
ASSERT_THROW(lstm_sequence->validate_and_infer_types(), ngraph::CheckFailure)
|
ASSERT_THROW(lstm_sequence->validate_and_infer_types(), ov::AssertFailure)
|
||||||
<< "LSTMSequence node was created with invalid data.";
|
<< "LSTMSequence node was created with invalid data.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -673,7 +673,7 @@ TEST(type_prop, lstm_sequence_v0_invalid_input_dimension) {
|
|||||||
for (size_t i = 0; i < lstm_sequence->get_input_size(); i++) {
|
for (size_t i = 0; i < lstm_sequence->get_input_size(); i++) {
|
||||||
lstm_sequence = lstm_seq_v0_tensor_initialization(param);
|
lstm_sequence = lstm_seq_v0_tensor_initialization(param);
|
||||||
lstm_sequence->set_argument(i, invalid_rank0_tensor);
|
lstm_sequence->set_argument(i, invalid_rank0_tensor);
|
||||||
ASSERT_THROW(lstm_sequence->validate_and_infer_types(), ngraph::CheckFailure)
|
ASSERT_THROW(lstm_sequence->validate_and_infer_types(), ov::AssertFailure)
|
||||||
<< "LSTMSequence node was created with invalid data.";
|
<< "LSTMSequence node was created with invalid data.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -215,7 +215,7 @@ TEST_F(TypePropMatrixNmsV8Test, output_shape_i32) {
|
|||||||
const auto boxes = make_shared<op::v0::Parameter>(element::f32, Shape{2, 7, 4});
|
const auto boxes = make_shared<op::v0::Parameter>(element::f32, Shape{2, 7, 4});
|
||||||
const auto scores = make_shared<op::v0::Parameter>(element::f32, Shape{2, 5, 7});
|
const auto scores = make_shared<op::v0::Parameter>(element::f32, Shape{2, 5, 7});
|
||||||
op::v8::MatrixNms::Attributes attrs;
|
op::v8::MatrixNms::Attributes attrs;
|
||||||
attrs.output_type = ngraph::element::i32;
|
attrs.output_type = ov::element::i32;
|
||||||
|
|
||||||
const auto nms = make_op(boxes, scores, attrs);
|
const auto nms = make_op(boxes, scores, attrs);
|
||||||
|
|
||||||
|
@ -149,36 +149,32 @@ TEST(type_prop, rnn_cell_invalid_input_rank0) {
|
|||||||
|
|
||||||
// Invalid rank0 for W tensor.
|
// Invalid rank0 for W tensor.
|
||||||
auto W = make_shared<opset4::Parameter>(element::f32, PartialShape{});
|
auto W = make_shared<opset4::Parameter>(element::f32, PartialShape{});
|
||||||
ASSERT_THROW(const auto unused = make_shared<opset4::RNNCell>(X, H_t, W, R, hidden_size),
|
ASSERT_THROW(const auto unused = make_shared<opset4::RNNCell>(X, H_t, W, R, hidden_size), ov::NodeValidationFailure)
|
||||||
ngraph::NodeValidationFailure)
|
|
||||||
<< "RNNCell node was created with invalid data.";
|
<< "RNNCell node was created with invalid data.";
|
||||||
|
|
||||||
// Invalid rank0 for X tensor.
|
// Invalid rank0 for X tensor.
|
||||||
W = make_shared<opset4::Parameter>(element::f32, Shape{hidden_size, input_size});
|
W = make_shared<opset4::Parameter>(element::f32, Shape{hidden_size, input_size});
|
||||||
X = make_shared<opset4::Parameter>(element::f32, PartialShape{});
|
X = make_shared<opset4::Parameter>(element::f32, PartialShape{});
|
||||||
ASSERT_THROW(const auto unused = make_shared<opset4::RNNCell>(X, H_t, W, R, hidden_size),
|
ASSERT_THROW(const auto unused = make_shared<opset4::RNNCell>(X, H_t, W, R, hidden_size), ov::NodeValidationFailure)
|
||||||
ngraph::NodeValidationFailure)
|
|
||||||
<< "RNNCell node was created with invalid data.";
|
<< "RNNCell node was created with invalid data.";
|
||||||
|
|
||||||
// Invalid rank0 for H_t tensor.
|
// Invalid rank0 for H_t tensor.
|
||||||
X = make_shared<opset4::Parameter>(element::f32, Shape{batch_size, input_size});
|
X = make_shared<opset4::Parameter>(element::f32, Shape{batch_size, input_size});
|
||||||
H_t = make_shared<opset4::Parameter>(element::f32, PartialShape{});
|
H_t = make_shared<opset4::Parameter>(element::f32, PartialShape{});
|
||||||
ASSERT_THROW(const auto unused = make_shared<opset4::RNNCell>(X, H_t, W, R, hidden_size),
|
ASSERT_THROW(const auto unused = make_shared<opset4::RNNCell>(X, H_t, W, R, hidden_size), ov::NodeValidationFailure)
|
||||||
ngraph::NodeValidationFailure)
|
|
||||||
<< "RNNCell node was created with invalid data.";
|
<< "RNNCell node was created with invalid data.";
|
||||||
|
|
||||||
// Invalid rank0 for R tensor.
|
// Invalid rank0 for R tensor.
|
||||||
H_t = make_shared<opset4::Parameter>(element::f32, Shape{batch_size, hidden_size});
|
H_t = make_shared<opset4::Parameter>(element::f32, Shape{batch_size, hidden_size});
|
||||||
R = make_shared<opset4::Parameter>(element::f32, PartialShape{});
|
R = make_shared<opset4::Parameter>(element::f32, PartialShape{});
|
||||||
ASSERT_THROW(const auto unused = make_shared<opset4::RNNCell>(X, H_t, W, R, hidden_size),
|
ASSERT_THROW(const auto unused = make_shared<opset4::RNNCell>(X, H_t, W, R, hidden_size), ov::NodeValidationFailure)
|
||||||
ngraph::NodeValidationFailure)
|
|
||||||
<< "RNNCell node was created with invalid data.";
|
<< "RNNCell node was created with invalid data.";
|
||||||
|
|
||||||
// Invalid rank0 for B tensor.
|
// Invalid rank0 for B tensor.
|
||||||
R = make_shared<opset4::Parameter>(element::f32, Shape{hidden_size, hidden_size});
|
R = make_shared<opset4::Parameter>(element::f32, Shape{hidden_size, hidden_size});
|
||||||
auto B = make_shared<opset4::Parameter>(element::f32, PartialShape{});
|
auto B = make_shared<opset4::Parameter>(element::f32, PartialShape{});
|
||||||
ASSERT_THROW(const auto unused = make_shared<opset4::RNNCell>(X, H_t, W, R, B, hidden_size),
|
ASSERT_THROW(const auto unused = make_shared<opset4::RNNCell>(X, H_t, W, R, B, hidden_size),
|
||||||
ngraph::NodeValidationFailure)
|
ov::NodeValidationFailure)
|
||||||
<< "RNNCell node was created with invalid data.";
|
<< "RNNCell node was created with invalid data.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -266,7 +266,7 @@ TEST(type_prop, rnn_sequence_dynamic_invalid_input_rank0) {
|
|||||||
X = make_shared<opset5::Parameter>(element::f32, PartialShape{});
|
X = make_shared<opset5::Parameter>(element::f32, PartialShape{});
|
||||||
ASSERT_THROW(
|
ASSERT_THROW(
|
||||||
const auto unused = make_shared<opset5::RNNSequence>(X, H_t, sequence_lengths, W, R, B, hidden_size, direction),
|
const auto unused = make_shared<opset5::RNNSequence>(X, H_t, sequence_lengths, W, R, B, hidden_size, direction),
|
||||||
ngraph::CheckFailure)
|
ov::AssertFailure)
|
||||||
<< "RNNSequence node was created with invalid data.";
|
<< "RNNSequence node was created with invalid data.";
|
||||||
|
|
||||||
// Invalid rank0 for H_t tensor.
|
// Invalid rank0 for H_t tensor.
|
||||||
@ -274,7 +274,7 @@ TEST(type_prop, rnn_sequence_dynamic_invalid_input_rank0) {
|
|||||||
H_t = make_shared<opset5::Parameter>(element::f32, PartialShape{});
|
H_t = make_shared<opset5::Parameter>(element::f32, PartialShape{});
|
||||||
ASSERT_THROW(
|
ASSERT_THROW(
|
||||||
const auto unused = make_shared<opset5::RNNSequence>(X, H_t, sequence_lengths, W, R, B, hidden_size, direction),
|
const auto unused = make_shared<opset5::RNNSequence>(X, H_t, sequence_lengths, W, R, B, hidden_size, direction),
|
||||||
ngraph::CheckFailure)
|
ov::AssertFailure)
|
||||||
<< "RNNSequence node was created with invalid data.";
|
<< "RNNSequence node was created with invalid data.";
|
||||||
|
|
||||||
// Invalid rank0 for W tensor.
|
// Invalid rank0 for W tensor.
|
||||||
@ -282,7 +282,7 @@ TEST(type_prop, rnn_sequence_dynamic_invalid_input_rank0) {
|
|||||||
W = make_shared<opset5::Parameter>(element::f32, PartialShape{});
|
W = make_shared<opset5::Parameter>(element::f32, PartialShape{});
|
||||||
ASSERT_THROW(
|
ASSERT_THROW(
|
||||||
const auto unused = make_shared<opset5::RNNSequence>(X, H_t, sequence_lengths, W, R, B, hidden_size, direction),
|
const auto unused = make_shared<opset5::RNNSequence>(X, H_t, sequence_lengths, W, R, B, hidden_size, direction),
|
||||||
ngraph::CheckFailure)
|
ov::AssertFailure)
|
||||||
<< "RNNSequence node was created with invalid data.";
|
<< "RNNSequence node was created with invalid data.";
|
||||||
|
|
||||||
// Invalid rank0 for R tensor.
|
// Invalid rank0 for R tensor.
|
||||||
@ -290,7 +290,7 @@ TEST(type_prop, rnn_sequence_dynamic_invalid_input_rank0) {
|
|||||||
R = make_shared<opset5::Parameter>(element::f32, PartialShape{});
|
R = make_shared<opset5::Parameter>(element::f32, PartialShape{});
|
||||||
ASSERT_THROW(
|
ASSERT_THROW(
|
||||||
const auto unused = make_shared<opset5::RNNSequence>(X, H_t, sequence_lengths, W, R, B, hidden_size, direction),
|
const auto unused = make_shared<opset5::RNNSequence>(X, H_t, sequence_lengths, W, R, B, hidden_size, direction),
|
||||||
ngraph::CheckFailure)
|
ov::AssertFailure)
|
||||||
<< "RNNSequence node was created with invalid data.";
|
<< "RNNSequence node was created with invalid data.";
|
||||||
|
|
||||||
// Invalid rank0 for B tensor.
|
// Invalid rank0 for B tensor.
|
||||||
@ -298,7 +298,7 @@ TEST(type_prop, rnn_sequence_dynamic_invalid_input_rank0) {
|
|||||||
B = make_shared<opset5::Parameter>(element::f32, PartialShape{});
|
B = make_shared<opset5::Parameter>(element::f32, PartialShape{});
|
||||||
ASSERT_THROW(
|
ASSERT_THROW(
|
||||||
const auto unused = make_shared<opset5::RNNSequence>(X, H_t, sequence_lengths, W, R, B, hidden_size, direction),
|
const auto unused = make_shared<opset5::RNNSequence>(X, H_t, sequence_lengths, W, R, B, hidden_size, direction),
|
||||||
ngraph::CheckFailure)
|
ov::AssertFailure)
|
||||||
<< "RNNSequence node was created with invalid data.";
|
<< "RNNSequence node was created with invalid data.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ using namespace ov;
|
|||||||
using namespace testing;
|
using namespace testing;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
using type = ngraph::element::Type;
|
using type = ov::element::Type;
|
||||||
void type_check(const type& refType) {
|
void type_check(const type& refType) {
|
||||||
Shape ref_shape{2, 3, 4};
|
Shape ref_shape{2, 3, 4};
|
||||||
Shape indices_shape{2, 1};
|
Shape indices_shape{2, 1};
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2021 Intel Corporation
|
// Copyright (C) 2018-2023 Intel Corporation
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
//
|
//
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include "ngraph/op/util/attr_types.hpp"
|
|
||||||
#include "openvino/op/nv12_to_bgr.hpp"
|
#include "openvino/op/nv12_to_bgr.hpp"
|
||||||
#include "openvino/op/nv12_to_rgb.hpp"
|
#include "openvino/op/nv12_to_rgb.hpp"
|
||||||
#include "visitors/visitors.hpp"
|
#include "visitors/visitors.hpp"
|
||||||
|
@ -19,7 +19,7 @@ TEST(attributes, extractimagepatches_op) {
|
|||||||
auto sizes = Shape{3, 3};
|
auto sizes = Shape{3, 3};
|
||||||
auto strides = Strides{5, 5};
|
auto strides = Strides{5, 5};
|
||||||
auto rates = Shape{1, 1};
|
auto rates = Shape{1, 1};
|
||||||
auto padtype_padding = ngraph::op::PadType::VALID;
|
auto padtype_padding = ov::op::PadType::VALID;
|
||||||
|
|
||||||
auto extractimagepatches =
|
auto extractimagepatches =
|
||||||
make_shared<ov::op::v3::ExtractImagePatches>(data, sizes, strides, rates, padtype_padding);
|
make_shared<ov::op::v3::ExtractImagePatches>(data, sizes, strides, rates, padtype_padding);
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
#include "unary_ops.hpp"
|
#include "unary_ops.hpp"
|
||||||
|
|
||||||
using Types = ::testing::Types<UnaryOperatorType<ov::op::v0::Floor, ngraph::element::f32>,
|
using Types = ::testing::Types<UnaryOperatorType<ov::op::v0::Floor, ov::element::f32>,
|
||||||
UnaryOperatorType<ov::op::v0::Floor, ngraph::element::f16>>;
|
UnaryOperatorType<ov::op::v0::Floor, ov::element::f16>>;
|
||||||
|
|
||||||
INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_attribute, UnaryOperatorVisitor, Types, UnaryOperatorTypeName);
|
INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_attribute, UnaryOperatorVisitor, Types, UnaryOperatorTypeName);
|
||||||
|
@ -6,6 +6,6 @@
|
|||||||
|
|
||||||
#include "binary_ops.hpp"
|
#include "binary_ops.hpp"
|
||||||
|
|
||||||
using Type = ::testing::Types<BinaryOperatorType<ov::op::v1::FloorMod, ngraph::element::f32>>;
|
using Type = ::testing::Types<BinaryOperatorType<ov::op::v1::FloorMod, ov::element::f32>>;
|
||||||
|
|
||||||
INSTANTIATE_TYPED_TEST_SUITE_P(visitor_with_auto_broadcast, BinaryOperatorVisitor, Type, BinaryOperatorTypeName);
|
INSTANTIATE_TYPED_TEST_SUITE_P(visitor_with_auto_broadcast, BinaryOperatorVisitor, Type, BinaryOperatorTypeName);
|
||||||
|
@ -6,5 +6,5 @@
|
|||||||
|
|
||||||
#include "reduce_ops.hpp"
|
#include "reduce_ops.hpp"
|
||||||
|
|
||||||
using Type = ::testing::Types<ReduceOperatorType<ov::op::v4::ReduceL1, ngraph::element::f32>>;
|
using Type = ::testing::Types<ReduceOperatorType<ov::op::v4::ReduceL1, ov::element::f32>>;
|
||||||
INSTANTIATE_TYPED_TEST_SUITE_P(attributes_reduce_op, ReduceOperatorVisitor, Type, ReduceOperatorTypeName);
|
INSTANTIATE_TYPED_TEST_SUITE_P(attributes_reduce_op, ReduceOperatorVisitor, Type, ReduceOperatorTypeName);
|
||||||
|
@ -47,7 +47,7 @@ TEST(attributes, tensor_iterator_lstm) {
|
|||||||
H);
|
H);
|
||||||
auto H_o = ngraph::builder::opset1::reshape(LSTM_cell->output(0), Shape{N, 1, H});
|
auto H_o = ngraph::builder::opset1::reshape(LSTM_cell->output(0), Shape{N, 1, H});
|
||||||
auto C_o = ngraph::builder::opset1::reshape(LSTM_cell->output(1), Shape{N, 1, H});
|
auto C_o = ngraph::builder::opset1::reshape(LSTM_cell->output(1), Shape{N, 1, H});
|
||||||
auto body = make_shared<ngraph::Function>(OutputVector{H_o, C_o}, ParameterVector{X, H_t, C_t, W_body, R_body});
|
auto body = make_shared<ov::Model>(OutputVector{H_o, C_o}, ParameterVector{X, H_t, C_t, W_body, R_body});
|
||||||
|
|
||||||
auto tensor_iterator = make_shared<op::v0::TensorIterator>();
|
auto tensor_iterator = make_shared<op::v0::TensorIterator>();
|
||||||
tensor_iterator->set_body(body);
|
tensor_iterator->set_body(body);
|
||||||
@ -82,7 +82,7 @@ TEST(attributes, tensor_iterator_2_slice_inputs_part_size_2) {
|
|||||||
|
|
||||||
// Body
|
// Body
|
||||||
auto Zo = std::make_shared<op::v1::Multiply>(std::make_shared<op::v1::Add>(Xi, Yi), M_body);
|
auto Zo = std::make_shared<op::v1::Multiply>(std::make_shared<op::v1::Add>(Xi, Yi), M_body);
|
||||||
auto body = make_shared<ngraph::Function>(OutputVector{Zo}, ParameterVector{Xi, Yi, M_body});
|
auto body = make_shared<ov::Model>(OutputVector{Zo}, ParameterVector{Xi, Yi, M_body});
|
||||||
|
|
||||||
auto tensor_iterator = make_shared<op::v0::TensorIterator>();
|
auto tensor_iterator = make_shared<op::v0::TensorIterator>();
|
||||||
|
|
||||||
@ -118,7 +118,7 @@ TEST(attributes, tensor_iterator_2_slice_inputs_part_size_2_dynamic) {
|
|||||||
|
|
||||||
// Body
|
// Body
|
||||||
auto Zo = std::make_shared<op::v1::Multiply>(std::make_shared<op::v1::Add>(Xi, Yi), M_body);
|
auto Zo = std::make_shared<op::v1::Multiply>(std::make_shared<op::v1::Add>(Xi, Yi), M_body);
|
||||||
auto body = make_shared<ngraph::Function>(OutputVector{Zo}, ParameterVector{Xi, Yi, M_body});
|
auto body = make_shared<ov::Model>(OutputVector{Zo}, ParameterVector{Xi, Yi, M_body});
|
||||||
|
|
||||||
auto tensor_iterator = make_shared<op::v0::TensorIterator>();
|
auto tensor_iterator = make_shared<op::v0::TensorIterator>();
|
||||||
tensor_iterator->set_body(body);
|
tensor_iterator->set_body(body);
|
||||||
|
Loading…
Reference in New Issue
Block a user