ONE - On-device Neural Engine
Loading...
Searching...
No Matches
moco::test Namespace Reference

Data Structures

class  TFNodeBuildTester
 

Functions

template<typename T >
T * find_first_node_bytype (loco::Graph *g)
 
template<typename T >
std::vector< T * > find_nodes_bytype (loco::Graph *g)
 
void setup_output_node (loco::Graph *graph, loco::Node *last_node)
 Append setup output of graph by adding loco::Push node.
 

Function Documentation

◆ find_first_node_bytype()

template<typename T >
T * moco::test::find_first_node_bytype ( loco::Graph g)

Definition at line 35 of file TestHelper.h.

36{
37 T *first_node = nullptr;
38 loco::Graph::NodeContext *nodes = g->nodes();
39 uint32_t count = nodes->size();
40
41 for (uint32_t i = 0; i < count; ++i)
42 {
43 first_node = dynamic_cast<T *>(nodes->at(i));
44 if (first_node != nullptr)
45 break;
46 }
47
48 return first_node;
49}
T * at(uint32_t n) const
Access N-th object.
Definition ObjectPool.h:41
uint32_t size(void) const
Return the number of objects.
Definition ObjectPool.h:38

References loco::ObjectPool< T >::at(), and loco::ObjectPool< T >::size().

◆ find_nodes_bytype()

template<typename T >
std::vector< T * > moco::test::find_nodes_bytype ( loco::Graph g)

Definition at line 42 of file TestHelper.h.

43{
44 std::vector<T *> find_nodes;
45
46 for (auto node : loco::active_nodes(loco::output_nodes(g)))
47 {
48 if (auto T_node = as<T>(node))
49 {
50 find_nodes.push_back(T_node);
51 }
52 }
53
54 return find_nodes;
55}

References loco::active_nodes(), and loco::output_nodes().

◆ setup_output_node()

void moco::test::setup_output_node ( loco::Graph graph,
loco::Node last_node 
)

Append setup output of graph by adding loco::Push node.

Note
This is subject to change when loco changes I/O treatment