Skip to content

Commit

Permalink
Do not use opset in transformation tests
Browse files Browse the repository at this point in the history
  • Loading branch information
olpipi committed Mar 6, 2024
1 parent 1a6f7e7 commit d9e19e5
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@

#include "common_test_utils/ov_test_utils.hpp"
#include "openvino/core/model.hpp"
#include "openvino/op/concat.hpp"
#include "openvino/op/constant.hpp"
#include "openvino/op/parameter.hpp"
#include "openvino/op/split.hpp"
#include "openvino/op/transpose.hpp"
#include "openvino/op/reshape.hpp"
#include "openvino/op/matmul.hpp"
#include "openvino/op/lstm_sequence.hpp"
#include "openvino/pass/manager.hpp"
#include "transformations/init_node_info.hpp"
#include "transformations/utils/utils.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@

#include "common_test_utils/ov_test_utils.hpp"
#include "openvino/core/model.hpp"
#include "openvino/op/concat.hpp"
#include "openvino/op/constant.hpp"
#include "openvino/op/parameter.hpp"
#include "openvino/pass/manager.hpp"
#include "transformations/init_node_info.hpp"
#include "transformations/utils/utils.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
#include <memory>

#include "common_test_utils/ov_test_utils.hpp"
#include "openvino/opsets/opset10.hpp"
#include "openvino/op/constant.hpp"
#include "openvino/op/convert.hpp"
#include "openvino/op/divide.hpp"
#include "openvino/op/multiply.hpp"
#include "openvino/op/parameter.hpp"
#include "transformer/cuda_graph_transformer.hpp"

using namespace testing;
Expand All @@ -17,9 +21,9 @@ TEST(TransformationTests, cuda_transformations_f16) {
std::shared_ptr<ov::Model> model, model_ref;
{
// Example model
auto data = std::make_shared<ov::opset10::Parameter>(ov::element::f32, ov::Shape{3, 1, 2});
auto divide_constant = ov::opset10::Constant::create(ov::element::f32, ov::Shape{1}, {2});
auto divide = std::make_shared<ov::opset10::Divide>(data, divide_constant);
auto data = std::make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::Shape{3, 1, 2});
auto divide_constant = ov::op::v0::Constant::create(ov::element::f32, ov::Shape{1}, {2});
auto divide = std::make_shared<ov::op::v1::Divide>(data, divide_constant);

model = std::make_shared<ov::Model>(ov::NodeVector{divide}, ov::ParameterVector{data});

Expand All @@ -39,10 +43,10 @@ TEST(TransformationTests, cuda_transformations_f16) {
{
// Example reference model
auto data = std::make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::Shape{3, 1, 2});
auto convert_f16 = std::make_shared<ov::opset10::Convert>(data, ov::element::f16);
auto mul_constant = ov::opset10::Constant::create(ov::element::f16, ov::Shape{1, 1, 1}, {0.5});
auto mul = std::make_shared<ov::opset10::Multiply>(convert_f16, mul_constant);
auto convert_f32 = std::make_shared<ov::opset10::Convert>(mul, ov::element::f32);
auto convert_f16 = std::make_shared<ov::op::v0::Convert>(data, ov::element::f16);
auto mul_constant = ov::op::v0::Constant::create(ov::element::f16, ov::Shape{1, 1, 1}, {0.5});
auto mul = std::make_shared<ov::op::v1::Multiply>(convert_f16, mul_constant);
auto convert_f32 = std::make_shared<ov::op::v0::Convert>(mul, ov::element::f32);

model_ref = std::make_shared<ov::Model>(ov::NodeVector{convert_f32}, ov::ParameterVector{data});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "cuda_operation_registry.hpp"
#include "openvino/core/model.hpp"
#include "openvino/op/convert.hpp"
#include "openvino/op/parameter.hpp"
#include "openvino/op/detection_output.hpp"
#include "openvino/pass/manager.hpp"
#include "transformations/init_node_info.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@

#include "common_test_utils/ov_test_utils.hpp"
#include "openvino/core/model.hpp"
#include "openvino/op/concat.hpp"
#include "openvino/op/constant.hpp"
#include "openvino/op/parameter.hpp"
#include "openvino/op/add.hpp"
#include "openvino/op/matmul.hpp"
#include "openvino/op/variadic_split.hpp"
#include "openvino/pass/manager.hpp"
#include "transformations/init_node_info.hpp"
#include "transformations/utils/utils.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
#include "common_test_utils/ov_test_utils.hpp"
#include "openvino/core/model.hpp"
#include "openvino/op/parameter.hpp"
#include "openvino/op/constant.hpp"
#include "openvino/op/reshape.hpp"
#include "openvino/op/reduce_max.hpp"
#include "openvino/op/reduce_mean.hpp"
#include "openvino/op/reduce_min.hpp"
#include "openvino/op/reduce_sum.hpp"
#include "openvino/op/reduce_prod.hpp"
#include "openvino/opsets/opset.hpp"
#include "openvino/pass/manager.hpp"
#include "transformations/init_node_info.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
#include "common_test_utils/ov_test_utils.hpp"
#include "openvino/core/model.hpp"
#include "openvino/op/parameter.hpp"
#include "openvino/opsets/opset10.hpp"
#include "openvino/op/convert.hpp"
#include "openvino/op/abs.hpp"
#include "openvino/pass/manager.hpp"
#include "transformations/init_node_info.hpp"
#include "transformations/utils/utils.hpp"
Expand Down

0 comments on commit d9e19e5

Please sign in to comment.