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<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 return actual->getPrecision();
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();
177 const std::shared_ptr<const ngraph::Function>
getFunction() const noexcept {
178 return actual->getFunction();
189 void addOutput(
const std::string& layerName,
size_t outputIndex = 0) {
190 CALL_STATUS_FNC(addOutput, layerName, outputIndex);
203 CALL_STATUS_FNC(getLayerByName, layerName, layer);
215 details::CNNNetworkIterator
begin()
const {
216 return details::CNNNetworkIterator(actual);
222 details::CNNNetworkIterator
end()
const {
223 return details::CNNNetworkIterator();
232 return std::distance(std::begin(*
this), std::end(*
this));
240 void AddExtension(InferenceEngine::IShapeInferExtensionPtr extension) {
241 CALL_STATUS_FNC(AddExtension, extension);
252 actual->getInputsInfo(inputs);
253 for (
const auto& pair : inputs) {
254 auto info = pair.second;
256 auto data = info->getInputData();
258 shapes[data->getName()] = data->getTensorDesc().getDims();
271 CALL_STATUS_FNC(reshape, inputShapes);
281 void serialize(
const std::string& xmlPath,
const std::string& binPath =
"")
const {
282 CALL_STATUS_FNC(serialize, xmlPath, binPath);
289 IE_SUPPRESS_DEPRECATED_START
291 IE_SUPPRESS_DEPRECATED_END
CNNLayerPtr getLayerByName(const char *layerName) const
Definition: ie_cnn_network.h:201
#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:249
const std::string & getName() const noexcept
Definition: ie_cnn_network.h:136
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:189
A header file for Blob and generic TBlob<>
A header file for the CNNNetworkIterator class.
details::CNNNetworkIterator begin() const
Begin layer iterator.
Definition: ie_cnn_network.h:215
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:270
size_t layerCount() const
Definition: ie_cnn_network.h:125
virtual Precision getPrecision() const
Definition: ie_cnn_network.h:88
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:290
This is the main interface to describe the NN topology.
Definition: ie_icnn_network.hpp:42
Definition: ie_cnn_network.h:27
details::CNNNetworkIterator end() const
End layer iterator.
Definition: ie_cnn_network.h:222
void serialize(const std::string &xmlPath, const std::string &binPath="") const
Serialize network to IR and weights files.
Definition: ie_cnn_network.h:281
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:295
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
size_t size() const
Number of layers in network object.
Definition: ie_cnn_network.h:231
DataPtr output
A pointer to output data.
Definition: ie_cnn_network.h:304
A header file that provides interface for network reader that is used to build networks from a given ...
void AddExtension(InferenceEngine::IShapeInferExtensionPtr extension)
Registers extension within the plugin.
Definition: ie_cnn_network.h:240
std::map< std::string, SizeVector > InputShapes
Map of pairs: name of corresponding data and its dimension.
Definition: ie_icnn_network.hpp:181
const std::shared_ptr< const ngraph::Function > getFunction() const noexcept
Returns constant nGraph function.
Definition: ie_cnn_network.h:177
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:164
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