Mila
Deep Neural Network Library
Loading...
Searching...
No Matches
Mila::Dnn::Serialization::TensorBlobView Struct Referenceexport

Non-owning ITensorBlob view over externally-owned bytes. More...

Inheritance diagram for Mila::Dnn::Serialization::TensorBlobView:
Mila::Dnn::Serialization::ITensorBlob

Public Member Functions

 TensorBlobView (TensorMetadata meta, const void *data_ptr, size_t byte_count)
const void * data () const noexcept override
const TensorMetadatagetMetadata () const noexcept override
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

size_t bytes { 0 }
TensorMetadata metadata
const void * ptr { nullptr }

Detailed Description

Non-owning ITensorBlob view over externally-owned bytes.

Carries metadata plus a borrowed host pointer; it allocates and owns nothing. Used by PretrainedModelReader to hand out blobs that point either into a memory-mapped file region or into a reusable pinned staging buffer. The referenced memory MUST outlive the view, and the view is only valid until the owner reuses or releases that memory.

Member Function Documentation

◆ data()

const void * Mila::Dnn::Serialization::TensorBlobView::data ( ) const
inlineoverridevirtualnoexcept

◆ getMetadata()

const TensorMetadata & Mila::Dnn::Serialization::TensorBlobView::getMetadata ( ) const
inlineoverridevirtualnoexcept

◆ sizeBytes()

size_t Mila::Dnn::Serialization::TensorBlobView::sizeBytes ( ) const
inlineoverridevirtualnoexcept

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