ONE - On-device Neural Engine
Loading...
Searching...
No Matches
coco::KernelLayouts::NCHW Class Referencefinal

NCHW Kernel Layout. More...

#include <KernelLayouts.h>

Collaboration diagram for coco::KernelLayouts::NCHW:

Public Member Functions

const KernelLayout::IDid (void) const override
 Return the identifier of each layout.
 
const nncc::core::ADT::kernel::Shapeshape (void) const override
 
ElemID at (uint32_t n, uint32_t ch, uint32_t row, uint32_t col) const override
 
- Public Member Functions inherited from coco::KernelLayout
virtual ~KernelLayout ()=default
 

Static Public Member Functions

static const KernelLayout::IDuid (void)
 
static std::unique_ptr< NCHWcreate (const nncc::core::ADT::kernel::Shape &shape)
 

Detailed Description

NCHW Kernel Layout.

Definition at line 35 of file KernelLayouts.h.

Member Function Documentation

◆ at()

ElemID coco::KernelLayouts::NCHW::at ( uint32_t  n,
uint32_t  ch,
uint32_t  row,
uint32_t  col 
) const
overridevirtual

Implements coco::KernelLayout.

Definition at line 46 of file KernelLayouts.cpp.

47{
48 static NCHWLayout l;
49 return ElemID{l.offset(_shape, n, ch, row, col)};
50}

◆ create()

std::unique_ptr< NCHW > coco::KernelLayouts::NCHW::create ( const nncc::core::ADT::kernel::Shape shape)
static

Definition at line 52 of file KernelLayouts.cpp.

53{
54 // NOTE It is impossible to use make_unique here as the constructor is private
55 return std::unique_ptr<NCHW>{new NCHW{shape}};
56}
const nncc::core::ADT::kernel::Shape & shape(void) const override

References shape().

◆ id()

const KernelLayout::ID * coco::KernelLayouts::NCHW::id ( void  ) const
inlineoverridevirtual

Return the identifier of each layout.

REQUIRED

Given l1 and l2 of KernelLayout * type, typeid(*l1) == typeif(*l2) SHOULD hold if l1->id() == l2->id() holds.

Implements coco::KernelLayout.

Definition at line 45 of file KernelLayouts.h.

45{ return uid(); }
static const KernelLayout::ID * uid(void)

References uid().

Referenced by uid().

◆ shape()

const nncc::core::ADT::kernel::Shape & coco::KernelLayouts::NCHW::shape ( void  ) const
inlineoverridevirtual

◆ uid()

const KernelLayout::ID * coco::KernelLayouts::NCHW::uid ( void  )
static

Definition at line 37 of file KernelLayouts.cpp.

38{
39 struct LayoutID final : public KernelLayout::ID
40 {
41 };
42 static LayoutID id;
43 return &id;
44}
const KernelLayout::ID * id(void) const override
Return the identifier of each layout.

References id().

Referenced by id().


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