38 class INFERENCE_ENGINE_API_CLASS(CNNNetwork) {
50 explicit CNNNetwork(std::shared_ptr<ICNNNetwork> network): network(network) {
51 actual = network.get();
59 explicit CNNNetwork(
const std::shared_ptr<const ngraph::Function>& network);
66 IE_SUPPRESS_DEPRECATED_START
68 if (reader ==
nullptr) {
71 if ((actual = reader->getNetwork(
nullptr)) ==
nullptr) {
75 IE_SUPPRESS_DEPRECATED_END
90 INFERENCE_ENGINE_DEPRECATED(
"Network precision does not make sence, use precision on egdes. The method will be removed in 2021.1")
103 actual->getOutputsInfo(outputs);
117 actual->getInputsInfo(inputs);
130 return actual->layerCount();
142 return actual->getName();
154 CALL_STATUS_FNC(setBatchSize, size);
166 return actual->getBatchSize();
205 return actual->getFunction();
215 return actual->getFunction();
226 void addOutput(
const std::string& layerName,
size_t outputIndex = 0) {
227 CALL_STATUS_FNC(addOutput, layerName, outputIndex);
239 INFERENCE_ENGINE_DEPRECATED(
"Migrate to IR v10 and work with ngraph::Function directly. The method will be removed in 2021.1")
240 CNNLayerPtr getLayerByName(
const char* layerName)
const;
251 IE_SUPPRESS_DEPRECATED_START
252 INFERENCE_ENGINE_DEPRECATED(
"Use CNNNetwork::getFunction() and work with ngraph::Function directly. The method will be removed in 2021.1")
253 details::CNNNetworkIterator begin()
const;
260 INFERENCE_ENGINE_DEPRECATED(
"Use CNNNetwork::getFunction() and work with ngraph::Function directly. The method will be removed in 2021.1")
261 details::CNNNetworkIterator end()
const;
262 IE_SUPPRESS_DEPRECATED_END
270 INFERENCE_ENGINE_DEPRECATED(
"Use CNNNetwork::layerCount() instead. The method will be removed in 2021.1")
279 INFERENCE_ENGINE_DEPRECATED(
"Use Core::AddExtension to add an extension to the library")
291 actual->getInputsInfo(inputs);
292 for (
const auto& pair : inputs) {
293 auto info = pair.second;
295 auto data = info->getInputData();
297 shapes[data->getName()] = data->getTensorDesc().getDims();
310 CALL_STATUS_FNC(reshape, inputShapes);
320 void serialize(
const std::string& xmlPath,
const std::string& binPath =
"")
const {
321 CALL_STATUS_FNC(serialize, xmlPath, binPath);
328 IE_SUPPRESS_DEPRECATED_START
330 IE_SUPPRESS_DEPRECATED_END
#define THROW_IE_EXCEPTION
A macro used to throw the exception with a notable description.
Definition: ie_exception.hpp:25
virtual ~CNNNetwork()
A destructor.
Definition: ie_cnn_network.h:80
CNNNetwork(std::shared_ptr< ICNNNetwork > network)
Allows helper class to manage lifetime of network object.
Definition: ie_cnn_network.h:50
std::shared_ptr< IShapeInferExtension > IShapeInferExtensionPtr
A shared pointer to a IShapeInferExtension interface.
Definition: ie_iextension.h:366
Definition: cldnn_config.hpp:16
std::shared_ptr< CNNLayer > CNNLayerPtr
A smart pointer to the CNNLayer.
Definition: ie_common.h:39
A header file that provides macros to handle no exception methods.
virtual ICNNNetwork::InputShapes getInputShapes() const
Helper method to get collect all input shapes with names of corresponding Data objects.
Definition: ie_cnn_network.h:287
virtual InputsDataMap getInputsInfo() const
Definition: ie_cnn_network.h:114
void addOutput(const std::string &layerName, size_t outputIndex=0)
Definition: ie_cnn_network.h:226
A header file for Blob and generic TBlob<>
A header file for the CNNNetworkIterator class.
This is a header file for the ICNNNetwork class.
InferenceEngine::details::SOPointer< ICNNNetReader, InferenceEngine::details::SharedObjectLoader > CNNNetReaderPtr
A C++ helper to work with objects created by the IR readers plugin. Implements different interfaces...
Definition: ie_icnn_net_reader.h:154
virtual void reshape(const ICNNNetwork::InputShapes &inputShapes)
Run shape inference with new input shapes for the network.
Definition: ie_cnn_network.h:309
size_t layerCount() const
Definition: ie_cnn_network.h:128
std::shared_ptr< ICNNNetwork > Ptr
A shared pointer to a ICNNNetwork interface.
Definition: ie_icnn_network.hpp:48
std::shared_ptr< ngraph::Function > getFunction()
Returns constant nGraph function.
Definition: ie_cnn_network.h:203
virtual size_t getBatchSize() const
Definition: ie_cnn_network.h:164
This is the main interface to describe the NN topology.
Definition: ie_icnn_network.hpp:43
Definition: ie_cnn_network.h:27
void serialize(const std::string &xmlPath, const std::string &binPath="") const
Serialize network to IR and weights files.
Definition: ie_cnn_network.h:320
virtual OutputsDataMap getOutputsInfo() const
Definition: ie_cnn_network.h:100
This class contains all the information about the Neural Network and the related binary information...
Definition: ie_cnn_network.h:38
This header file defines the main Data representation node.
std::shared_ptr< ICNNNetwork > network
Network extra interface, might be nullptr.
Definition: ie_cnn_network.h:334
virtual void setBatchSize(const size_t size)
Definition: ie_cnn_network.h:153
DataPtr output
A pointer to output data.
Definition: ie_cnn_network.h:343
A header file that provides interface for network reader that is used to build networks from a given ...
std::shared_ptr< const ngraph::Function > getFunction() const
Returns constant nGraph function.
Definition: ie_cnn_network.h:213
std::shared_ptr< Data > DataPtr
Smart pointer to Data.
Definition: ie_common.h:53
const std::string & getName() const
Definition: ie_cnn_network.h:140
std::map< std::string, DataPtr > OutputsDataMap
A collection that contains string as key, and Data smart pointer as value.
Definition: ie_icnn_network.hpp:37
std::map< std::string, SizeVector > InputShapes
Map of pairs: name of corresponding data and its dimension.
Definition: ie_icnn_network.hpp:206
CNNNetwork(CNNNetReaderPtr reader_)
A constructor from ICNNNetReader object.
Definition: ie_cnn_network.h:67
CNNNetReaderPtr reader
Reader extra reference, might be nullptr.
Definition: ie_cnn_network.h:329
This is a header file with common inference engine definitions.
This class holds precision value and provides precision related operations.
Definition: ie_precision.hpp:22