ONE - On-device Neural Engine
|
Index-wise element transfer between two objects. More...
#include <Instrs.h>
Public Member Functions | |
Copy () | |
Copy * | asCopy (void) override |
const Copy * | asCopy (void) const override |
Instr * | loc (void) override |
Object * | from (void) const |
void | from (Object *o) |
Object * | into (void) const |
void | into (Object *o) |
Public Member Functions inherited from coco::Instr | |
Instr ()=default | |
Instr (const Instr &)=delete | |
Instr (Instr &&)=delete | |
virtual | ~Instr () |
template<typename T > | |
T | accept (IVisitor< T > *v) const |
template<typename T > | |
T | accept (IVisitor< T > &v) const |
template<typename T > | |
T | accept (IVisitor< T > &&v) const |
const InstrIndex & | index (void) const |
Public Member Functions inherited from coco::DLinkedList< Child, Parent >::Node | |
Node () | |
virtual | ~Node () |
Parent * | parent (void) const |
Child * | prev (void) const |
Child * | next (void) const |
void | insertBefore (Node *next) |
void | insertAfter (Node *prev) |
void | detach (void) |
Public Member Functions inherited from coco::Entity | |
virtual | ~Entity ()=default |
Module * | module (void) const |
Public Member Functions inherited from coco::Object::Producer | |
virtual | ~Producer ()=default |
Public Member Functions inherited from coco::Bag::Updater | |
virtual | ~Updater ()=default |
Public Member Functions inherited from coco::Locatable | |
virtual | ~Locatable ()=default |
Public Member Functions inherited from coco::Object::Consumer | |
virtual | ~Consumer ()=default |
Public Member Functions inherited from coco::Bag::Reader | |
virtual | ~Reader ()=default |
Index-wise element transfer between two objects.
Given two objects "src" and "dst" of the same kind/shape, "copy(src, dst)" denotes index-wise element transfer.
For example, the following pseudo-code describes "copy(src, dat)" when both src and dst are a feature map of the shape B x C x H x W:
for each valid index b, ch, row, col: load the "src->at(b, ch, row, col)"-th element from bag(src) store it as the "dst->at(b, ch, row, col)"-th element of bag(dst)
In principle, "copy" is unnecessary as it is always possible to rewrite "copy" as a "shuffle" below. However, "shuffle"-based optimization is too heavy as it requires much of iterations.
|
inline |
|
inlineoverride |
|
inlineoverride |
|
inline |
|
inline |
Definition at line 100 of file Instrs.h.
References coco::Use::value().
Referenced by InstrBuilder::copy(), and InstrPrinter::visit().
|
inline |
|
inline |
Definition at line 104 of file Instrs.h.
References coco::Def::value().
Referenced by InstrPrinter::visit().
|
inlineoverridevirtual |