ONE - On-device Neural Engine
Loading...
Searching...
No Matches
luci::pass Namespace Reference

Data Structures

struct  Expression
 
class  ExpressionCache
 

Functions

bool operator== (const Expression &x, const Expression &y)
 

Function Documentation

◆ operator==()

bool luci::pass::operator== ( const Expression x,
const Expression y 
)

Definition at line 195 of file ExpressionCache.cpp.

196{
197 if (x.inputs != y.inputs)
198 return false;
199
200 // Check general (non-op-specific) attributes
201 if (not same_common_attributes(x.op, y.op))
202 return false;
203
204 assert(x.op->opcode() == y.op->opcode()); // FIX_ME_UNLESS
205
206 // Check op-specific attributes
207 switch (x.op->opcode())
208 {
209 case luci::CircleOpcode::QUANTIZE:
210 {
211 // This Op has no op-specific attribute.
212 // same_common_attributes is enough.
213 return true;
214 }
215 case luci::CircleOpcode::TRANSPOSE:
216 {
217 const auto trans_x = loco::must_cast<luci::CircleTranspose *>(x.op);
218 const auto trans_y = loco::must_cast<luci::CircleTranspose *>(y.op);
219
220 return same_attributes(trans_x, trans_y);
221 }
222 // TODO Implement more operators
223 default:
224 // NYI: Unsupported operators
225 return false;
226 }
227
228 return true;
229}
virtual CircleOpcode opcode(void) const =0
luci::CircleNode * op
std::vector< loco::Node * > inputs

References luci::pass::Expression::inputs, luci::pass::Expression::op, and luci::CircleNode::opcode().