Data Structures | Typedefs | Functions
ie_blob.h File Reference

A header file for Blob and generic TBlob<> More...

#include <cstring>
#include <functional>
#include <map>
#include <memory>
#include <numeric>
#include <string>
#include <type_traits>
#include <utility>
#include <vector>
#include "ie_allocator.hpp"
#include "ie_common.h"
#include "ie_layouts.h"
#include "ie_locked_memory.hpp"
#include "ie_precision.hpp"
#include "details/ie_blob_iterator.hpp"
#include "details/ie_exception.hpp"
#include "details/ie_pre_allocator.hpp"

Go to the source code of this file.

Data Structures

class  InferenceEngine::Blob
 This class represents a universal container in the Inference Engine. More...
 
class  InferenceEngine::MemoryBlob
 This class implements a container object that represents a tensor in memory (host and remote/accelerated) More...
 
class  InferenceEngine::TBlob< T, typename >
 Represents real host memory allocated for a Tensor/Blob per C type. More...
 

Typedefs

using InferenceEngine::BlobMap = std::map< std::string, Blob::Ptr >
 This is a convenient type for working with a map containing pairs(string, pointer to a Blob instance).
 

Functions

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>
std::shared_ptr< T > InferenceEngine::as (const Blob::Ptr &blob) noexcept
 Helper cast function to work with shared Blob objects. 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>
std::shared_ptr< const T > InferenceEngine::as (const Blob::CPtr &blob) noexcept
 Helper cast function to work with shared Blob objects. More...
 
template<typename Type >
InferenceEngine::TBlob< Type >::Ptr InferenceEngine::make_shared_blob (const TensorDesc &tensorDesc)
 Creates a blob with the given tensor descriptor. More...
 
template<typename Type >
InferenceEngine::TBlob< Type >::Ptr InferenceEngine::make_shared_blob (const TensorDesc &tensorDesc, Type *ptr, size_t size=0)
 Creates a blob with the given tensor descriptor from the pointer to the pre-allocated memory. More...
 
template<typename Type >
InferenceEngine::TBlob< Type >::Ptr InferenceEngine::make_shared_blob (const TensorDesc &tensorDesc, const std::shared_ptr< InferenceEngine::IAllocator > &alloc)
 Creates a blob with the given tensor descriptor and allocator. More...
 
template<typename TypeTo >
InferenceEngine::TBlob< TypeTo >::Ptr InferenceEngine::make_shared_blob (const TBlob< TypeTo > &arg)
 Creates a copy of given TBlob instance. More...
 
template<typename T , typename... Args, typename std::enable_if< std::is_base_of< Blob, T >::value, int >::type = 0>
std::shared_ptr< T > InferenceEngine::make_shared_blob (Args &&... args)
 Creates a Blob object of the specified type. More...
 
Blob::Ptr InferenceEngine::make_shared_blob (const Blob::Ptr &inputBlob, const ROI &roi)
 Creates a blob describing given ROI object based on the given blob with pre-allocated memory. More...
 

Detailed Description

A header file for Blob and generic TBlob<>

Function Documentation

◆ as() [1/2]

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>
std::shared_ptr<const T> InferenceEngine::as ( const Blob::CPtr blob)
noexcept

Helper cast function to work with shared Blob objects.

Parameters
blobA blob to cast
Returns
shared_ptr to the type const T. Returned shared_ptr shares ownership of the object with the input Blob::Ptr

◆ as() [2/2]

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>
std::shared_ptr<T> InferenceEngine::as ( const Blob::Ptr blob)
noexcept

Helper cast function to work with shared Blob objects.

Parameters
blobA blob to cast
Returns
shared_ptr to the type T. Returned shared_ptr shares ownership of the object with the input Blob::Ptr

◆ make_shared_blob() [1/6]

template<typename T , typename... Args, typename std::enable_if< std::is_base_of< Blob, T >::value, int >::type = 0>
std::shared_ptr<T> InferenceEngine::make_shared_blob ( Args &&...  args)

Creates a Blob object of the specified type.

Parameters
argsConstructor arguments for the Blob object
Returns
A shared pointer to the newly created Blob object

◆ make_shared_blob() [2/6]

Blob::Ptr InferenceEngine::make_shared_blob ( const Blob::Ptr inputBlob,
const ROI roi 
)

Creates a blob describing given ROI object based on the given blob with pre-allocated memory.

Parameters
inputBloboriginal blob with pre-allocated memory.
roiA ROI object inside of the original blob.
Returns
A shared pointer to the newly created blob.

◆ make_shared_blob() [3/6]

template<typename TypeTo >
InferenceEngine::TBlob<TypeTo>::Ptr InferenceEngine::make_shared_blob ( const TBlob< TypeTo > &  arg)
inline

Creates a copy of given TBlob instance.

Template Parameters
TypeToType of the shared pointer to be created
Parameters
arggiven pointer to blob
Returns
A shared pointer to the newly created blob of the given type

◆ make_shared_blob() [4/6]

template<typename Type >
InferenceEngine::TBlob<Type>::Ptr InferenceEngine::make_shared_blob ( const TensorDesc tensorDesc)
inline

Creates a blob with the given tensor descriptor.

Template Parameters
TypeType of the shared pointer to be created
Parameters
tensorDescTensor descriptor for Blob creation
Returns
A shared pointer to the newly created blob of the given type

◆ make_shared_blob() [5/6]

template<typename Type >
InferenceEngine::TBlob<Type>::Ptr InferenceEngine::make_shared_blob ( const TensorDesc tensorDesc,
const std::shared_ptr< InferenceEngine::IAllocator > &  alloc 
)
inline

Creates a blob with the given tensor descriptor and allocator.

Template Parameters
TypeType of the shared pointer to be created
Parameters
tensorDescTensor descriptor for Blob creation
allocShared pointer to IAllocator to use in the blob
Returns
A shared pointer to the newly created blob of the given type

◆ make_shared_blob() [6/6]

template<typename Type >
InferenceEngine::TBlob<Type>::Ptr InferenceEngine::make_shared_blob ( const TensorDesc tensorDesc,
Type *  ptr,
size_t  size = 0 
)
inline

Creates a blob with the given tensor descriptor from the pointer to the pre-allocated memory.

Template Parameters
TypeType of the shared pointer to be created
Parameters
tensorDescTensorDesc for Blob creation
ptrPointer to the pre-allocated memory
sizeLength of the pre-allocated array
Returns
A shared pointer to the newly created blob of the given type