This class represents a universal container in the Inference Engine. More...
#include <ie_blob.h>
Public Types | |
using | Ptr = std::shared_ptr< Blob > |
A smart pointer containing Blob object. |
|
using | CPtr = std::shared_ptr< const Blob > |
A smart pointer to the const Blob object. |
|
Public Member Functions | |
Precision | type () const noexcept |
Returns the tensor precision of the current Blob object. More... |
|
Precision | precision () const noexcept |
Returns the tensor precision of the current Blob object. More... |
|
Layout | layout () const noexcept |
Returns the tensor layout of the current Blob object. More... |
|
virtual | ~Blob ()=default |
Blob virtual destructor. |
|
template<typename T , typename std::enable_if< !std::is_pointer< T >::value &&!std::is_reference< T >::value, int >::type = 0, typename std::enable_if< std::is_base_of< Blob, T >::value, int >::type = 0> | |
bool | is () noexcept |
Checks if the Blob object can be cast to the type T*. More... |
|
template<typename T , typename std::enable_if< !std::is_pointer< T >::value &&!std::is_reference< T >::value, int >::type = 0, typename std::enable_if< std::is_base_of< Blob, T >::value, int >::type = 0> | |
bool | is () const noexcept |
Checks if the Blob object can be cast to the type const T*. More... |
|
template<typename T , typename std::enable_if< !std::is_pointer< T >::value &&!std::is_reference< T >::value, int >::type = 0, typename std::enable_if< std::is_base_of< Blob, T >::value, int >::type = 0> | |
T * | as () noexcept |
Casts this Blob object to the type T*. Use InferenceEngine::as() to operate with shared Blob objects instead of raw pointers. More... |
|
template<typename T , typename std::enable_if< !std::is_pointer< T >::value &&!std::is_reference< T >::value, int >::type = 0, typename std::enable_if< std::is_base_of< Blob, T >::value, int >::type = 0> | |
const T * | as () const noexcept |
Casts this Blob object to the type const T*. Use InferenceEngine::as() to operate with shared Blob objects instead of raw pointers. More... |
|
Blob (const TensorDesc &tensorDesc) | |
Constructor. Creates an empty Blob object with the specified precision. More... |
|
Blob (Precision p) | |
Constructor. Creates an empty Blob object with the specified precision. More... |
|
Blob (Precision p, Layout l) | |
The constructor creates an empty Blob object with the specified precision and layout. More... |
|
Blob (Precision p, const SizeVector &dims) | |
The constructor creates an empty Blob object with the specified precision and dimensions. More... |
|
Blob (Precision p, Layout l, const SizeVector &dims) | |
The constructor creates an empty Blob object with the specified precision, layout and dimensions. More... |
|
size_t | Resize (const SizeVector &dims, Layout layout=Layout::ANY) noexcept |
Changes Tensor size to the specified dimensions. If it was allocated, the previous data is deallocated and lost. More... |
|
size_t | Reshape (const SizeVector &dims, Layout layout=Layout::ANY) noexcept |
Changes tensor size to the specified dimensions without changing memory. The total size remains unchanged as well as the memory layout. More... |
|
const SizeVector | dims () const noexcept |
Returns the tensor dimensions vector with reversed order. More... |
|
virtual const TensorDesc & | getTensorDesc () const noexcept |
Returns the tensor description. |
|
virtual TensorDesc & | getTensorDesc () noexcept |
Returns the tensor description. |
|
virtual size_t | size () const noexcept |
By default, returns the total number of elements (a product of all the dims or 1 for scalar) More... |
|
virtual size_t | byteSize () const noexcept |
Returns the size of the current Blob in bytes. |
|
virtual size_t | element_size () const noexcept=0 |
Returns the number of bytes per element. The overall Blob capacity is size() * element_size(). Abstract method. |
|
virtual void | allocate () noexcept=0 |
Allocates memory to store the data. Abstract method. |
|
virtual bool | deallocate () noexcept=0 |
Releases previously allocated data. Abstract method. |
|
virtual LockedMemory< void > | buffer () noexcept=0 |
Gets access to the allocated memory. Abstract method. More... |
|
virtual LockedMemory< const void > | cbuffer () const noexcept=0 |
Gets read-only access to the allocated memory. Abstract method. More... |
|
Static Public Member Functions | |
static Ptr | CreateFromData (const DataPtr &data) |
Creates a TBlob<> object from a Data node. More... |
|
Protected Member Functions | |
virtual const std::shared_ptr< IAllocator > & | getAllocator () const noexcept=0 |
Gets an allocator for allocator-based blobs. More... |
|
virtual void * | getHandle () const noexcept=0 |
Gets a handle to allocated memory. More... |
|
Static Protected Member Functions | |
static size_t | product (const SizeVector &dims) noexcept |
Multiplies the dimension vector's values. More... |
|
Protected Attributes | |
TensorDesc | tensorDesc |
The tensor descriptor of the given blob. |
|
Friends | |
template<typename > | |
class | TBlobProxy |
This class represents a universal container in the Inference Engine.
|
inlineexplicit |
Constructor. Creates an empty Blob object with the specified precision.
tensorDesc | Defines the layout and dims of the blob |
|
inlineexplicit |
|
inline |
The constructor creates an empty Blob object with the specified precision and dimensions.
p | Tensor precision type |
dims | Tensor dimensions vector |
|
inline |
The constructor creates an empty Blob object with the specified precision, layout and dimensions.
p | tensor precision type |
l | tensor layout |
dims | Tensor dimensions vector with reversed order |
|
inlinenoexcept |
Casts this Blob object to the type T*. Use InferenceEngine::as() to operate with shared Blob objects instead of raw pointers.
T | Type to cast to. Must represent a class derived from the Blob |
|
inlinenoexcept |
Casts this Blob object to the type const T*. Use InferenceEngine::as() to operate with shared Blob objects instead of raw pointers.
T | Type to cast to. Must represent a class derived from the Blob |
|
pure virtualnoexcept |
Gets access to the allocated memory. Abstract method.
Implemented in InferenceEngine::TBlob< T, typename >, InferenceEngine::MemoryBlob, and InferenceEngine::CompoundBlob.
|
pure virtualnoexcept |
Gets read-only access to the allocated memory. Abstract method.
Implemented in InferenceEngine::TBlob< T, typename >, InferenceEngine::MemoryBlob, and InferenceEngine::CompoundBlob.
|
inlinenoexcept |
Returns the tensor dimensions vector with reversed order.
|
protectedpure virtualnoexcept |
Gets an allocator for allocator-based blobs.
Implemented in InferenceEngine::TBlob< T, typename >, InferenceEngine::MemoryBlob, and InferenceEngine::CompoundBlob.
|
protectedpure virtualnoexcept |
Gets a handle to allocated memory.
Implemented in InferenceEngine::TBlob< T, typename >, InferenceEngine::MemoryBlob, and InferenceEngine::CompoundBlob.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Returns the tensor layout of the current Blob object.
|
inlinenoexcept |
Returns the tensor precision of the current Blob object.
|
inlinestaticprotectednoexcept |
Multiplies the dimension vector's values.
dims | Reference to a vector with dimension values of type size_t |
|
inlinenoexcept |
Changes tensor size to the specified dimensions without changing memory. The total size remains unchanged as well as the memory layout.
dims | New dimensions to set |
layout | New layout to set |
|
inlinenoexcept |
Changes Tensor size to the specified dimensions. If it was allocated, the previous data is deallocated and lost.
dims | New dimensions to set |
layout | New layout to set |
|
inlinevirtualnoexcept |
By default, returns the total number of elements (a product of all the dims or 1 for scalar)
Return value and its interpretation heavily depend on the blob type
Reimplemented in InferenceEngine::MemoryBlob, and InferenceEngine::CompoundBlob.
|
inlinenoexcept |
Returns the tensor precision of the current Blob object.