Public Types | Public Member Functions | Static Public Member Functions | Data Fields
InferenceEngine::CNNLayer Class Reference

This is a base abstraction Layer - all DNN Layers inherit from this class. More...

#include <ie_layers.h>

Inheritance diagram for InferenceEngine::CNNLayer:
Inheritance graph
[legend]
Collaboration diagram for InferenceEngine::CNNLayer:
Collaboration graph
[legend]

Public Types

using Ptr = std::shared_ptr< CNNLayer >
 A shared pointer to CNNLayer.
 

Public Member Functions

 CNNLayer (const LayerParams &prms)
 A constructor. Creates a new CNNLayer instance and initializes layer parameters with the given values. More...
 
virtual ~CNNLayer ()
 A virtual destructor.
 
void fuse (Ptr &layer)
 Sets a layer to be fused with. More...
 
virtual const DataPtr input () const
 Returns the first element of the input data for this layer. More...
 
void validateLayer ()
 Checks if the input data and layer data are legitimate.
 
float GetParamAsFloat (const char *param, float def) const
 Gets float value for the given parameter. More...
 
float GetParamAsFloat (const char *param) const
 Returns a float value for the given layer parameter. More...
 
std::vector< float > GetParamAsFloats (const char *param, std::vector< float > def) const
 Returns a vector of float values for the given parameter or returns the default value. More...
 
std::vector< float > GetParamAsFloats (const char *param) const
 Returns a vector of float values for the given parameter. More...
 
int GetParamAsInt (const char *param, int def) const
 Returns an integer value for the given parameter or returns the default value. More...
 
int GetParamAsInt (const char *param) const
 Returns an integer value for the given parameter. More...
 
std::vector< int > GetParamAsInts (const char *param, std::vector< int > def) const
 Returns a vector of int values for the given parameter or returns the default value. More...
 
std::vector< int > GetParamAsInts (const char *param) const
 Returns a vector of int values for the given parameter. More...
 
unsigned int GetParamAsUInt (const char *param, unsigned int def) const
 Returns an unsigned integer value for the given parameter or returns the default value. More...
 
unsigned int GetParamAsUInt (const char *param) const
 Returns an unsigned integer value for the given parameter. More...
 
std::vector< unsigned int > GetParamAsUInts (const char *param, std::vector< unsigned int > def) const
 Returns a vector of unsigned int values for the given parameter or returns the default value. More...
 
std::vector< unsigned int > GetParamAsUInts (const char *param) const
 Returns a vector of unsigned int values for the given parameter. More...
 
bool GetParamAsBool (const char *param, bool def) const
 Returns a boolean value for the given parameter. The valid values are (true, false, 1, 0). More...
 
bool GetParamAsBool (const char *param) const
 Returns a boolean value for the given parameter. More...
 
std::string GetParamAsString (const char *param, const char *def) const
 Returns a string value for the given parameter or returns the default one. More...
 
bool CheckParamPresence (const char *param) const
 Checks the param presence in the layer. More...
 
std::string GetParamAsString (const char *param) const
 Returns a string value for the given parameter. Throws exception if parameter was not found. More...
 
std::vector< std::string > GetParamAsStrings (const char *param, std::vector< std::string > def) const
 

Static Public Member Functions

static float ie_parse_float (const std::string &str)
 Parse string with float in accordance with IE rules. More...
 
static std::string ie_serialize_float (float value)
 serialize float with c_locale formating used for default values serializing
 

Data Fields

std::string name
 Layer name.
 
std::string type
 Layer type.
 
Precision precision
 Layer base operating precision.
 
std::vector< DataPtroutData
 A vector of pointers to the output data elements of this layer in the di-graph (order matters)
 
std::vector< DataWeakPtrinsData
 A vector of weak pointers to the input data elements of this layer in the di-graph (order matters)
 
Ptr _fusedWith
 If suggested to fuse - a pointer to the layer which needs to be fused with this layer.
 
UserValue userValue
 Convenience user values to store in this object as extra data.
 
std::string affinity
 Layer affinity set by user.
 
std::map< std::string, std::string > params
 Map of pairs: (parameter name, parameter value)
 
std::map< std::string, Blob::Ptrblobs
 Map of pairs: (name, weights/biases blob)
 

Detailed Description

This is a base abstraction Layer - all DNN Layers inherit from this class.

Constructor & Destructor Documentation

§ CNNLayer()

InferenceEngine::CNNLayer::CNNLayer ( const LayerParams prms)
inlineexplicit

A constructor. Creates a new CNNLayer instance and initializes layer parameters with the given values.

Parameters
prmsBasic common parsing parameters

Member Function Documentation

§ CheckParamPresence()

bool InferenceEngine::CNNLayer::CheckParamPresence ( const char *  param) const
inline

Checks the param presence in the layer.

Parameters
paramName of the layer parameter
Returns
a bool depending param presence

§ fuse()

void InferenceEngine::CNNLayer::fuse ( Ptr layer)
inline

Sets a layer to be fused with.

Parameters
layerReference to the layer to be fused with

§ GetParamAsBool() [1/2]

bool InferenceEngine::CNNLayer::GetParamAsBool ( const char *  param,
bool  def 
) const
inline

