ONE - On-device Neural Engine
Loading...
Searching...
No Matches
luci::ConstantFoldingAddTestGraph Class Reference

#include <PassTestGraphs.h>

Collaboration diagram for luci::ConstantFoldingAddTestGraph:

Protected Member Functions

 ConstantFoldingAddTestGraph (std::vector< uint32_t > input_shape, loco::DataType input_dtype)
 
void init () override
 
luci::CircleConstgetFoldedPattern () override
 

Protected Attributes

luci::CircleAdd_add = nullptr
 
- Protected Attributes inherited from luci::ConstantFoldingTestGraph
loco::Graph _g
 
luci::CircleInput_input = nullptr
 
luci::CircleOutput_output = nullptr
 

Additional Inherited Members

- Public Member Functions inherited from luci::ConstantFoldingTestGraph
 ConstantFoldingTestGraph (std::vector< uint32_t > input_shape, loco::DataType input_dtype)
 
virtual ~ConstantFoldingTestGraph ()=default
 
virtual loco::NodecreateFoldedPattern ()=0
 
loco::Graphgraph ()
 

Detailed Description

ConstantFoldingTestAddGraph is ConstantFoldingTestGraph whose Connector is Add.

Definition at line 110 of file PassTestGraphs.h.

Constructor & Destructor Documentation

◆ ConstantFoldingAddTestGraph()

luci::ConstantFoldingAddTestGraph::ConstantFoldingAddTestGraph ( std::vector< uint32_t >  input_shape,
loco::DataType  input_dtype 
)
inlineprotected

Definition at line 113 of file PassTestGraphs.h.

114 : ConstantFoldingTestGraph(input_shape, input_dtype)
115 {
117 _add->dtype(input_dtype);
118
119 _add->rank(input_shape.size());
120 for (int i = 0; i < input_shape.size(); i++)
121 _add->dim(i).set(input_shape[i]);
122
123 _add->x(_input);
124
125 _output->from(_add);
126
127 _add->name("add");
128 }
NodeContext * nodes(void)
Definition Graph.h:218
Derived * create(Args &&...args)
Definition NodePool.h:37
ADD in Circle.
Definition CircleAdd.h:34
loco::Node * x(void) const
Definition CircleAdd.h:36
loco::Node * from(void) const
ConstantFoldingTestGraph(std::vector< uint32_t > input_shape, loco::DataType input_dtype)
NodeName name(void) const

References _add, luci::ConstantFoldingTestGraph::_g, luci::ConstantFoldingTestGraph::_input, luci::ConstantFoldingTestGraph::_output, loco::NodePool::create(), luci::CircleOutput::from(), luci::CircleNode::name(), loco::Graph::nodes(), and luci::CircleAdd::x().

Member Function Documentation

◆ getFoldedPattern()

luci::CircleConst * luci::ConstantFoldingAddTestGraph::getFoldedPattern ( )
inlineoverrideprotectedvirtual

Implements luci::ConstantFoldingTestGraph.

Definition at line 134 of file PassTestGraphs.h.

135 {
136 return dynamic_cast<luci::CircleConst *>(_add->y());
137 }
loco::Node * y(void) const
Definition CircleAdd.h:39
Class to build tensor data.
Definition CircleConst.h:35

References _add, and luci::CircleAdd::y().

◆ init()

void luci::ConstantFoldingAddTestGraph::init ( )
inlineoverrideprotectedvirtual

Field Documentation

◆ _add

luci::CircleAdd* luci::ConstantFoldingAddTestGraph::_add = nullptr
protected

Definition at line 140 of file PassTestGraphs.h.

Referenced by ConstantFoldingAddTestGraph(), getFoldedPattern(), and init().


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