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. More...
 
  CNNNetwork (std::shared_ptr< ICNNNetReader > reader)
  A constructor from ICNNNetReader object. More...
 
virtual  ~CNNNetwork ()
  A destructor.
 
virtual Precision  getPrecision () const
 
virtual OutputsDataMap  getOutputsInfo () const
 
virtual InputsDataMap  getInputsInfo () const
 
size_t  layerCount () const
 
const std::string &  getName () const noexcept
 
virtual void  setBatchSize (const size_t size)
 
virtual size_t  getBatchSize () const
 
  operator ICNNNetwork & () const
  An overloaded operator & to get current network. More...
 
const std::shared_ptr< const ngraph::Function >  getFunction () const noexcept
  Returns constant nGraph function. More...
 
void  addOutput (const std::string &layerName, size_t outputIndex=0)
 
CNNLayerPtr  getLayerByName (const char *layerName) const
 
details::CNNNetworkIterator  begin () const
  Begin layer iterator. More...
 
details::CNNNetworkIterator  end () const
  End layer iterator.
 
size_t  size () const
  Number of layers in network object. More...
 
void  AddExtension (InferenceEngine::IShapeInferExtensionPtr extension)
  Registers extension within the plugin. 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< ICNNNetReader >  reader
  Reader extra reference, might be nullptr.
 
std::shared_ptr< ICNNNetwork network
  Network extra interface, might be nullptr.
 
ICNNNetwork actual = 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/3]

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

Allows helper class to manage lifetime of network object.

Parameters
network Pointer to the network object

§ CNNNetwork() [2/3]

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

A constructor from ngraph::Function object.

Parameters
network Pointer to the ngraph::Function object

§ CNNNetwork() [3/3]

InferenceEngine::CNNNetwork::CNNNetwork ( std::shared_ptr< ICNNNetReader >  reader )
inlineexplicit

A constructor from ICNNNetReader object.

Parameters
reader Pointer to the ICNNNetReader object

Member Function Documentation

§ AddExtension()

void InferenceEngine::CNNNetwork::AddExtension ( InferenceEngine::IShapeInferExtensionPtr  extension )
inline

Registers extension within the plugin.

Parameters
extension Pointer to already loaded reader extension with shape propagation implementations

§ addOutput()

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

Adds output to the layer.

Wraps ICNNNetwork::addOutput

Parameters
layerName Name of the layer
outputIndex Index of the output

§ begin()

details::CNNNetworkIterator InferenceEngine::CNNNetwork::begin ( ) const
inline

Begin layer iterator.

Order of layers is implementation specific, and can be changed in future

Returns
Iterator pointing to a layer

§ 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()

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

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

§ getLayerByName()

CNNLayerPtr InferenceEngine::CNNNetwork::getLayerByName ( const char *  layerName ) const
inline

Gets network layer with the given name.

Wraps ICNNNetwork::getLayerByName

Parameters
layerName Given name of the layer
Returns
Status code of the operation. InferenceEngine::OK if succeeded

§ getName()

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

Gets the network name. The name is stored in the given pName string.

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

§ getPrecision()

virtual Precision InferenceEngine::CNNNetwork::getPrecision ( ) const
inlinevirtual

Returns the main network operating precision.

Wraps ICNNNetwork::getPrecision

Returns
A precision type

§ 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 ICNNNetwork &()

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

An overloaded operator & to get current network.

Returns
An instance 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
xmlPath Path to output IR file.
binPath Path 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
size Size of batch to set
Returns
Status code of the operation

§ size()

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

Number of layers in network object.

Returns

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