ONE - On-device Neural Engine
Loading...
Searching...
No Matches
ShapeQuery Class Reference

A wrapper class that allows additional queries over tensor shape. More...

#include <ShapeQuery.h>

Public Member Functions

 ShapeQuery (const nncc::core::ADT::tensor::Shape *shape)
 
uint32_t axis (const AxisSpecifier &) const
 Return the dimension number (axis) specified by a given axis specifier.
 

Detailed Description

A wrapper class that allows additional queries over tensor shape.

Definition at line 57 of file ShapeQuery.h.

Constructor & Destructor Documentation

◆ ShapeQuery()

ShapeQuery::ShapeQuery ( const nncc::core::ADT::tensor::Shape shape)
inlineexplicit

Definition at line 60 of file ShapeQuery.h.

60 : _shape{shape}
61 {
62 // DO NOTHING
63 }

Member Function Documentation

◆ axis()

uint32_t ShapeQuery::axis ( const AxisSpecifier specifier) const

Return the dimension number (axis) specified by a given axis specifier.

Definition at line 29 of file ShapeQuery.cpp.

30{
31 if (specifier.value() > 0)
32 {
33 return static_cast<uint32_t>(specifier.value());
34 }
35
36 assert(_shape->rank() >= static_cast<uint32_t>(-specifier.value()));
37 return static_cast<uint32_t>(_shape->rank() + specifier.value());
38}
int32_t value(void) const
Definition ShapeQuery.h:46
uint32_t rank(void) const
Definition Shape.cpp:35

References nncc::core::ADT::tensor::Shape::rank(), and AxisSpecifier::value().

Referenced by ConvolutionSpec::channel_axis().


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