Updates on deprecated stuff (#5838)
* Removed cloneFunction from ngraph CNNNetwork impl * Removed custom clone * Localize deprecation suppressions * Removed Jira tickets * Fixed MYRIAD tests compilation on Windows
This commit is contained in:
parent
d2f7812dbd
commit
12f2bb72da
@ -41,18 +41,6 @@ using details::CNNNetworkNGraphImpl;
|
||||
using InferenceEngine::details::CNNNetworkNGraphImpl;
|
||||
using ngraph::Function;
|
||||
|
||||
static std::shared_ptr<ngraph::Function> copyFunction(const std::shared_ptr<const ngraph::Function>& func,
|
||||
bool constFolding) {
|
||||
OV_ITT_SCOPED_TASK(itt::domains::IE, "copyFunction");
|
||||
|
||||
auto specialized_function = ngraph::clone_function(*func);
|
||||
|
||||
if (constFolding) {
|
||||
ngraph::pass::ConstantFolding().run_on_function(specialized_function);
|
||||
}
|
||||
return specialized_function;
|
||||
}
|
||||
|
||||
void CNNNetworkNGraphImpl::createDataForResult(const ::ngraph::Output<::ngraph::Node>& output, const std::string& outName,
|
||||
DataPtr& ptr) {
|
||||
const auto isCompatible = [](size_t size, const Layout& l) -> bool {
|
||||
@ -172,7 +160,7 @@ CNNNetworkNGraphImpl::CNNNetworkNGraphImpl(const CNNNetwork& network) {
|
||||
IE_THROW() << "Cannot create CNNNetwork with nGraph from legacy network format!";
|
||||
}
|
||||
|
||||
_ngraph_function = copyFunction(network.getFunction(), false);
|
||||
_ngraph_function = ngraph::clone_function(*network.getFunction());
|
||||
validateFunctionNames();
|
||||
InputsDataMap inputs = network.getInputsInfo();
|
||||
OutputsDataMap outputs = network.getOutputsInfo();
|
||||
@ -314,10 +302,6 @@ size_t CNNNetworkNGraphImpl::getBatchSize() const noexcept {
|
||||
return 1;
|
||||
}
|
||||
|
||||
std::shared_ptr<ngraph::Function> CNNNetworkNGraphImpl::cloneFunction(bool constFolding) const {
|
||||
return copyFunction(_ngraph_function, constFolding);
|
||||
}
|
||||
|
||||
void CNNNetworkNGraphImpl::reshape() {
|
||||
reshape({});
|
||||
}
|
||||
@ -398,7 +382,7 @@ CNNNetworkNGraphImpl::reshape(const std::map<std::string, ngraph::PartialShape>&
|
||||
if (outputs_are_static) {
|
||||
specialized_ngraph_function = _ngraph_function;
|
||||
} else {
|
||||
specialized_ngraph_function = cloneFunction(false);
|
||||
specialized_ngraph_function = ngraph::clone_function(*_ngraph_function);
|
||||
{
|
||||
OV_ITT_SCOPED_TASK(itt::domains::IE, "CNNNetworkNGraphImpl::ConvertToLegacy");
|
||||
::ngraph::pass::Manager manager;
|
||||
|
@ -3,7 +3,7 @@
|
||||
//
|
||||
|
||||
/**
|
||||
* @brief A file containing ngraph implementation of public ICNNNetwork interface
|
||||
* @brief A file containing ngraph implementation of public CNNNetwork wrapper
|
||||
* @file cnn_network_ngraph_impl.hpp
|
||||
*/
|
||||
|
||||
@ -36,7 +36,7 @@ namespace details {
|
||||
IE_SUPPRESS_DEPRECATED_START
|
||||
|
||||
/**
|
||||
* @brief Ngraph-based implementation of the ICNNNetwork interface.
|
||||
* @brief Ngraph-based implementation of the CNNNetwork.
|
||||
*/
|
||||
class INFERENCE_ENGINE_API_CLASS(CNNNetworkNGraphImpl) final : public ICNNNetwork {
|
||||
public:
|
||||
@ -84,7 +84,6 @@ public:
|
||||
// used by convertFunctionToICNNNetwork from legacy library
|
||||
std::map<std::string, DataPtr> _data;
|
||||
protected:
|
||||
virtual std::shared_ptr<::ngraph::Function> cloneFunction(bool constFolding = false) const;
|
||||
std::shared_ptr<::ngraph::Function> _ngraph_function;
|
||||
|
||||
private:
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "caseless.hpp"
|
||||
#include "precision_utils.h"
|
||||
#include "cnn_network_ngraph_impl.hpp"
|
||||
#include "ie_ngraph_utils.hpp"
|
||||
|
||||
#include "legacy/ie_util_internal.hpp"
|
||||
#include "legacy/cnn_network_impl.hpp"
|
||||
@ -150,26 +151,18 @@ CNNLayerPtr clonelayer(const CNNLayer& source) {
|
||||
CNNNetwork cloneNetwork(const CNNNetwork& network) {
|
||||
OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::IELegacy_LT, "cloneNetwork");
|
||||
|
||||
IE_SUPPRESS_DEPRECATED_START
|
||||
if (network.getFunction()) {
|
||||
return CNNNetwork(std::make_shared<details::CNNNetworkNGraphImpl>(network));
|
||||
return InferenceEngine::details::cloneNetwork(network);
|
||||
}
|
||||
|
||||
return CNNNetwork(cloneNet(network));
|
||||
IE_SUPPRESS_DEPRECATED_START
|
||||
return CNNNetwork(InferenceEngine::cloneNet(network));
|
||||
IE_SUPPRESS_DEPRECATED_END
|
||||
}
|
||||
|
||||
details::CNNNetworkImplPtr cloneNet(const CNNNetwork& origin_network) {
|
||||
details::CNNNetworkImplPtr cloneNet(const CNNNetwork& network) {
|
||||
OV_ITT_SCOPED_TASK(itt::domains::IELegacy, "cloneNet(CNNNetwork)");
|
||||
IE_SUPPRESS_DEPRECATED_START
|
||||
std::shared_ptr<ICNNNetwork> clonedNetwork;
|
||||
// Call conversion only on the copy of nGraph function
|
||||
if (origin_network.getFunction()) {
|
||||
// Copy and call conversion
|
||||
clonedNetwork = std::make_shared<InferenceEngine::details::CNNNetworkImpl>(cloneNetwork(origin_network));
|
||||
}
|
||||
const CNNNetwork network = clonedNetwork ? CNNNetwork(clonedNetwork) : origin_network;
|
||||
IE_SUPPRESS_DEPRECATED_END
|
||||
IE_ASSERT(network.getFunction() == nullptr);
|
||||
|
||||
std::vector<CNNLayerPtr> layers;
|
||||
details::CNNNetworkIterator i(network);
|
||||
|
@ -400,7 +400,9 @@ class StageNode :
|
||||
// Bindings with IE
|
||||
//
|
||||
|
||||
IE_SUPPRESS_DEPRECATED_START
|
||||
VPU_MODEL_ATTRIBUTE(ie::CNNLayerPtr, origLayer, nullptr)
|
||||
IE_SUPPRESS_DEPRECATED_END
|
||||
|
||||
//
|
||||
// Edges
|
||||
@ -573,7 +575,9 @@ public:
|
||||
//
|
||||
|
||||
inline std::string origLayerName() const {
|
||||
IE_SUPPRESS_DEPRECATED_START
|
||||
return _origLayer != nullptr ? _origLayer->name : std::string();
|
||||
IE_SUPPRESS_DEPRECATED_END
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -14,6 +14,8 @@
|
||||
|
||||
namespace vpu {
|
||||
|
||||
IE_SUPPRESS_DEPRECATED_START
|
||||
|
||||
class StageBuilder final {
|
||||
public:
|
||||
using Ptr = std::shared_ptr<StageBuilder>;
|
||||
@ -359,4 +361,6 @@ public:
|
||||
int32_t blankIndex);
|
||||
};
|
||||
|
||||
IE_SUPPRESS_DEPRECATED_END
|
||||
|
||||
} // namespace vpu
|
||||
|
@ -4,8 +4,6 @@
|
||||
|
||||
set(TARGET_NAME myriadFuncTests)
|
||||
|
||||
disable_deprecated_warnings()
|
||||
|
||||
addIeTargetTest(
|
||||
NAME ${TARGET_NAME}
|
||||
ROOT ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
|
@ -36,15 +36,19 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
IE_SUPPRESS_DEPRECATED_START
|
||||
InferenceEngine::CNNLayerPtr getDynamicShapeResolverLayer() const {
|
||||
return CommonTestUtils::getLayerByName(cnnNetwork, s_FriendlyName);
|
||||
}
|
||||
IE_SUPPRESS_DEPRECATED_END
|
||||
InferenceEngine::CNNNetwork cnnNetwork;
|
||||
|
||||
private:
|
||||
void triggerConversionToCNNNetwork() {
|
||||
IE_SUPPRESS_DEPRECATED_START
|
||||
cnnNetwork = InferenceEngine::CNNNetwork(
|
||||
std::make_shared<InferenceEngine::details::CNNNetworkImpl>(cnnNetwork));
|
||||
IE_SUPPRESS_DEPRECATED_END
|
||||
}
|
||||
|
||||
static const char s_FriendlyName[];
|
||||
@ -57,10 +61,12 @@ TEST_F(DynamicShapeResolverTests, smoke_NGraphFunctionCanBeConvertedToCNNNetwork
|
||||
ASSERT_EQ(cnnNetwork.layerCount(), cnnNetwork.getInputsInfo().size() + 1);
|
||||
ASSERT_EQ(cnnNetwork.getOutputsInfo().size(), 1);
|
||||
|
||||
IE_SUPPRESS_DEPRECATED_START
|
||||
const auto dynamicShapeResolver = getDynamicShapeResolverLayer();
|
||||
ASSERT_EQ(dynamicShapeResolver->type, "DynamicShapeResolver");
|
||||
ASSERT_EQ(dynamicShapeResolver->insData.size(), 2);
|
||||
ASSERT_EQ(dynamicShapeResolver->outData.size(), 1);
|
||||
IE_SUPPRESS_DEPRECATED_END
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
@ -7,6 +7,8 @@
|
||||
#include "vpu/private_plugin_config.hpp"
|
||||
#include "behavior/config.hpp"
|
||||
|
||||
IE_SUPPRESS_DEPRECATED_START
|
||||
|
||||
using namespace BehaviorTestsDefinitions;
|
||||
namespace {
|
||||
const std::vector<InferenceEngine::Precision> netPrecisions = {
|
||||
|
@ -9,6 +9,8 @@
|
||||
#include "vpu/private_plugin_config.hpp"
|
||||
#include "vpu/myriad_config.hpp"
|
||||
|
||||
IE_SUPPRESS_DEPRECATED_START
|
||||
|
||||
using namespace BehaviorTestsDefinitions;
|
||||
namespace {
|
||||
const std::vector<InferenceEngine::Precision> netPrecisions = {
|
||||
|
@ -24,8 +24,6 @@ public:
|
||||
class LayerTransformationParamsFactory : public LayerTransformationParamsNGraphFactory {
|
||||
};
|
||||
|
||||
IE_SUPPRESS_DEPRECATED_START
|
||||
|
||||
class LayerTransformation : virtual public LayerTestsUtils::LayerTestsCommon {
|
||||
protected:
|
||||
LayerTransformation();
|
||||
@ -64,8 +62,6 @@ protected:
|
||||
const ngraph::pass::low_precision::LayerTransformation::Params& params);
|
||||
};
|
||||
|
||||
IE_SUPPRESS_DEPRECATED_END
|
||||
|
||||
typedef std::tuple<
|
||||
InferenceEngine::Precision,
|
||||
InferenceEngine::SizeVector,
|
||||
|
@ -4,8 +4,6 @@
|
||||
|
||||
set(TARGET_NAME vpuUnitTests)
|
||||
|
||||
disable_deprecated_warnings()
|
||||
|
||||
include(${XLINK_DIR}/XLink.cmake)
|
||||
|
||||
addIeTargetTest(
|
||||
|
@ -10,6 +10,8 @@
|
||||
#include "ngraph/ngraph.hpp"
|
||||
#include "ngraph/opsets/opset3.hpp"
|
||||
|
||||
IE_SUPPRESS_DEPRECATED_START
|
||||
|
||||
namespace vpu {
|
||||
|
||||
namespace ie = InferenceEngine;
|
||||
|
@ -8,6 +8,8 @@
|
||||
|
||||
using namespace vpu;
|
||||
|
||||
IE_SUPPRESS_DEPRECATED_START
|
||||
|
||||
class VPU_SplitLargeKernelConvTest : public GraphTransformerTest {
|
||||
protected:
|
||||
PassSet pipeline;
|
||||
|
@ -4,8 +4,6 @@
|
||||
|
||||
add_subdirectory(shared_tests)
|
||||
|
||||
disable_deprecated_warnings()
|
||||
|
||||
if (ENABLE_HDDL OR ENABLE_MYRIAD)
|
||||
add_subdirectory(vpu)
|
||||
endif()
|
||||
|
@ -4,8 +4,6 @@
|
||||
|
||||
set(TARGET_NAME IEBehaviorSharedTests)
|
||||
|
||||
disable_deprecated_warnings()
|
||||
|
||||
file(GLOB_RECURSE SHARED_TESTS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/*.hpp)
|
||||
|
||||
|
@ -2,8 +2,9 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
function(enable_vpu TARGET_NAME FLAG_NAME PLUGIN_NAME)
|
||||
disable_deprecated_warnings()
|
||||
|
||||
function(enable_vpu TARGET_NAME FLAG_NAME PLUGIN_NAME)
|
||||
# Common tests for HDDL MYRIAD KMB
|
||||
file(GLOB_RECURSE TEST_INCLUDE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/shared_tests_instances/*.hpp)
|
||||
|
@ -2,10 +2,10 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
add_subdirectory(shared_tests)
|
||||
|
||||
disable_deprecated_warnings()
|
||||
|
||||
add_subdirectory(shared_tests)
|
||||
|
||||
if (ENABLE_MYRIAD)
|
||||
add_subdirectory(vpu)
|
||||
endif()
|
||||
|
@ -4,8 +4,6 @@
|
||||
|
||||
set(TARGET_NAME IESharedTests)
|
||||
|
||||
disable_deprecated_warnings()
|
||||
|
||||
list(APPEND SHARED_LIBRARIES
|
||||
${NGRAPH_LIBRARIES}
|
||||
commonTestUtils
|
||||
|
@ -2,8 +2,6 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
disable_deprecated_warnings()
|
||||
|
||||
function(add_perfcheck_target TARGET_NAME PLUGIN_NAME)
|
||||
file(GLOB SOURCES *.cpp)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user