ONE - On-device Neural Engine
|
#include <NodeFiller.h>
Public Member Functions | |
NodeFiller (ARG_TYPE_1 **arg_1, ARG_TYPE_2 **arg_2) | |
template<class COMM_NODE > | |
bool | with_commutative_args_of (const COMM_NODE *node) |
template<class COMM_NODE > | |
bool | with_args_of (const COMM_NODE *node) |
INTRODUCTION Binary operation f(x,y) is 'commutative' when f(x,y) == f(y,x) holds for all x, y. For examples, ADD, MUL and SQUARED_DIFFERENCE are commutative. These helpers make it easy to find commutative arguments of commutative node.
HOW TO USE COMM_NODE *node; ARG_TYPE_1 *arg1; ARG_TYPE_2 *arg2;
bool ok = fill(&arg1, &arg2).with_commutative_args_of(node);
Result If 'node's commutative argument types are actually {ARG_TYPE_1, ARG_TYPE_2} (as a set), 'arg1' and 'arg2' set as actual 'node's arguments with matching type, and return value 'ok' is true. Otherwise, 'arg1' and 'arg2' not changed, 'ok' is false.
Definition at line 41 of file NodeFiller.h.
|
inline |
Definition at line 44 of file NodeFiller.h.
bool luci::NodeFiller< ARG_TYPE_1, ARG_TYPE_2 >::with_args_of | ( | const COMM_NODE * | node | ) |
Definition at line 112 of file NodeFiller.h.
bool luci::NodeFiller< ARG_TYPE_1, ARG_TYPE_2 >::with_commutative_args_of | ( | const COMM_NODE * | node | ) |
@require COMM_NODE has member x() and y()
Definition at line 79 of file NodeFiller.h.