ONE - On-device Neural Engine
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
nncc::core::ADT::feature Namespace Reference

Data Structures

struct  Accessor
 
class  Buffer
 
struct  CHWLayout
 
struct  HWCLayout
 
class  Layout
 
class  Overlay
 
struct  Reader
 
class  Shape
 
class  View
 

Functions

template<typename T , typename LayoutImpl >
Buffer< T > make_buffer (const Shape &shape)
 
template<typename T , typename LayoutImpl >
Overlay< T > make_overlay (const Shape &shape, T *base)
 
uint32_t num_elements (const Shape &shape)
 The number of elements of a feature map of a given shape.
 
bool operator== (const Shape &l, const Shape &r)
 

Function Documentation

◆ make_buffer()

template<typename T , typename LayoutImpl >
Buffer< T > nncc::core::ADT::feature::make_buffer ( const Shape shape)

Definition at line 49 of file Buffer.h.

50{
51 return Buffer<T>{shape, LayoutImpl{}};
52}

References make_buffer().

Referenced by make_buffer().

◆ make_overlay()

template<typename T , typename LayoutImpl >
Overlay< T > nncc::core::ADT::feature::make_overlay ( const Shape shape,
T *  base 
)

Definition at line 50 of file Overlay.h.

51{
52 return Overlay<T>{shape, LayoutImpl{}, base};
53}

◆ num_elements()

uint32_t nncc::core::ADT::feature::num_elements ( const Shape shape)
inline

The number of elements of a feature map of a given shape.

WARN The result is valid only when the expected value is less than 2^32 - 1

Definition at line 59 of file Shape.h.

60{
61 return shape.depth() * shape.height() * shape.width();
62}
uint32_t depth(void) const
Definition Shape.h:44
uint32_t width(void) const
Definition Shape.h:46
uint32_t height(void) const
Definition Shape.h:45

References nncc::core::ADT::feature::Shape::depth(), nncc::core::ADT::feature::Shape::height(), num_elements(), and nncc::core::ADT::feature::Shape::width().

Referenced by coco::FeatureLayouts::BCHW::at(), coco::FeatureLayouts::BHWC::at(), and num_elements().

◆ operator==()

bool nncc::core::ADT::feature::operator== ( const Shape l,
const Shape r 
)
inline

Definition at line 64 of file Shape.h.

65{
66 return (l.depth() == r.depth()) && (l.height() == r.height()) && (l.width() == r.width());
67}