ONE - On-device Neural Engine
Loading...
Searching...
No Matches
coco::Data Struct Referenceabstract

Core coco entity for constant weights. More...

#include <Data.h>

Public Member Functions

virtual ~Data ()=default
 
virtual bool allocated (const coco::Bag *) const =0
 Return true if a given bag has an allocated weight data.
 
virtual void release (const coco::Bag *)=0
 Release a memory chunk allocated for weight data of a given bag.
 
virtual PlainWeightContext< float > * f32 (void)=0
 
virtual const PlainWeightContext< float > * f32 (void) const =0
 

Static Public Member Functions

static std::unique_ptr< Datacreate (void)
 

Detailed Description

Core coco entity for constant weights.

Definition at line 30 of file Data.h.

Constructor & Destructor Documentation

◆ ~Data()

virtual coco::Data::~Data ( )
virtualdefault

Member Function Documentation

◆ allocated()

virtual bool coco::Data::allocated ( const coco::Bag ) const
pure virtual

Return true if a given bag has an allocated weight data.

◆ create()

std::unique_ptr< Data > coco::Data::create ( void  )
static

Definition at line 202 of file Data.cpp.

203{
204 auto blob = make_unique<BlobContext>();
205 auto fp32 = make_unique<PlainWeightContextImpl<float>>(blob.get());
206
207 auto data = make_unique<DataImpl>();
208
209 data->_blob = std::move(blob);
210 data->_fp32 = std::move(fp32);
211
212 return data;
213}

Referenced by Frontend::load().

◆ f32() [1/2]

virtual const PlainWeightContext< float > * coco::Data::f32 ( void  ) const
pure virtual

◆ f32() [2/2]

virtual PlainWeightContext< float > * coco::Data::f32 ( void  )
pure virtual

◆ release()

virtual void coco::Data::release ( const coco::Bag )
pure virtual

Release a memory chunk allocated for weight data of a given bag.

WARN Do NOT invoke release for a bag "b" for which allocated(b) does NOT hold


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