Move FunctionsComparator to common utils (#11277)
* Move FunctionsComparator to common utils * Fix includes
This commit is contained in:
parent
070c47ec09
commit
5b0a1fe7bb
@ -581,6 +581,7 @@ endif()
|
||||
|
||||
target_link_libraries(ov_core_unit_tests PRIVATE ngraph_test_util
|
||||
engines_test_util
|
||||
commonTestUtils
|
||||
ngraph_reference
|
||||
ngraph::builder
|
||||
openvino::util
|
||||
|
@ -5,13 +5,13 @@
|
||||
#include <memory>
|
||||
#include <util/type_prop.hpp>
|
||||
|
||||
#include "common_test_utils/graph_comparator.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/builder/autobroadcast.hpp"
|
||||
#include "ngraph/file_util.hpp"
|
||||
#include "ngraph/ngraph.hpp"
|
||||
#include "ngraph/opsets/opset5.hpp"
|
||||
#include "ngraph/opsets/opset7.hpp"
|
||||
#include "util/graph_comparator.hpp"
|
||||
#include "util/test_tools.hpp"
|
||||
|
||||
NGRAPH_SUPPRESS_DEPRECATED_START
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include <transformations/utils/utils.hpp>
|
||||
|
||||
#include "common_test_utils/ngraph_test_utils.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/ngraph.hpp"
|
||||
#include "ngraph/opsets/opset1.hpp"
|
||||
|
@ -4,10 +4,10 @@
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include <common_test_utils/ngraph_test_utils.hpp>
|
||||
#include <ngraph/opsets/opset3.hpp>
|
||||
#include <ngraph/pass/graph_rewrite.hpp>
|
||||
#include <ngraph/pass/manager.hpp>
|
||||
#include <util/test_tools.hpp>
|
||||
|
||||
NGRAPH_SUPPRESS_DEPRECATED_START
|
||||
|
||||
|
@ -39,6 +39,7 @@
|
||||
#include "util/test_control.hpp"
|
||||
#include "util/test_tools.hpp"
|
||||
#include "util/type_prop.hpp"
|
||||
#include "common_test_utils/ngraph_test_utils.hpp"
|
||||
|
||||
NGRAPH_SUPPRESS_DEPRECATED_START
|
||||
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include <stdexcept>
|
||||
#include <vector>
|
||||
|
||||
#include "common_test_utils/ngraph_test_utils.hpp"
|
||||
#include "engines_util/test_case.hpp"
|
||||
#include "engines_util/test_engines.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include <stdexcept>
|
||||
#include <vector>
|
||||
|
||||
#include "common_test_utils/ngraph_test_utils.hpp"
|
||||
#include "engines_util/test_case.hpp"
|
||||
#include "engines_util/test_engines.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "engines_util/execute_tools.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/runtime/host_tensor.hpp"
|
||||
#include "ngraph/util.hpp"
|
||||
#include "ngraph/validation_util.hpp"
|
||||
#include "util/test_tools.hpp"
|
||||
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "engines_util/execute_tools.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/runtime/host_tensor.hpp"
|
||||
#include "ngraph/util.hpp"
|
||||
#include "ngraph/validation_util.hpp"
|
||||
#include "util/test_tools.hpp"
|
||||
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "engines_util/execute_tools.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/runtime/host_tensor.hpp"
|
||||
#include "ngraph/util.hpp"
|
||||
#include "ngraph/validation_util.hpp"
|
||||
#include "util/test_tools.hpp"
|
||||
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/op/constant.hpp"
|
||||
#include "ngraph/runtime/host_tensor.hpp"
|
||||
#include "ngraph/util.hpp"
|
||||
#include "ngraph/validation_util.hpp"
|
||||
#include "util/all_close_f.hpp"
|
||||
#include "util/test_tools.hpp"
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "engines_util/execute_tools.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/runtime/host_tensor.hpp"
|
||||
#include "ngraph/util.hpp"
|
||||
#include "util/all_close_f.hpp"
|
||||
|
||||
using namespace std;
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "ngraph/op/util/variable.hpp"
|
||||
#include "ngraph/op/util/variable_context.hpp"
|
||||
#include "ngraph/opsets/opset7.hpp"
|
||||
#include "ngraph/util.hpp"
|
||||
#include "ngraph/validation_util.hpp"
|
||||
#include "ngraph/variant.hpp"
|
||||
#include "util/all_close_f.hpp"
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "engines_util/execute_tools.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/runtime/host_tensor.hpp"
|
||||
#include "ngraph/util.hpp"
|
||||
#include "ngraph/validation_util.hpp"
|
||||
#include "util/test_tools.hpp"
|
||||
#include "util/type_prop.hpp"
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "engines_util/execute_tools.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/runtime/host_tensor.hpp"
|
||||
#include "ngraph/util.hpp"
|
||||
#include "ngraph/validation_util.hpp"
|
||||
#include "util/test_tools.hpp"
|
||||
#include "util/type_prop.hpp"
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "engines_util/execute_tools.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/runtime/host_tensor.hpp"
|
||||
#include "ngraph/util.hpp"
|
||||
#include "ngraph/validation_util.hpp"
|
||||
#include "util/all_close_f.hpp"
|
||||
#include "util/test_tools.hpp"
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "engines_util/execute_tools.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/runtime/host_tensor.hpp"
|
||||
#include "ngraph/util.hpp"
|
||||
#include "ngraph/validation_util.hpp"
|
||||
#include "util/test_tools.hpp"
|
||||
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "engines_util/execute_tools.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/runtime/host_tensor.hpp"
|
||||
#include "ngraph/util.hpp"
|
||||
#include "ngraph/validation_util.hpp"
|
||||
#include "util/test_tools.hpp"
|
||||
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "engines_util/execute_tools.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/runtime/host_tensor.hpp"
|
||||
#include "ngraph/util.hpp"
|
||||
#include "ngraph/validation_util.hpp"
|
||||
#include "util/test_tools.hpp"
|
||||
#include "util/type_prop.hpp"
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "engines_util/execute_tools.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/runtime/host_tensor.hpp"
|
||||
#include "ngraph/util.hpp"
|
||||
#include "ngraph/validation_util.hpp"
|
||||
#include "util/test_tools.hpp"
|
||||
#include "util/type_prop.hpp"
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "engines_util/execute_tools.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/runtime/host_tensor.hpp"
|
||||
#include "ngraph/util.hpp"
|
||||
#include "ngraph/validation_util.hpp"
|
||||
#include "util/test_tools.hpp"
|
||||
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/runtime/host_tensor.hpp"
|
||||
#include "ngraph/runtime/reference/transpose.hpp"
|
||||
#include "ngraph/util.hpp"
|
||||
#include "ngraph/validation_util.hpp"
|
||||
#include "util/all_close_f.hpp"
|
||||
#include "util/test_tools.hpp"
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "engines_util/execute_tools.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/runtime/host_tensor.hpp"
|
||||
#include "ngraph/util.hpp"
|
||||
#include "ngraph/validation_util.hpp"
|
||||
#include "util/test_tools.hpp"
|
||||
#include "util/type_prop.hpp"
|
||||
|
@ -8,7 +8,6 @@
|
||||
|
||||
#include "openvino/opsets/opset8.hpp"
|
||||
#include "openvino/pass/serialize.hpp"
|
||||
#include "util/graph_comparator.hpp"
|
||||
#include "util/test_common.hpp"
|
||||
|
||||
class SerializationCleanupTest : public ov::test::TestsCommon {
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include "openvino/pass/serialize.hpp"
|
||||
#include "openvino/util/file_util.hpp"
|
||||
#include "read_ir.hpp"
|
||||
#include "util/graph_comparator.hpp"
|
||||
#include "util/test_common.hpp"
|
||||
|
||||
class SerializationDeterministicityTest : public ov::test::TestsCommon {
|
||||
|
@ -6,10 +6,10 @@
|
||||
|
||||
#include <fstream>
|
||||
|
||||
#include "common_test_utils/graph_comparator.hpp"
|
||||
#include "openvino/pass/serialize.hpp"
|
||||
#include "openvino/util/file_util.hpp"
|
||||
#include "read_ir.hpp"
|
||||
#include "util/graph_comparator.hpp"
|
||||
#include "util/test_common.hpp"
|
||||
|
||||
using ModelBuilder = std::function<std::shared_ptr<ov::Model>()>;
|
||||
|
@ -8,11 +8,11 @@
|
||||
|
||||
#include <fstream>
|
||||
|
||||
#include "common_test_utils/graph_comparator.hpp"
|
||||
#include "ngraph/pass/manager.hpp"
|
||||
#include "ngraph/pass/serialize.hpp"
|
||||
#include "openvino/util/file_util.hpp"
|
||||
#include "read_ir.hpp"
|
||||
#include "util/graph_comparator.hpp"
|
||||
#include "util/test_common.hpp"
|
||||
|
||||
using SerializationParams = std::tuple<std::string, std::string>;
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include "openvino/opsets/opset8.hpp"
|
||||
#include "openvino/pass/serialize.hpp"
|
||||
#include "read_ir.hpp"
|
||||
#include "util/graph_comparator.hpp"
|
||||
#include "common_test_utils/graph_comparator.hpp"
|
||||
#include "util/test_common.hpp"
|
||||
|
||||
class TensorNameSerializationTest : public ov::test::TestsCommon {
|
||||
|
@ -3,6 +3,7 @@
|
||||
//
|
||||
|
||||
#include <algorithm>
|
||||
#include <common_test_utils/ngraph_test_utils.hpp>
|
||||
#include <cstdio>
|
||||
#include <iostream>
|
||||
#include <list>
|
||||
|
@ -2,11 +2,11 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#include "common_test_utils/graph_comparator.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/ngraph.hpp"
|
||||
#include "ngraph/op/util/attr_types.hpp"
|
||||
#include "ngraph/opsets/opset8.hpp"
|
||||
#include "util/graph_comparator.hpp"
|
||||
#include "util/visitor.hpp"
|
||||
|
||||
using namespace std;
|
||||
|
@ -4,11 +4,11 @@
|
||||
|
||||
#include "json_config.hpp"
|
||||
|
||||
#include <common_test_utils/graph_comparator.hpp>
|
||||
#include <extension/json_config.hpp>
|
||||
#include <extension/json_transformation.hpp>
|
||||
#include <nlohmann/json-schema.hpp>
|
||||
#include <ostream>
|
||||
#include <util/graph_comparator.hpp>
|
||||
|
||||
#include "utils.hpp"
|
||||
|
||||
|
@ -13,16 +13,15 @@
|
||||
#include <random>
|
||||
#include <vector>
|
||||
|
||||
#include "graph_comparator.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/file_util.hpp"
|
||||
#include "ngraph/function.hpp"
|
||||
#include "ngraph/log.hpp"
|
||||
#include "ngraph/node.hpp"
|
||||
#include "ngraph/op/op.hpp"
|
||||
#include "ngraph/runtime/host_tensor.hpp"
|
||||
#include "ngraph/runtime/tensor.hpp"
|
||||
#include "ngraph/type/element_type_traits.hpp"
|
||||
#include "test_tools.hpp"
|
||||
|
||||
namespace ngraph {
|
||||
class TestOpMultiOut : public op::Op {
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "execute_tools.hpp"
|
||||
#include "ngraph/runtime/tensor.hpp"
|
||||
#include "ngraph/type/element_type.hpp"
|
||||
#include "ngraph/util.hpp"
|
||||
|
||||
namespace ngraph {
|
||||
namespace test {
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include <string>
|
||||
#include "openvino/frontend/manager.hpp"
|
||||
|
||||
#include "graph_comparator.hpp"
|
||||
#include "common_test_utils/graph_comparator.hpp"
|
||||
#include "ie_blob.h"
|
||||
#include "ngraph/op/parameter.hpp"
|
||||
#include "ngraph/type/element_type.hpp"
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include <transformations/rt_info/old_api_map_order_attribute.hpp>
|
||||
#include <transformations/rt_info/old_api_map_element_type_attribute.hpp>
|
||||
#include "openvino/frontend/manager.hpp"
|
||||
#include "graph_comparator.hpp"
|
||||
#include "common_test_utils/graph_comparator.hpp"
|
||||
#include "ie_blob.h"
|
||||
#include "ie_precision.hpp"
|
||||
#include "ngraph/node.hpp"
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "openvino/core/preprocess/pre_post_process.hpp"
|
||||
#include "openvino/pass/serialize.hpp"
|
||||
|
||||
#include "graph_comparator.hpp"
|
||||
#include "common_test_utils/graph_comparator.hpp"
|
||||
|
||||
#include "ngraph_functions/utils/ngraph_helpers.hpp"
|
||||
|
||||
|
@ -17,7 +17,6 @@ function(add_common_utils ADD_TARGET_NAME)
|
||||
PUBLIC
|
||||
gtest
|
||||
gtest_main
|
||||
ngraph_test_util
|
||||
ngraphFunctions
|
||||
openvino::runtime
|
||||
openvino::runtime::dev
|
||||
|
@ -23,7 +23,6 @@
|
||||
#include "test_common.hpp"
|
||||
|
||||
#include "graph_comparator.hpp"
|
||||
#include "test_tools.hpp"
|
||||
|
||||
#define DYN ngraph::Dimension::dynamic()
|
||||
|
||||
@ -95,3 +94,15 @@ private:
|
||||
void init_unique_names(std::shared_ptr<ngraph::Function> f, const std::shared_ptr<ngraph::pass::UniqueNamesHolder>& unh);
|
||||
|
||||
void check_unique_names(std::shared_ptr<ngraph::Function> f, const std::shared_ptr<ngraph::pass::UniqueNamesHolder>& unh);
|
||||
|
||||
template <typename T>
|
||||
size_t count_ops_of_type(const std::shared_ptr<ngraph::Function>& f) {
|
||||
size_t count = 0;
|
||||
for (auto op : f->get_ops()) {
|
||||
if (ngraph::is_type<T>(op)) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
@ -16,18 +16,6 @@
|
||||
#include "gtest/gtest.h"
|
||||
#include "ngraph/function.hpp"
|
||||
|
||||
template <typename T>
|
||||
size_t count_ops_of_type(const std::shared_ptr<ngraph::Function>& f) {
|
||||
size_t count = 0;
|
||||
for (auto op : f->get_ops()) {
|
||||
if (ngraph::is_type<T>(op)) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
/// \brief Reads a binary file to a vector.
|
||||
///
|
||||
/// \param[in] path The path where the file is located.
|
||||
|
Loading…
Reference in New Issue
Block a user