ONE - On-device Neural Engine
Loading...
Searching...
No Matches
luci::pass::Expression Struct Referencefinal

#include <ExpressionCache.h>

Collaboration diagram for luci::pass::Expression:

Data Structures

struct  Hash
 

Static Public Member Functions

static Expression build (luci::CircleNode *node)
 

Data Fields

std::vector< loco::Node * > inputs
 
luci::CircleNodeop = nullptr
 

Detailed Description

Definition at line 31 of file ExpressionCache.h.

Member Function Documentation

◆ build()

Expression luci::pass::Expression::build ( luci::CircleNode node)
static

Definition at line 169 of file ExpressionCache.cpp.

170{
171 if (node == nullptr)
172 throw std::invalid_argument("node");
173
174 Expression key;
175 {
176 switch (node->opcode())
177 {
178 case luci::CircleOpcode::QUANTIZE:
179 case luci::CircleOpcode::TRANSPOSE:
180 key.inputs.emplace_back(node->arg(0));
181 break;
182 // TODO Add more Ops
183 default:
184 // NYI. Return invalid expression
185 key.op = nullptr;
186 return key;
187 }
188
189 key.op = node;
190 }
191
192 return key;
193}
virtual Node * arg(uint32_t N) const =0
Access N-th argument node.
virtual CircleOpcode opcode(void) const =0

References loco::Node::arg(), inputs, op, and luci::CircleNode::opcode().

Referenced by luci::CommonSubExpressionEliminationPass::run().

Field Documentation

◆ inputs

std::vector<loco::Node *> luci::pass::Expression::inputs

◆ op

luci::CircleNode* luci::pass::Expression::op = nullptr

Definition at line 40 of file ExpressionCache.h.

Referenced by build(), and luci::pass::operator==().


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