ONE - On-device Neural Engine
Loading...
Searching...
No Matches
moco::tf::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::tf::test::find_first_node_bytype ( loco::Graph g)

Definition at line 33 of file TestHelper.h.

34{
35 T *first_node = nullptr;
36 loco::Graph::NodeContext *nodes = g->nodes();
37 uint32_t count = nodes->size();
38
39 for (uint32_t i = 0; i < count; ++i)
40 {
41 first_node = dynamic_cast<T *>(nodes->at(i));
42 if (first_node != nullptr)
43 break;
44 }
45
46 return first_node;
47}
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::tf::test::find_nodes_bytype ( loco::Graph g)

Definition at line 49 of file TestHelper.h.

50{
51 std::vector<T *> find_nodes;
52 loco::Graph::NodeContext *nodes = g->nodes();
53 uint32_t count = nodes->size();
54
55 for (uint32_t i = 0; i < count; ++i)
56 {
57 auto node = dynamic_cast<T *>(nodes->at(i));
58 if (node != nullptr)
59 find_nodes.push_back(node);
60 }
61
62 return find_nodes;
63}

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

◆ setup_output_node()

void moco::tf::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