ONE - On-device Neural Engine
Loading...
Searching...
No Matches
exo::test::TestGraph Class Reference

#include <TestGraph.h>

Collaboration diagram for exo::test::TestGraph:

Public Member Functions

 TestGraph ()
 
loco::Graphgraph ()
 
template<class T >
T * append ()
 Creates node with NO arg and appends it to graph.
 
template<class T >
T * append (loco::Node *arg1)
 Creates op T (arity=1) with arg1 as an input and appends it to graph.
 
template<class T >
T * append (loco::Node *arg1, loco::Node *arg2)
 Creates op T (arity=2) with arg1, arg2 as inputs and appends it to graph.
 
template<class T >
T * append (loco::Node *arg1, loco::Node *arg2, loco::Node *arg3)
 Creates op T (arity=3) with arg1, arg2, arg3 as inputs and appends it to graph.
 
void complete ()
 
void complete (loco::Node *last_node)
 

Data Fields

std::unique_ptr< loco::Graphg
 
loco::Pullpull
 
loco::Pushpush
 

Detailed Description

Definition at line 33 of file TestGraph.h.

Constructor & Destructor Documentation

◆ TestGraph()

exo::test::TestGraph::TestGraph ( )
inline

Definition at line 40 of file TestGraph.h.

41 {
43
44 pull = g->nodes()->create<loco::Pull>();
45
46 push = g->nodes()->create<loco::Push>();
47
48 auto input = g->inputs()->create();
49 {
50 input->name("input");
51 loco::link(input, pull);
52 }
53 auto output = g->outputs()->create();
54 {
55 output->name("output");
56 loco::link(output, push);
57 }
58
59 _next_input = pull;
60 }
loco::Pull * pull
Definition TestGraph.h:37
loco::Push * push
Definition TestGraph.h:38
std::unique_ptr< loco::Graph > g
Definition TestGraph.h:36
Create a value from user data.
Definition Nodes.h:96
Make a value visible to user.
Definition Nodes.h:53
void link(GraphOutput *, Push *push)
Definition Nodes.cpp:65
std::unique_ptr< Graph > make_graph(void)
Definition Graph.cpp:131

References g, loco::link(), loco::make_graph(), pull, and push.

Member Function Documentation

◆ append() [1/4]

template<class T >
T * exo::test::TestGraph::append ( )
inline

Creates node with NO arg and appends it to graph.

Definition at line 65 of file TestGraph.h.

66 {
67 auto node = g->nodes()->create<T>();
68 _next_input = node;
69
70 return node;
71 }

References g.

◆ append() [2/4]

template<class T >
T * exo::test::TestGraph::append ( loco::Node arg1)
inline

Creates op T (arity=1) with arg1 as an input and appends it to graph.

Definition at line 74 of file TestGraph.h.

75 {
76 auto node = g->nodes()->create<T>();
77 setInput(node, arg1);
78 _next_input = node;
79
80 return node;
81 }

References g.

◆ append() [3/4]

template<class T >
T * exo::test::TestGraph::append ( loco::Node arg1,
loco::Node arg2 
)
inline

Creates op T (arity=2) with arg1, arg2 as inputs and appends it to graph.

Definition at line 84 of file TestGraph.h.

85 {
86 auto node = g->nodes()->create<T>();
87 setInput(node, arg1, arg2);
88 _next_input = node;
89
90 return node;
91 }

References g.

◆ append() [4/4]

template<class T >
T * exo::test::TestGraph::append ( loco::Node arg1,
loco::Node arg2,
loco::Node arg3 
)
inline

Creates op T (arity=3) with arg1, arg2, arg3 as inputs and appends it to graph.

Definition at line 94 of file TestGraph.h.

95 {
96 auto node = g->nodes()->create<T>();
97 setInput(node, arg1, arg2, arg3);
98 _next_input = node;
99
100 return node;
101 }

References g.

◆ complete() [1/2]

void exo::test::TestGraph::complete ( )
inline

Definition at line 104 of file TestGraph.h.

104{ push->from(_next_input); }
Node * from(void) const
Definition Nodes.h:58

References loco::Push::from(), and push.

◆ complete() [2/2]

void exo::test::TestGraph::complete ( loco::Node last_node)
inline

Definition at line 106 of file TestGraph.h.

106{ push->from(last_node); }

References loco::Push::from(), and push.

◆ graph()

loco::Graph * exo::test::TestGraph::graph ( )
inline

Definition at line 62 of file TestGraph.h.

62{ return g.get(); }

References g.

Referenced by TopologicalSortHelper.TopologicalSortHelper::add_edge(), and TopologicalSortHelper.TopologicalSortHelper::sort_util().

Field Documentation

◆ g

std::unique_ptr<loco::Graph> exo::test::TestGraph::g

Definition at line 36 of file TestGraph.h.

Referenced by append(), append(), append(), append(), graph(), and TestGraph().

◆ pull

loco::Pull* exo::test::TestGraph::pull

Definition at line 37 of file TestGraph.h.

Referenced by TestGraph().

◆ push

loco::Push* exo::test::TestGraph::push

Definition at line 38 of file TestGraph.h.

Referenced by complete(), complete(), and TestGraph().


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