38 class INFERENCE_ENGINE_API_CLASS(CNNNetwork) {
50 explicit CNNNetwork(std::shared_ptr<ICNNNetwork> network): network(network) {
51 actual = network.get();
52 if (actual ==
nullptr) {
61 explicit CNNNetwork(
const std::shared_ptr<const ngraph::Function>& network);
68 IE_SUPPRESS_DEPRECATED_START
69 explicit CNNNetwork(std::shared_ptr<ICNNNetReader> reader): reader(reader), actual(reader->getNetwork(nullptr)) {
70 if (actual ==
nullptr) {
74 IE_SUPPRESS_DEPRECATED_END
89 INFERENCE_ENGINE_DEPRECATED(
"Network precision does not make sence, use precision on egdes. The method will be removed in 2021.1")
101 actual->getOutputsInfo(outputs);
114 actual->getInputsInfo(inputs);
126 return actual->layerCount();
137 return actual->getName();
149 CALL_STATUS_FNC(setBatchSize, size);
160 return actual->getBatchSize();
186 std::shared_ptr<const ngraph::Function>
getFunction() const noexcept {
187 return actual->getFunction();
198 void addOutput(
const std::string& layerName,
size_t outputIndex = 0) {
199 CALL_STATUS_FNC(addOutput, layerName, outputIndex);
211 INFERENCE_ENGINE_DEPRECATED(
"Migrate to IR v10 and work with ngraph::Function directly. The method will be removed in 2021.1")
212 CNNLayerPtr getLayerByName(
const char* layerName)
const;
223 IE_SUPPRESS_DEPRECATED_START
224 INFERENCE_ENGINE_DEPRECATED(
"Use CNNNetwork::getFunction() and work with ngraph::Function directly. The method will be removed in 2021.1")
225 details::CNNNetworkIterator begin()
const;
232 INFERENCE_ENGINE_DEPRECATED(
"Use CNNNetwork::getFunction() and work with ngraph::Function directly. The method will be removed in 2021.1")
233 details::CNNNetworkIterator end()
const;
234 IE_SUPPRESS_DEPRECATED_END
242 INFERENCE_ENGINE_DEPRECATED(
"Use CNNNetwork::layerCount() instead. The method will be removed in 2021.1")
251 INFERENCE_ENGINE_DEPRECATED(
"Use Core::AddExtension to add an extension to the library")
262 actual->getInputsInfo(inputs);
263 for (
const auto& pair : inputs) {
264 auto info = pair.second;
266 auto data = info->getInputData();
268 shapes[data->getName()] = data->getTensorDesc().getDims();
281 CALL_STATUS_FNC(reshape, inputShapes);
291 void serialize(
const std::string& xmlPath,
const std::string& binPath =
"")
const {
292 CALL_STATUS_FNC(serialize, xmlPath, binPath);
299 IE_SUPPRESS_DEPRECATED_START
301 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:79
CNNNetwork(std::shared_ptr< ICNNNetwork > network)
Allows helper class to manage lifetime of network object.
Definition: ie_cnn_network.h:50
Inference Engine API.
Definition: ie_argmax_layer.hpp:15
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:259
const std::string & getName() const noexcept
Definition: ie_cnn_network.h:136
std::shared_ptr< IShapeInferExtension > IShapeInferExtensionPtr
A shared pointer to a IShapeInferExtension interface.
Definition: ie_iextension.h:366
virtual InputsDataMap getInputsInfo() const
Definition: ie_cnn_network.h:112
void addOutput(const std::string &layerName, size_t outputIndex=0)
Definition: ie_cnn_network.h:198
A header file for Blob and generic TBlob<>
A header file for the CNNNetworkIterator class.
This is a header file for the ICNNNetwork class.
virtual void reshape(const ICNNNetwork::InputShapes &inputShapes)
Run shape inference with new input shapes for the network.
Definition: ie_cnn_network.h:280
size_t layerCount() const
Definition: ie_cnn_network.h:125
virtual size_t getBatchSize() const
Definition: ie_cnn_network.h:159
std::shared_ptr< Data > DataPtr
Smart pointer to Data.
Definition: ie_common.h:53
std::shared_ptr< ICNNNetReader > reader
Reader extra reference, might be nullptr.
Definition: ie_cnn_network.h:300
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:291
CNNNetwork(std::shared_ptr< ICNNNetReader > reader)
A constructor from ICNNNetReader object.
Definition: ie_cnn_network.h:69
virtual OutputsDataMap getOutputsInfo() const
Definition: ie_cnn_network.h:99
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:305
std::shared_ptr< CNNLayer > CNNLayerPtr
A smart pointer to the CNNLayer.
Definition: ie_common.h:39
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
virtual void setBatchSize(const size_t size)
Definition: ie_cnn_network.h:148
DataPtr output
A pointer to output data.
Definition: ie_cnn_network.h:314
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 noexcept
Returns constant nGraph function.
Definition: ie_cnn_network.h:186
std::map< std::string, SizeVector > InputShapes
Map of pairs: name of corresponding data and its dimension.
Definition: ie_icnn_network.hpp:196
std::map< std::string, InputInfo::Ptr > InputsDataMap
A collection that contains string as key, and InputInfo smart pointer as value.
Definition: ie_input_info.hpp:160
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