ONE - On-device Neural Engine
Loading...
Searching...
No Matches
luci::CommonSubExpressionEliminationTestGraph Class Referenceabstract

#include <PassTestGraphs.h>

Collaboration diagram for luci::CommonSubExpressionEliminationTestGraph:

Public Member Functions

virtual void init (const std::initializer_list< test::ShapeU32 > shape_in, const std::initializer_list< test::ShapeU32 > shape_out)
 
virtual ~CommonSubExpressionEliminationTestGraph ()=default
 
virtual loco::NodecreateExpression (luci::CircleNode *ifm, const std::string &name)=0
 

Detailed Description

CommonSubExpressionEliminationTestGraph is a base class for testing common subexpression elimination pass. It creates Input and Output in the below graph. Child classes must implement Expression.

     [Input]
     /     \

[Expression] [Expression] | | [Output 1] [Output 2]

Expression should satisfy the below conditions

  • Input type == Output type
  • Input shape == Output shape
  • Expression 1 and 2 are semantically equal

Definition at line 159 of file PassTestGraphs.h.

Constructor & Destructor Documentation

◆ ~CommonSubExpressionEliminationTestGraph()

virtual luci::CommonSubExpressionEliminationTestGraph::~CommonSubExpressionEliminationTestGraph ( )
virtualdefault

Member Function Documentation

◆ createExpression()

virtual loco::Node * luci::CommonSubExpressionEliminationTestGraph::createExpression ( luci::CircleNode ifm,
const std::string &  name 
)
pure virtual

Referenced by init().

◆ init()

virtual void luci::CommonSubExpressionEliminationTestGraph::init ( const std::initializer_list< test::ShapeU32 >  shape_in,
const std::initializer_list< test::ShapeU32 >  shape_out 
)
inlinevirtual

Definition at line 163 of file PassTestGraphs.h.

165 {
166 test::TestIsGraphlet<1>::init(g(), shape_in);
167 test::TestOsGraphlet<2>::init(g(), shape_out);
168
169 auto expr1 = createExpression(input(0), "expr1");
170 auto expr2 = createExpression(input(0), "expr2");
171
172 output(0)->from(expr1);
173 output(1)->from(expr2);
174 }
virtual loco::Node * createExpression(luci::CircleNode *ifm, const std::string &name)=0

References createExpression().


The documentation for this class was generated from the following file: