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

NHWC Kernel Layout. More...

#include <KernelLayouts.h>

Collaboration diagram for coco::KernelLayouts::NHWC:

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< NHWCcreate (const nncc::core::ADT::kernel::Shape &shape)
 

Detailed Description

NHWC Kernel Layout.

Definition at line 61 of file KernelLayouts.h.

Member Function Documentation

◆ at()

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

Implements coco::KernelLayout.

Definition at line 78 of file KernelLayouts.cpp.

79{
80 static NHWCLayout l;
81 return ElemID{l.offset(_shape, n, ch, row, col)};
82}

◆ create()

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

Definition at line 84 of file KernelLayouts.cpp.

85{
86 // NOTE It is impossible to use make_unique here as the constructor is private
87 return std::unique_ptr<NHWC>{new NHWC{shape}};
88}
const nncc::core::ADT::kernel::Shape & shape(void) const override

References shape().

Referenced by tflimport::Conv2DGraphBuilder::build(), and tflimport::DepthwiseConv2DGraphBuilder::build().

◆ id()

const KernelLayout::ID * coco::KernelLayouts::NHWC::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 71 of file KernelLayouts.h.

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

References uid().

Referenced by uid().

◆ shape()

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

◆ uid()

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

Definition at line 69 of file KernelLayouts.cpp.

70{
71 struct LayoutID final : public KernelLayout::ID
72 {
73 };
74 static LayoutID id;
75 return &id;
76}
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: