|
ONE - On-device Neural Engine
|
2D Max Pooling More...
#include <Nodes.h>

Public Member Functions | |
| Node * | ifm (void) const |
| void | ifm (Node *node) |
| const Padding2D * | pad (void) const |
| Padding2D * | pad (void) |
| const Window< 2 > * | window (void) const |
| Window< 2 > * | window (void) |
| const Stride< 2 > * | stride (void) const |
| Stride< 2 > * | stride (void) |
Public Member Functions inherited from loco::CanonicalNodeDef< CanonicalOpcode::MaxPool2D, FixedArity< 1 >::Mixin > | |
| virtual | ~CanonicalNodeDef ()=default |
| uint32_t | opnum (void) const final |
| CanonicalOpcode | opcode (void) const final |
Public Member Functions inherited from loco::CanonicalNode | |
| virtual | ~CanonicalNode ()=default |
| const Dialect * | dialect (void) const final |
| Return "Dialect" identifier that this node belongs to. | |
| template<typename T > | |
| T | accept (CanonicalNodeVisitorBase< T > *) const |
| template<typename T > | |
| T | accept (CanonicalNodeMutableVisitorBase< T > *) |
Public Member Functions inherited from loco::Node | |
| Node ()=default | |
| Node (const Node &)=delete | |
| Node (Node &&)=delete | |
| virtual | ~Node () |
| Graph * | graph (void) |
| const Graph * | graph (void) const |
| virtual uint32_t | arity (void) const =0 |
| Return the number of arguments. | |
| virtual Node * | arg (uint32_t N) const =0 |
| Access N-th argument node. | |
| virtual void | drop (void)=0 |
| Drop all the reference of arguments. | |
Public Member Functions inherited from loco::AnnotatedItem< NodeAnnotation > | |
| AnnotatedItem ()=default | |
| virtual | ~AnnotatedItem ()=default |
| const T * | annot (void) const |
| Retrieve a stored annotation of type T. | |
| void | annot (std::unique_ptr< T > &&p) |
| Attach or remove a new annotation of type T. | |
2D Max Pooling
MaxPool2D takes as input a feature map, and produces another feature map
Any valid MaxPool2D nodes SHOULD satisfy the following conditions.
Let us define several helper functions that takes a MaxPool2D nodes first:
Condition 1 Statement
A valid MaxPool2D node M SHOULD satisfy the following condition:
Motivation
There are many possible ways to encode a feature map as a tensor.
In order to give some freedom on memory layout to backend, loco requires a feature map value to be explicitly encoded via FeatureEncode.
Condition 2: Statement
A valid MaxPool2D node M SHOULD satisfy the following conditions:
Motivation
The output shape may differ for each NN framework when these conditions do not hold.
In order to mitigate such a difference among NN frameworks, loco requires these conditions for MaxPool2D nodes.
This means that each frontend implementation SHOULD insert appropriate padding/trimming node
Definition at line 307 of file Nodes.h.
Referenced by exo::MaxPool2DConverter::convert(), GraphTestcase< GraphCode::MaxPool2D >::GraphTestcase(), and mir2loco::Transformer::visit().
Definition at line 311 of file Nodes.h.
Referenced by exo::MaxPool2DConverter::convert().
Definition at line 319 of file Nodes.h.
Referenced by exo::MaxPool2DConverter::convert().
Definition at line 315 of file Nodes.h.
Referenced by exo::MaxPool2DConverter::convert().