17#ifndef __TEST_HELPER_H__
18#define __TEST_HELPER_H__
22#include <tensorflow/core/framework/graph.pb.h>
24#define STRING_CONTENT(content) #content
35 T *first_node =
nullptr;
37 uint32_t count = nodes->
size();
39 for (uint32_t i = 0; i < count; ++i)
41 first_node =
dynamic_cast<T *
>(nodes->
at(i));
42 if (first_node !=
nullptr)
51 std::vector<T *> find_nodes;
53 uint32_t count = nodes->
size();
55 for (uint32_t i = 0; i < count; ++i)
57 auto node =
dynamic_cast<T *
>(nodes->
at(i));
59 find_nodes.push_back(node);
95 void inputs(
const std::vector<std::string> &names);
102 std::unique_ptr<moco::SymbolTable> _tensor_names;
103 std::unique_ptr<loco::Graph> _graph;
105 std::vector<moco::TFNode *> _inputs;
106 const char *_output{
nullptr};
Logical unit of computation.
T * at(uint32_t n) const
Access N-th object.
uint32_t size(void) const
Return the number of objects.
Interface of convert TF NodeDef to loco::Node (e.g., Conv2DGraphBuilder)
moco::TFNode * output(void)
void output(const char *name)
void inputs(const std::vector< std::string > &names)
void run(tensorflow::NodeDef &node_def, moco::GraphBuilder &graph_builder)
T * find_first_node_bytype(loco::Graph *g)
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.