ONE - On-device Neural Engine
|
Class to substitute PadV2 in certain condition to Pad. More...
#include <SubstitutePadV2ToPadPass.h>
Public Member Functions | |
const char * | name (void) const final |
bool | run (loco::Graph *g) final |
Public Member Functions inherited from logo::Pass | |
virtual | ~Pass ()=default |
Class to substitute PadV2 in certain condition to Pad.
Definition at line 28 of file SubstitutePadV2ToPadPass.h.
|
inlinefinalvirtual |
Reimplemented from logo::Pass.
Definition at line 30 of file SubstitutePadV2ToPadPass.h.
|
finalvirtual |
Case 1) Basic case
BEFORE [CircleRelu] | | [CircleConst] [CircleConst] | | | ----—+-------------------— | [CirclePadV2] | [CircleMaxPool2D] |
AFTER [CircleRelu] | | [CircleConst] [CircleNode] [CircleConst] | | | | | ----—+----— ----------—+-----------—+ | | [CirclePad] [CirclePadV2] | [CircleMaxPool2D] |
Case 2) During conversion from a PyTorch model into a Circle model, it is common that some 'Reshaping op', e.g., CircleTranspose, are inserted in-between operations to swith NCHW into NHWC and vice versa. This pass also needs to handle such situation.
BEFORE [CircleRelu] | | [CircleConst] [CircleConst] | | | ----—+-------------------— | [CircleTranspose] | [CirclePadV2] | [CircleTranspose] | [CircleMaxPool2D] |
AFTER [CircleRelu] | | [CircleConst] [CircleNode] [CircleConst] | | | | | ----—+----— ----------—+-----------—+ | | [CircleTranspose] [CirclePadV2] | [CirclePad] | [CircleTranspose] | [CircleMaxPool2D] |
Implements logo::Pass.
Definition at line 453 of file SubstitutePadV2ToPadPass.cpp.
References loco::active_nodes(), and loco::output_nodes().
Referenced by package.infer.session::inference().