Mila
Deep Neural Network Library
Loading...
Searching...
No Matches
Mila::Dnn::Serialization::TensorBlob< MR > Struct Template Referenceexport

Concrete tensor blob owning a TensorBuffer-backed raw byte buffer. More...

Inheritance diagram for Mila::Dnn::Serialization::TensorBlob< MR >:
Mila::Dnn::Serialization::ITensorBlob

Public Member Functions

 TensorBlob (const TensorBlob &)=delete
 TensorBlob (TensorBlob &&)=default
 TensorBlob (TensorMetadata meta, TensorBuffer< dtype_t::UINT8, MR > buf)
const void * data () const noexcept override
const TensorMetadatagetMetadata () const noexcept override
TensorBlob & operator= (const TensorBlob &)=delete
TensorBlob & operator= (TensorBlob &&)=default
size_t sizeBytes () const noexcept override
Public Member Functions inherited from Mila::Dnn::Serialization::ITensorBlob
 ITensorBlob (const ITensorBlob &)=delete
 ITensorBlob (ITensorBlob &&)=default
ITensorBlob & operator= (const ITensorBlob &)=delete
ITensorBlob & operator= (ITensorBlob &&)=default

Public Attributes

TensorBuffer< dtype_t::UINT8, MR > data_buffer
TensorMetadata metadata

Detailed Description

template<typename MR = Compute::CpuMemoryResource>
requires isValidTensor<dtype_t::UINT8, MR>
struct Mila::Dnn::Serialization::TensorBlob< MR >

Concrete tensor blob owning a TensorBuffer-backed raw byte buffer.

The memory resource controls the allocation strategy:

TensorBlob<CpuMemoryResource> – pageable host memory (default) TensorBlob<CudaPinnedMemoryResource> – pinned host memory; copyFromBlob issues a direct DMA to device with no hidden driver staging

Template Parameters
MRMemory resource type. Must satisfy isValidTensor<UINT8, MR>.

Member Function Documentation

◆ data()

template<typename MR = Compute::CpuMemoryResource>
const void * Mila::Dnn::Serialization::TensorBlob< MR >::data ( ) const
inlineoverridevirtualnoexcept

◆ getMetadata()

template<typename MR = Compute::CpuMemoryResource>
const TensorMetadata & Mila::Dnn::Serialization::TensorBlob< MR >::getMetadata ( ) const
inlineoverridevirtualnoexcept

◆ sizeBytes()

template<typename MR = Compute::CpuMemoryResource>
size_t Mila::Dnn::Serialization::TensorBlob< MR >::sizeBytes ( ) const
inlineoverridevirtualnoexcept

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