Public Member Functions | Protected Attributes
InferenceEngine::CNNNetwork Class Reference

This class contains all the information about the Neural Network and the related binary information. More...

#include <ie_cnn_network.h>

Collaboration diagram for InferenceEngine::CNNNetwork:
Collaboration graph
[legend]

Public Member Functions

 CNNNetwork ()=default
 A default constructor.
 
 CNNNetwork (std::shared_ptr< ICNNNetwork > network)
 Allows helper class to manage lifetime of network object. More...
 
 CNNNetwork (const std::shared_ptr< ngraph::Function > &network)
 A constructor from ngraph::Function object This constructor wraps existing ngraph::Function If you want to avoid modification of original Function, please create a copy. More...
 
virtual ~CNNNetwork ()
 A destructor.
 
virtual OutputsDataMap getOutputsInfo () const
 Gets the network output Data node information. The received info is stored in the given Data node. More...
 
virtual InputsDataMap getInputsInfo () const
 Gets the network input Data node information. The received info is stored in the given InputsDataMap object. More...
 
size_t layerCount () const
 Returns the number of layers in the network as an integer value. More...
 
const std::string & getName () const
 Returns the network name. More...
 
virtual void setBatchSize (const size_t size)
 Changes the inference batch size. More...
 
virtual size_t getBatchSize () const
 Gets the inference batch size. More...
 
 operator ICNNNetwork::Ptr ()
 An overloaded operator cast to get pointer on current network. More...
 
 operator ICNNNetwork & ()
 An overloaded operator & to get current network. More...
 
 operator const ICNNNetwork & () const
 An overloaded operator & to get current network. More...
 
std::shared_ptr< ngraph::Function > getFunction ()
 Returns constant nGraph function. More...
 
std::shared_ptr< const ngraph::Function > getFunction () const
 Returns constant nGraph function. More...
 
void addOutput (const std::string &layerName, size_t outputIndex=0)
 Adds output to the layer. More...
 
virtual ICNNNetwork::InputShapes getInputShapes () const
 Helper method to get collect all input shapes with names of corresponding Data objects. More...
 
virtual void reshape (const ICNNNetwork::InputShapes &inputShapes)
 Run shape inference with new input shapes for the network. More...
 
void serialize (const std::string &xmlPath, const std::string &binPath="") const
 Serialize network to IR and weights files. More...
 

Protected Attributes

std::shared_ptr< ICNNNetworknetwork
 Network extra interface, might be nullptr.
 
ICNNNetworkactual = nullptr
 A pointer to the current network.
 
DataPtr output
 A pointer to output data.
 

Detailed Description

This class contains all the information about the Neural Network and the related binary information.

Constructor & Destructor Documentation

◆ CNNNetwork() [1/2]

InferenceEngine::CNNNetwork::CNNNetwork ( std::shared_ptr< ICNNNetwork network)
inlineexplicit

Allows helper class to manage lifetime of network object.

Parameters
networkPointer to the network object

◆ CNNNetwork() [2/2]

InferenceEngine::CNNNetwork::CNNNetwork ( const std::shared_ptr< ngraph::Function > &  network)
explicit

A constructor from ngraph::Function object This constructor wraps existing ngraph::Function If you want to avoid modification of original Function, please create a copy.

Parameters
networkPointer to the ngraph::Function object

Member Function Documentation

◆ addOutput()

void InferenceEngine::CNNNetwork::addOutput ( const std::string &  layerName,
size_t  outputIndex = 0 
)
inline

Adds output to the layer.

Wraps ICNNNetwork::addOutput

Parameters
layerNameName of the layer
outputIndexIndex of the output

◆ getBatchSize()

virtual size_t InferenceEngine::CNNNetwork::getBatchSize ( ) const
inlinevirtual

Gets the inference batch size.

Wraps ICNNNetwork::getBatchSize

Returns
The size of batch as a size_t value

◆ getFunction() [1/2]

std::shared_ptr<ngraph::Function> InferenceEngine::CNNNetwork::getFunction ( )
inline

Returns constant nGraph function.

Returns
constant nGraph function

◆ getFunction() [2/2]

std::shared_ptr<const ngraph::Function> InferenceEngine::CNNNetwork::getFunction ( ) const
inline

Returns constant nGraph function.

Returns
constant nGraph function

◆ getInputShapes()

virtual ICNNNetwork::InputShapes InferenceEngine::CNNNetwork::getInputShapes ( ) const
inlinevirtual

Helper method to get collect all input shapes with names of corresponding Data objects.

Returns
Map of pairs: input name and its dimension.

◆ getInputsInfo()

virtual InputsDataMap InferenceEngine::CNNNetwork::getInputsInfo ( ) const
inlinevirtual

Gets the network input Data node information. The received info is stored in the given InputsDataMap object.

Wraps ICNNNetwork::getInputsInfo

Returns
inputs Reference to InputsDataMap object

◆ getName()

const std::string& InferenceEngine::CNNNetwork::getName ( ) const
inline

Returns the network name.

Wraps ICNNNetwork::getName

Returns
Network name

◆ getOutputsInfo()

virtual OutputsDataMap InferenceEngine::CNNNetwork::getOutputsInfo ( ) const
inlinevirtual

Gets the network output Data node information. The received info is stored in the given Data node.

Wraps ICNNNetwork::getOutputsInfo

Returns
outputs Reference to the OutputsDataMap object

◆ layerCount()

size_t InferenceEngine::CNNNetwork::layerCount ( ) const
inline

Returns the number of layers in the network as an integer value.

Wraps ICNNNetwork::layerCount

Returns
The number of layers as an integer value

◆ operator const ICNNNetwork &()

InferenceEngine::CNNNetwork::operator const ICNNNetwork & ( ) const
inline

An overloaded operator & to get current network.

Returns
A const reference of the current network

◆ operator ICNNNetwork &()

InferenceEngine::CNNNetwork::operator ICNNNetwork & ( )
inline

An overloaded operator & to get current network.

Returns
An instance of the current network

◆ operator ICNNNetwork::Ptr()

InferenceEngine::CNNNetwork::operator ICNNNetwork::Ptr ( )
inline

An overloaded operator cast to get pointer on current network.

Returns
A shared pointer of the current network

◆ reshape()

virtual void InferenceEngine::CNNNetwork::reshape ( const ICNNNetwork::InputShapes inputShapes)
inlinevirtual

Run shape inference with new input shapes for the network.

Parameters
inputShapes- map of pairs: name of corresponding data and its dimension.

◆ serialize()

void InferenceEngine::CNNNetwork::serialize ( const std::string &  xmlPath,
const std::string &  binPath = "" 
) const
inline

Serialize network to IR and weights files.

Parameters
xmlPathPath to output IR file.
binPathPath to output weights file. The parameter is skipped in case of executable graph info serialization.

◆ setBatchSize()

virtual void InferenceEngine::CNNNetwork::setBatchSize ( const size_t  size)
inlinevirtual

Changes the inference batch size.

Wraps ICNNNetwork::setBatchSize

Parameters
sizeSize of batch to set
Returns
Status code of the operation

The documentation for this class was generated from the following file: