virtual size_t layerCount() const noexcept = 0;
/**
- * @deprecated Migrate to IR v10 and work with ngraph::Function directly. The method will be removed in 2021.1
- * @brief Insert a layer into the network. A user is responsible to connect it to other data elements.
- *
- * @param layer Const reference to a layer smart pointer
- */
- INFERENCE_ENGINE_DEPRECATED("Migrate to IR v10 and work with ngraph::Function directly. The method will be removed in 2021.1")
- virtual void addLayer(const CNNLayerPtr& layer) noexcept = 0;
-
- /**
* @brief Adds output to the layer
*
* @param layerName Name of the layer
namespace details {
-IE_SUPPRESS_DEPRECATED_START
-
/**
* @brief Ngraph-based implementation of the ICNNNetwork interface.
*/
std::shared_ptr<ICNNNetwork> getCNNNetwork();
- // This method is not really implemented; don't call it
- INFERENCE_ENGINE_DEPRECATED("Use ngraph::Function directly")
- void addLayer(const CNNLayerPtr& layer) noexcept override;
+ void addLayer(const CNNLayerPtr& layer) noexcept;
// public version
StatusCode setBatchSize(size_t size, ResponseDesc* responseDesc) noexcept override;
}
};
+IE_SUPPRESS_DEPRECATED_START
+
/**
* @brief Special derived class of Data which converts CNNNetworkNGraphImpl to CNNLayer-based representation
* in case if a user called Data::getCreatorLayer or Data::getInputTo
IE_SUPPRESS_DEPRECATED_END
-typedef std::shared_ptr<CNNNetworkNGraphImpl> CNNNetworkNGraphImplPtr;
} // namespace details
} // namespace InferenceEngine
} // namespace ShapeInfer
namespace details {
-IE_SUPPRESS_DEPRECATED_START
-
class INFERENCE_ENGINE_API_CLASS(CNNNetworkImpl): public ICNNNetwork {
public:
CNNNetworkImpl();
return getData(name.c_str());
}
- void addLayer(const CNNLayerPtr& layer) noexcept override;
+ void addLayer(const CNNLayerPtr& layer) noexcept;
void removeLayer(const std::string& layerName);
ShapeInfer::ReshaperPtr _reshaper;
};
-IE_SUPPRESS_DEPRECATED_END
-
typedef std::shared_ptr<CNNNetworkImpl> CNNNetworkImplPtr;
} // namespace details
} // namespace InferenceEngine
#include "blob_factory.hpp"
#include "details/ie_cnn_network_tools.h"
+#include "cnn_network_impl.hpp"
+#include "cnn_network_ngraph_impl.hpp"
#include "graph_tools.hpp"
#include "ie_layers_internal.hpp"
#include "ie_memcpy.h"
}
bool unrollTI(CNNLayerPtr cur, ICNNNetwork& net) {
+ auto inet = dynamic_cast<details::CNNNetworkImpl*>(&net);
+ auto ngraphnet = dynamic_cast<details::CNNNetworkNGraphImpl*>(&net);
+ IE_ASSERT(inet != nullptr || ngraphnet != nullptr);
+
if (cur->type != "TensorIterator") return true;
auto ti = std::dynamic_pointer_cast<TensorIterator>(cur);
auto holder = body_list[i].inputs.back();
if (holder->getPrecision() == Precision::UNSPECIFIED) {
- IE_SUPPRESS_DEPRECATED_START
- for (auto kvp : holder->getInputTo()) net.addLayer(kvp.second);
- IE_SUPPRESS_DEPRECATED_END
+ for (auto kvp : holder->getInputTo()) {
+ if (inet) inet->addLayer(kvp.second);
+ else ngraphnet->addLayer(kvp.second);
+ }
}
}
}
void restore_net_consistency(ICNNNetwork& net) {
+ auto inet = dynamic_cast<details::CNNNetworkImpl*>(&net);
+ auto ngraphnet = dynamic_cast<details::CNNNetworkNGraphImpl*>(&net);
+ IE_ASSERT(inet != nullptr || ngraphnet != nullptr);
// At first all layers should be available via findByName() api.
// In other words all layers should be present in internal map<name, layer>
IE_SUPPRESS_DEPRECATED_START
- for (auto& l : TopolSort(net)) net.addLayer(l);
+ for (auto& l : TopolSort(net)) {
+ if (inet) inet->addLayer(l);
+ else ngraphnet->addLayer(l);
+ }
IE_SUPPRESS_DEPRECATED_END
}
outData->getInputTo().clear();
}
- IE_SUPPRESS_DEPRECATED_START
- context.network.addLayer(target);
- IE_SUPPRESS_DEPRECATED_END
+ networkImpl->addLayer(target);
}
CNNLayerPtr CNNNetworkHelper::addScaleShiftBetween(TransformationContext& context, const CNNLayerPtr parent,
}
}
-IE_SUPPRESS_DEPRECATED_START
-
INFERENCE_PLUGIN_API(StatusCode) CreatePluginEngine(IInferencePlugin*& plugin, ResponseDesc *resp) noexcept {
try {
plugin = make_ie_compatible_plugin(
return DescriptionBuffer(GENERAL_ERROR, resp) << ex.what();
}
}
-
-IE_SUPPRESS_DEPRECATED_END
}
}
-IE_SUPPRESS_DEPRECATED_START
-
INFERENCE_PLUGIN_API(InferenceEngine::StatusCode) CreatePluginEngine(
InferenceEngine::IInferencePlugin *&plugin,
InferenceEngine::ResponseDesc *resp) noexcept {
}
}
-IE_SUPPRESS_DEPRECATED_END
-
MultiDeviceInferencePlugin::MultiDeviceInferencePlugin() {
_pluginName = "MULTI";
}
* @ingroup ie_dev_api_exec_network_api
* @tparam T Minimal CPP implementation of IExecutableNetworkInternal (e.g. ExecutableNetworkInternal)
*/
-IE_SUPPRESS_DEPRECATED_START_WIN
template <class T>
class ExecutableNetworkBase : public IExecutableNetwork {
std::shared_ptr<T> _impl;
~ExecutableNetworkBase() = default;
};
-IE_SUPPRESS_DEPRECATED_END_WIN
-
template <class T>
inline typename ExecutableNetworkBase<T>::Ptr make_executable_network(std::shared_ptr<T> impl) {
typename ExecutableNetworkBase<T>::Ptr net(new ExecutableNetworkBase<T>(impl), [](IExecutableNetwork* p) {
namespace InferenceEngine {
-IE_SUPPRESS_DEPRECATED_START
-
/**
* @brief Plugin `noexcept` wrapper which accepts IInferencePluginInternal derived instance which can throw exceptions
* @ingroup ie_dev_api_plugin_api
*/
template <class T>
class PluginBase : public IInferencePluginAPI, public IInferencePlugin {
- IE_SUPPRESS_DEPRECATED_END
-
class VersionStore : public Version {
std::string _dsc;
std::string _buildNumber;
~PluginBase() override {}
};
-IE_SUPPRESS_DEPRECATED_START
-
template <class T>
inline IInferencePlugin* make_ie_compatible_plugin(const Version& reported, std::shared_ptr<T> impl) {
return new PluginBase<T>(reported, impl);
}
-IE_SUPPRESS_DEPRECATED_END
-
} // namespace InferenceEngine
inputs[MockNotEmptyICNNNetwork::INPUT_BLOB_NAME] = inputInfo;
};
- void addLayer(const CNNLayerPtr& layer) noexcept override {}
std::shared_ptr<ngraph::Function> getFunction() noexcept override {
return nullptr;
}