Returns a boolean value for the given parameter. The valid values are (true, false, 1, 0).

Parameters
paramName of the layer parameter
defDefault value of the parameter if not found
Returns
A bool value for the specified parameter

§ GetParamAsBool() [2/2]

bool InferenceEngine::CNNLayer::GetParamAsBool ( const char *  param) const
inline

Returns a boolean value for the given parameter.

Parameters
paramName of the layer parameter
Returns
A bool value for the specified parameter

§ GetParamAsFloat() [1/2]

float InferenceEngine::CNNLayer::GetParamAsFloat ( const char *  param,
float  def 
) const
inline

Gets float value for the given parameter.

Parameters
paramname of the parameter to find
defdefault value of the parameter if not found
Returns
float value

§ GetParamAsFloat() [2/2]

float InferenceEngine::CNNLayer::GetParamAsFloat ( const char *  param) const
inline

Returns a float value for the given layer parameter.

Parameters
paramName of the layer parameter
Returns
A float value for the specified parameter

§ GetParamAsFloats() [1/2]

std::vector<float> InferenceEngine::CNNLayer::GetParamAsFloats ( const char *  param,
std::vector< float >  def 
) const
inline

Returns a vector of float values for the given parameter or returns the default value.

Parameters
paramName of the layer parameter
defDefault value of the parameter if not found
Returns
vector of float values

§ GetParamAsFloats() [2/2]

std::vector<float> InferenceEngine::CNNLayer::GetParamAsFloats ( const char *  param) const
inline

Returns a vector of float values for the given parameter.

Parameters
paramName of the layer parameter
Returns
vector of float values

§ GetParamAsInt() [1/2]

int InferenceEngine::CNNLayer::GetParamAsInt ( const char *  param,
int  def 
) const
inline

Returns an integer value for the given parameter or returns the default value.

Parameters
paramName of the layer parameter
defDefault value of the parameter if not found
Returns
An int value for the specified parameter

§ GetParamAsInt() [2/2]

int InferenceEngine::CNNLayer::GetParamAsInt ( const char *  param) const
inline

Returns an integer value for the given parameter.

Parameters
paramName of the layer parameter
Returns
An int value for the specified parameter

§ GetParamAsInts() [1/2]

std::vector<int> InferenceEngine::CNNLayer::GetParamAsInts ( const char *  param,
std::vector< int >  def 
) const
inline

Returns a vector of int values for the given parameter or returns the default value.

Parameters
paramName of the layer parameter
defDefault value of the parameter if not found
Returns
vector of int values

§ GetParamAsInts() [2/2]

std::vector<int> InferenceEngine::CNNLayer::GetParamAsInts ( const char *  param) const
inline

Returns a vector of int values for the given parameter.

Parameters
paramName of the layer parameter
Returns
vector of int values

§ GetParamAsString() [1/2]

std::string InferenceEngine::CNNLayer::GetParamAsString ( const char *  param,
const char *  def 
) const
inline

Returns a string value for the given parameter or returns the default one.

Parameters
paramName of the layer parameter
defDefault value of the parameter if not found
Returns
A string value

§ GetParamAsString() [2/2]

std::string InferenceEngine::CNNLayer::GetParamAsString ( const char *  param) const
inline

Returns a string value for the given parameter. Throws exception if parameter was not found.

Parameters
paramName of the layer parameter
Returns
A string value

§ GetParamAsUInt() [1/2]

unsigned int InferenceEngine::CNNLayer::GetParamAsUInt ( const char *  param,
unsigned int  def 
) const
inline

Returns an unsigned integer value for the given parameter or returns the default value.

Parameters
paramName of the layer parameter
defDefault value of the parameter if not found
Returns
An unsigned integer value for the specified parameter

§ GetParamAsUInt() [2/2]

unsigned int InferenceEngine::CNNLayer::GetParamAsUInt ( const char *  param) const
inline

Returns an unsigned integer value for the given parameter.

Parameters
paramName of the layer parameter
Returns
An unsigned integer value for the specified parameter

§ GetParamAsUInts() [1/2]

std::vector<unsigned int> InferenceEngine::CNNLayer::GetParamAsUInts ( const char *  param,
std::vector< unsigned int >  def 
) const
inline

Returns a vector of unsigned int values for the given parameter or returns the default value.

Parameters
paramName of the layer parameter
defDefault value of the parameter if not found
Returns
vector of unsigned int values

§ GetParamAsUInts() [2/2]

std::vector<unsigned int> InferenceEngine::CNNLayer::GetParamAsUInts ( const char *  param) const
inline

Returns a vector of unsigned int values for the given parameter.

Parameters
paramName of the layer parameter
Returns
vector of unsigned int values

§ ie_parse_float()

static float InferenceEngine::CNNLayer::ie_parse_float ( const std::string &  str)
inlinestatic

Parse string with float in accordance with IE rules.

Parameters
strinput string with float value
Returns
float value if parsing was successful
Exceptions
InferenceEngineExceptionin case of parsing error

§ input()

virtual const DataPtr InferenceEngine::CNNLayer::input ( ) const
inlinevirtual

Returns the first element of the input data for this layer.

Returns
A smart pointer to the input data element

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