ONE - On-device Neural Engine
Loading...
Searching...
No Matches
coco::PlainWeightContext< T > Struct Template Referenceabstract

Non-quantized (plain) Weight Data Accessor. More...

#include <PlainWeightContext.h>

Public Member Functions

virtual ~PlainWeightContext ()=default
 
virtual Span< T > allocate (const Bag *)=0
 Allocate a weight space for a given blob.
 
virtual Span< T > weight (const Bag *)=0
 Return a pointer to the underlying storage.
 
virtual std::unique_ptr< nncc::core::ADT::kernel::Accessor< T > > access (const KernelObject *)=0
 
virtual std::unique_ptr< nncc::core::ADT::kernel::Reader< T > > read (const KernelObject *) const =0
 

Detailed Description

template<typename T>
struct coco::PlainWeightContext< T >

Non-quantized (plain) Weight Data Accessor.

Definition at line 36 of file PlainWeightContext.h.

Constructor & Destructor Documentation

◆ ~PlainWeightContext()

template<typename T >
virtual coco::PlainWeightContext< T >::~PlainWeightContext ( )
virtualdefault

Member Function Documentation

◆ access()

template<typename T >
virtual std::unique_ptr< nncc::core::ADT::kernel::Accessor< T > > coco::PlainWeightContext< T >::access ( const KernelObject )
pure virtual

◆ allocate()

template<typename T >
virtual Span< T > coco::PlainWeightContext< T >::allocate ( const Bag )
pure virtual

Allocate a weight space for a given blob.

@require the following code SHOULD work for any bag "b": PlainWeightContext<T> ctx;

auto span = ctx.allocate(b); assert(span.data() != nullptr); assert(span.size() == bag->size());

◆ read()

template<typename T >
virtual std::unique_ptr< nncc::core::ADT::kernel::Reader< T > > coco::PlainWeightContext< T >::read ( const KernelObject ) const
pure virtual

◆ weight()

template<typename T >
virtual Span< T > coco::PlainWeightContext< T >::weight ( const Bag )
pure virtual

Return a pointer to the underlying storage.

Note
weight returns a null-span S for an invalid bag i.e S.data() == nullptr and S.size() == 0

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