class InferenceEngine::CompoundBlob¶
Overview¶
This class represents a blob that contains other blobs. More…
#include <ie_compound_blob.h>
class CompoundBlob: public InferenceEngine::Blob
{
public:
// typedefs
typedef std::shared_ptr<CompoundBlob> Ptr;
typedef std::shared_ptr<const CompoundBlob> CPtr;
// construction
CompoundBlob(const std::vector<Blob::Ptr>& blobs);
CompoundBlob(std::vector<Blob::Ptr>&& blobs);
// methods
virtual size_t byteSize() const;
virtual size_t element_size() const;
virtual void allocate();
virtual bool deallocate();
virtual size_t size() const;
virtual Blob::Ptr getBlob(size_t i) const;
virtual Blob::Ptr createROI(const ROI& roi) const;
};
// direct descendants
class BatchedBlob;
class I420Blob;
class NV12Blob;
Inherited Members¶
public:
// typedefs
typedef std::shared_ptr<Blob> Ptr;
typedef std::shared_ptr<const Blob> CPtr;
// methods
static Ptr CreateFromData(const DataPtr& data);
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();
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;
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();
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;
virtual const TensorDesc& getTensorDesc() const;
virtual TensorDesc& getTensorDesc();
virtual size_t size() const;
virtual size_t byteSize() const;
virtual size_t element_size() const = 0;
virtual void allocate() = 0;
virtual bool deallocate() = 0;
void setShape(const SizeVector& dims);
virtual Blob::Ptr createROI(const ROI& roi) const;
virtual Blob::Ptr createROI(
const std::vector<std::size_t>& begin,
const std::vector<std::size_t>& end
) const;
Detailed Documentation¶
This class represents a blob that contains other blobs.
Compound blob is a wrapper blob over references to underlying blobs. These blobs should share some properties and can be grouped into a single entity.
Typedefs¶
typedef std::shared_ptr<CompoundBlob> Ptr
A smart pointer to the CompoundBlob object.
typedef std::shared_ptr<const CompoundBlob> CPtr
A smart pointer to the const CompoundBlob object.
Construction¶
CompoundBlob(const std::vector<Blob::Ptr>& blobs)
Constructs a compound blob from a vector of blobs.
Parameters:
blobs |
A vector of blobs that is copied to this object |
CompoundBlob(std::vector<Blob::Ptr>&& blobs)
Constructs a compound blob from a vector of blobs.
Parameters:
blobs |
A vector of blobs that is moved to this object |
Methods¶
virtual size_t byteSize() const
Always returns 0
Returns:
Returns 0
virtual size_t element_size() const
Always returns 0
Returns:
Returns 0
virtual void allocate()
No operation is performed. Compound blob does not allocate/deallocate any data.
virtual bool deallocate()
No operation is performed. Compound blob does not allocate/deallocate any data.
Returns:
Returns false
virtual size_t size() const
Returns the number of underlying blobs in the compound blob.
Returns:
A number of underlying blobs
virtual Blob::Ptr getBlob(size_t i) const
Returns an underlying blob at index i.
Parameters:
i |
the index of the underlying Blob object |
Returns:
A smart pointer to the underlying Blob object or nullptr in case of an error
Creates a blob describing given ROI object based on the current blob with memory sharing.
Note: default implementation throws “not implemented” exception.
Parameters:
roi |
A ROI object inside of the current blob. |
Returns:
A shared pointer to the newly created ROI blob.