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:
Ilya Lavrenov 2021-05-27 16:14:07 +03:00 committed by GitHub
parent d2f7812dbd
commit 12f2bb72da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 36 additions and 53 deletions

View File

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

View File

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

View File

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

View File

@ -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
}
//

View File

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

View File

@ -4,8 +4,6 @@
set(TARGET_NAME myriadFuncTests)
disable_deprecated_warnings()
addIeTargetTest(
NAME ${TARGET_NAME}
ROOT ${CMAKE_CURRENT_SOURCE_DIR}

View File

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

View File

@ -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 = {

View File

@ -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 = {

View File

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

View File

@ -4,8 +4,6 @@
set(TARGET_NAME vpuUnitTests)
disable_deprecated_warnings()
include(${XLINK_DIR}/XLink.cmake)
addIeTargetTest(

View File

@ -10,6 +10,8 @@
#include "ngraph/ngraph.hpp"
#include "ngraph/opsets/opset3.hpp"
IE_SUPPRESS_DEPRECATED_START
namespace vpu {
namespace ie = InferenceEngine;

View File

@ -8,6 +8,8 @@
using namespace vpu;
IE_SUPPRESS_DEPRECATED_START
class VPU_SplitLargeKernelConvTest : public GraphTransformerTest {
protected:
PassSet pipeline;

View File

@ -4,8 +4,6 @@
add_subdirectory(shared_tests)
disable_deprecated_warnings()
if (ENABLE_HDDL OR ENABLE_MYRIAD)
add_subdirectory(vpu)
endif()

View File

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

View File

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

View File

@ -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()

View File

@ -4,8 +4,6 @@
set(TARGET_NAME IESharedTests)
disable_deprecated_warnings()
list(APPEND SHARED_LIBRARIES
${NGRAPH_LIBRARIES}
commonTestUtils

View File

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