Deprecated cnn layer (#1138)

* Deprecated getInputTo, getCreatorLayer

* Fixes

* Fixed ie_layers moving to legacy

* Fixed onnx importer dependency

* Fixed python

* Fix python API compilation

* Added comments not to use _impl from Data

Co-authored-by: Nadezhda Ageeva <nadezhda.ageeva@intel.com>
This commit is contained in:
Ilya Lavrenov
2020-07-03 20:57:28 +03:00
committed by GitHub
parent 6365fcb6f5
commit 4f0225014d
100 changed files with 641 additions and 573 deletions

View File

@@ -9,8 +9,6 @@
*/
#pragma once
#include "details/ie_no_copy.hpp"
#if defined(USE_STATIC_IE) || (defined(__GNUC__) && (__GNUC__ < 4))
# define INFERENCE_ENGINE_API(...) extern "C" __VA_ARGS__
# define INFERENCE_ENGINE_API_CPP(...) __VA_ARGS__
@@ -52,14 +50,6 @@
# define INFERENCE_ENGINE_INTERNAL(msg) INFERENCE_ENGINE_DEPRECATED(msg)
#endif
#if defined IMPLEMENT_INFERENCE_ENGINE_API || defined IMPLEMENT_INFERENCE_ENGINE_PLUGIN
# define INFERENCE_ENGINE_INTERNAL_CNNLAYER_CLASS(...) INFERENCE_ENGINE_API_CLASS(__VA_ARGS__)
#else
# define INFERENCE_ENGINE_INTERNAL_CNNLAYER_CLASS(...) \
INFERENCE_ENGINE_INTERNAL("Migrate to IR v10 and work with ngraph::Function directly. The method will be removed in 2021.1") \
INFERENCE_ENGINE_API_CLASS(__VA_ARGS__)
#endif
// Suppress warning "-Wdeprecated-declarations" / C4996
#if defined(_MSC_VER)
# define IE_DO_PRAGMA(x) __pragma(x)

View File

@@ -28,6 +28,7 @@ namespace InferenceEngine {
*/
class INFERENCE_ENGINE_API_CLASS(Data) {
class Impl;
public:
/**
* @brief An empty constructor (dimensionless)
@@ -46,6 +47,21 @@ public:
*/
Data(const std::string& name, const TensorDesc& desc);
/**
* @brief A copy constructor
*
* @param data A data object to copy from
*/
Data(const Data& data);
/**
* @brief An assignment operator
*
* @param data A data object to copy from
* @return An assigned object
*/
Data & operator = (const Data& data);
/**
* @brief A virtual destructor
*/
@@ -113,14 +129,6 @@ public:
*/
const SizeVector& getDims() const;
/**
* @deprecated Migrate to IR v10 and work with ngraph::Function directly. The method will be removed in 2021.1
* @brief Returns an owner of this data layer, parent layer in di-graph
* @return A weak pointer to CNNLayer that creates this data
*/
INFERENCE_ENGINE_INTERNAL("Migrate to IR v10 and work with ngraph::Function directly")
virtual CNNLayerWeakPtr& getCreatorLayer();
/**
* @return name of the data object
*/
@@ -134,36 +142,23 @@ public:
void setName(const std::string& newName);
/**
* @deprecated Migrate to IR v10 and work with ngraph::Function directly. The method will be removed in 2021.1
* @brief Privates child layers in di-graph
* @return A map of child layers
*/
INFERENCE_ENGINE_INTERNAL("Migrate to IR v10 and work with ngraph::Function directly")
virtual std::map<std::string, CNNLayerPtr>& getInputTo();
/**
* @return convenient arbitrary user data holder
*/
const UserValue& getUserObject() const;
private:
/**
* @brief A pointer to the layer that creates this data element, null for input data elements
* @private
* @brief Don't touch this field. An implementation details for Data object.
*/
CNNLayerWeakPtr creatorLayer;
std::shared_ptr<Impl> _impl;
private:
/**
* @brief A unique name that identifies this data node
*/
std::string name;
/**
* @brief A map of layers that use this node as input.
* It is useful for recursive NN graph traversal.
*/
std::map<std::string, CNNLayerPtr> inputTo;
/**
* @brief A user utility place holder
*/

View File

@@ -19,7 +19,6 @@
#include "ie_data.h"
#include "ie_iextension.h"
#include "ie_input_info.hpp"
#include "ie_layers.h"
#include "ie_preprocess.hpp"
namespace ngraph {

View File

@@ -19,7 +19,6 @@
#include "ie_common.h"
#include "ie_layouts.h"
#include "ie_blob.h"
#include "ie_layers.h"
#include "ie_version.hpp"
/**

File diff suppressed because it is too large Load Diff

View File

@@ -1,138 +0,0 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
/**
* @brief a header file for describing property style structure used by CNNLayers
*
* @file ie_layers_property.hpp
*/
#pragma once
#include <vector>
#include <details/ie_exception.hpp>
namespace InferenceEngine {
constexpr const int MAX_DIMS_NUMBER = 12;
enum eDIMS_AXIS : uint8_t { X_AXIS = 0, Y_AXIS, Z_AXIS };
template <class T, int N = MAX_DIMS_NUMBER>
class PropertyVector {
T _axises[N] = {};
bool _allocated[N] = {};
size_t _length = 0;
public:
PropertyVector() = default;
PropertyVector(size_t len, T val) {
if (len > N) {
THROW_IE_EXCEPTION << "Property size exceeed limit of: " << N;
}
for (size_t i = 0; i < len; i++) {
_axises[i] = val;
_allocated[i] = true;
}
_length = len;
}
explicit PropertyVector(const std::vector<T>& values) {
size_t i = 0;
for (const auto val : values) {
insert(i++, val);
}
}
PropertyVector(std::initializer_list<int> init_list) {
size_t i = 0;
for (const auto val : init_list) {
insert(i++, val);
}
}
/**
* @brief allows access up-to capacity size
*
* @param index
* @return
*/
T& at(int index) {
if (index >= N) {
THROW_IE_EXCEPTION << "Property index is out of bounds (" << index << "/" << N;
}
return _axises[index];
}
const T& operator[](size_t index) const {
if (index >= N || !_allocated[index]) {
THROW_IE_EXCEPTION << "Property index (" << index << ") is out of bounds";
}
return _axises[index];
}
T& operator[](size_t index) {
if (index >= N || !_allocated[index]) {
THROW_IE_EXCEPTION << "Property index (" << index << ") is out of bounds";
}
return _axises[index];
}
PropertyVector& operator=(const PropertyVector& src) {
if (this != &src) {
_length = src.size();
for (size_t i = 0; i < N; i++) {
_allocated[i] = src._allocated[i];
if (_allocated[i]) {
_axises[i] = src[i];
}
}
}
return *this;
}
bool operator==(const PropertyVector& src) const {
if (this == &src) return true;
if (_length != src.size()) return false;
for (size_t i = 0; i < N; i++)
if ((_allocated[i] != src._allocated[i]) || (_allocated[i] && _axises[i] != src._axises[i])) return false;
return true;
}
size_t size() const {
return _length;
}
void insert(size_t axis, const T& val) {
if (axis < N) {
if (!_allocated[axis]) {
_allocated[axis] = true;
_length++;
}
_axises[axis] = val;
} else {
THROW_IE_EXCEPTION << "Layer Property insertion at(axis) should be in [0," << N << ")";
}
}
void remove(size_t axis) {
if (axis < N && _allocated[axis]) {
_allocated[axis] = false;
_length--;
}
}
void clear() {
for (int i = 0; i != N; i++) {
_allocated[i] = 0;
}
_length = 0u;
}
bool exist(size_t axis) const {
return (axis < N && _allocated[axis]);
}
};
} // namespace InferenceEngine

View File

@@ -10,7 +10,6 @@
#include <ie_api.h>
#include <ie_blob.h>
#include <ie_layers.h>
#include <cpp/ie_executable_network.hpp>
#include <ie_core.hpp>
#include <ie_icnn_network.hpp>