Public Member Functions | Static Public Member Functions
InferenceEngine::TensorDesc Class Reference

This class defines Tensor description. More...

#include <ie_layouts.h>

Public Member Functions

 TensorDesc (const Precision &precision, const SizeVector &dims, const BlockingDesc &blockDesc)
 The constructor creates the tensor descriptor using blocking descriptor. More...
 
 TensorDesc (const Precision &precision, const SizeVector &dims, Layout layout)
 The constructor creates the tensor descriptor using standard layout. More...
 
 TensorDesc (const Precision &precision, Layout layout)
 The constructor creates the empty tensor descriptor with precision and layout. More...
 
 TensorDesc ()
 The default constructor which creates empty tensor descriptor.
 
void reshape (const SizeVector &dims, Layout layout=Layout::ANY)
 Reshapes the tensor descriptor. More...
 
void reshape (const SizeVector &dims, const BlockingDesc &blockDesc)
 Reshapes the tensor descriptor. More...
 
SizeVectorgetDims ()
 Returns the vector of dimensions. More...
 
const SizeVectorgetDims () const noexcept
 Returns the constant vector of dimensions. More...
 
void setDims (const SizeVector &dims)
 Sets dimensions. More...
 
Layout getLayout () const
 Returns the memory layout. More...
 
void setLayout (Layout l)
 Sets the layout. More...
 
const PrecisiongetPrecision () const
 Returns the memory precision. More...
 
void setPrecision (const Precision &p)
 Sets the memory precision. More...
 
const BlockingDescgetBlockingDesc () const
 Returns the blocking descriptor. More...
 
bool operator== (const TensorDesc &rhs) const
 The comparison operator for the TensorDesc. More...
 
bool operator!= (const TensorDesc &rhs) const
 The comparison operator for the TensorDesc. More...
 
size_t offset (const SizeVector &v) const
 Calculates offset for the vector of dimensions. More...
 
size_t offset (size_t l) const
 Calculates offset for the local offset. More...
 

Static Public Member Functions

static Layout getLayoutByDims (const SizeVector &dims)
 Returns the standard layout for dimensions. More...
 

Detailed Description

This class defines Tensor description.

Constructor & Destructor Documentation

◆ TensorDesc() [1/3]

InferenceEngine::TensorDesc::TensorDesc ( const Precision precision,
const SizeVector dims,
const BlockingDesc blockDesc 
)

The constructor creates the tensor descriptor using blocking descriptor.

Parameters
precisionmemory precision
dimsmemory dimensions
blockDescblocking descriptor

◆ TensorDesc() [2/3]

InferenceEngine::TensorDesc::TensorDesc ( const Precision precision,
const SizeVector dims,
Layout  layout 
)

The constructor creates the tensor descriptor using standard layout.

Parameters
precisionmemory precision
dimsmemory dimensions
layoutmemory layout

◆ TensorDesc() [3/3]

InferenceEngine::TensorDesc::TensorDesc ( const Precision precision,
Layout  layout 
)

The constructor creates the empty tensor descriptor with precision and layout.

Parameters
precisionmemory precision
layoutmemory layout

Member Function Documentation

◆ getBlockingDesc()

const BlockingDesc& InferenceEngine::TensorDesc::getBlockingDesc ( ) const
inline

Returns the blocking descriptor.

Returns
blocking descriptor

◆ getDims() [1/2]

SizeVector& InferenceEngine::TensorDesc::getDims ( )
inline

Returns the vector of dimensions.

Returns
dimensions

◆ getDims() [2/2]

const SizeVector& InferenceEngine::TensorDesc::getDims ( ) const
inlinenoexcept

Returns the constant vector of dimensions.

Returns
dimensions

◆ getLayout()

Layout InferenceEngine::TensorDesc::getLayout ( ) const
inline

Returns the memory layout.

Returns
layout

◆ getLayoutByDims()

static Layout InferenceEngine::TensorDesc::getLayoutByDims ( const SizeVector dims)
static

Returns the standard layout for dimensions.

Parameters
dimsthe vector of dimensions
Returns
the standard memory layout

◆ getPrecision()

const Precision& InferenceEngine::TensorDesc::getPrecision ( ) const
inline

Returns the memory precision.

Returns
precision

◆ offset() [1/2]

size_t InferenceEngine::TensorDesc::offset ( const SizeVector v) const

Calculates offset for the vector of dimensions.

Parameters
vvector of dimensions
Returns
offset

◆ offset() [2/2]

size_t InferenceEngine::TensorDesc::offset ( size_t  l) const

Calculates offset for the local offset.

Parameters
llocal offset
Returns
offset

◆ operator!=()

bool InferenceEngine::TensorDesc::operator!= ( const TensorDesc rhs) const

The comparison operator for the TensorDesc.

Parameters
rhsobject to compare
Returns
true if objects aren't equal

◆ operator==()

bool InferenceEngine::TensorDesc::operator== ( const TensorDesc rhs) const

The comparison operator for the TensorDesc.

Parameters
rhsobject to compare
Returns
true if objects are equal

◆ reshape() [1/2]

void InferenceEngine::TensorDesc::reshape ( const SizeVector dims,
const BlockingDesc blockDesc 
)

Reshapes the tensor descriptor.

Parameters
dimsnew dimensions
blockDescnew blocking descriptor

◆ reshape() [2/2]

void InferenceEngine::TensorDesc::reshape ( const SizeVector dims,
Layout  layout = Layout::ANY 
)

Reshapes the tensor descriptor.

Parameters
dimsnew dimensions
layoutnew layout if it is necessary

◆ setDims()

void InferenceEngine::TensorDesc::setDims ( const SizeVector dims)

Sets dimensions.

Parameters
dimsnew dimensions

◆ setLayout()

void InferenceEngine::TensorDesc::setLayout ( Layout  l)

Sets the layout.

Parameters
lmemory layout

◆ setPrecision()

void InferenceEngine::TensorDesc::setPrecision ( const Precision p)
inline

Sets the memory precision.

Parameters
pprecision

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