class InferenceEngine::TensorDesc¶
Overview¶
This class defines Tensor description. More…
#include <ie_layouts.h>
class TensorDesc
{
public:
// construction
TensorDesc(, , );
TensorDesc(, , );
TensorDesc(, );
TensorDesc();
// methods
voidconst SizeVector&Layout reshape(, );
voidconst SizeVector&const BlockingDesc& reshape(, );
SizeVector& getDims();
const SizeVector& getDims() const;
voidconst SizeVector& setDims();
Layout getLayout() const;
voidLayout setLayout();
const Precision& getPrecision() const;
voidconst Precision& setPrecision();
const BlockingDesc& getBlockingDesc() const;
boolconst TensorDesc& operator == () const;
boolconst TensorDesc& operator != () const;
size_tconst SizeVector& offset() const;
size_tsize_t offset() const;
static Layoutconst SizeVector& getLayoutByDims();
static Layoutsize_t getLayoutByRank();
};
Detailed Documentation¶
This class defines Tensor description.
Construction¶
TensorDesc(, , )
The constructor creates the tensor descriptor using blocking descriptor.
Parameters:
precision |
memory precision |
dims |
memory dimensions |
blockDesc |
blocking descriptor |
TensorDesc(, , )
The constructor creates the tensor descriptor using standard layout.
Parameters:
precision |
memory precision |
dims |
memory dimensions |
layout |
memory layout |
TensorDesc(, )
The constructor creates the empty tensor descriptor with precision and layout.
Parameters:
precision |
memory precision |
layout |
memory layout |
TensorDesc()
The default constructor which creates empty tensor descriptor.
Methods¶
voidconst SizeVector&Layout reshape(, )
Reshapes the tensor descriptor.
Parameters:
dims |
new dimensions |
layout |
new layout if it is necessary |
voidconst SizeVector&const BlockingDesc& reshape(, )
Reshapes the tensor descriptor.
Parameters:
dims |
new dimensions |
blockDesc |
new blocking descriptor |
SizeVector& getDims()
Returns the vector of dimensions.
Returns:
dimensions
const SizeVector& getDims() const
Returns the constant vector of dimensions.
Returns:
dimensions
voidconst SizeVector& setDims()
Sets dimensions.
Parameters:
dims |
new dimensions |
Layout getLayout() const
Returns the memory layout.
Returns:
layout
voidLayout setLayout()
Sets the layout.
Parameters:
l |
memory layout |
const Precision& getPrecision() const
Returns the memory precision.
Returns:
precision
voidconst Precision& setPrecision()
Sets the memory precision.
Parameters:
p |
precision |
const BlockingDesc& getBlockingDesc() const
Returns the blocking descriptor.
Returns:
blocking descriptor
boolconst TensorDesc& operator == () const
The comparison operator for the TensorDesc.
Parameters:
rhs |
object to compare |
Returns:
true if objects are equal
boolconst TensorDesc& operator != () const
The comparison operator for the TensorDesc.
Parameters:
rhs |
object to compare |
Returns:
true if objects aren’t equal
size_tconst SizeVector& offset() const
Calculates offset for the vector of dimensions.
Parameters:
v |
vector of dimensions |
Returns:
offset
size_tsize_t offset() const
Calculates offset for the local offset.
Parameters:
l |
local offset |
Returns:
offset
static Layoutconst SizeVector& getLayoutByDims()
Returns the standard layout for dimensions.
Parameters:
dims |
the vector of dimensions |
Returns:
the standard memory layout
static Layoutsize_t getLayoutByRank()
Returns the standard layout for the specified tensor rank.
Parameters:
rank |
of the requested layout |
Returns:
the standard memory layout