17#ifndef __TEST_GRAPH_H__
18#define __TEST_GRAPH_H__
36 std::unique_ptr<loco::Graph>
g;
48 auto input =
g->inputs()->create();
53 auto output =
g->outputs()->create();
55 output->name(
"output");
67 auto node =
g->nodes()->create<T>();
76 auto node =
g->nodes()->create<T>();
86 auto node =
g->nodes()->create<T>();
87 setInput(node, arg1, arg2);
96 auto node =
g->nodes()->create<T>();
97 setInput(node, arg1, arg2, arg3);
177 assert(
false &&
"NYI");
222 fea_enc = exo::make_feature_encode<exo::FeatureLayout::NHWC>(pull);
223 constgen = append<loco::ConstGen>();
224 bias_enc = append<loco::BiasEncode>(constgen);
225 fea_bias_add = append<loco::FeatureBiasAdd>(fea_enc, bias_enc);
226 fea_dec = exo::make_feature_decode<exo::FeatureLayout::NHWC>(fea_bias_add);
245 constgen = append<loco::ConstGen>();
246 relu = append<loco::ReLU>(constgen);
264 transpose = append<loco::TensorTranspose>(pull);
283 filterEncode = exo::make_filter_encode<exo::FilterLayout::HWIO>(pull);
285 exo::make_filter_decode<exo::FilterLayout::OHWI>(filterEncode);
286 complete(filterDecode);
304 const_perm = append<loco::ConstGen>();
305 tfl_transpose = append<locoex::TFLTranspose>(pull, const_perm);
306 complete(tfl_transpose);
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.
T * append(loco::Node *arg1)
Creates op T (arity=1) with arg1 as an input and appends it to graph.
void complete(loco::Node *last_node)
T * append(loco::Node *arg1, loco::Node *arg2)
Creates op T (arity=2) with arg1, arg2 as inputs and appends it to graph.
std::unique_ptr< loco::Graph > g
T * append()
Creates node with NO arg and appends it to graph.
Add Feature and Bias along "depth" axis.
Create a "Tensor" from a "Bias".
Create a "Bias" from a "Tensor".
Create a value from constant byte array.
Elementwise Add lhs and rhs.
Create a tensor from a feature map.
Create a feature map from a tensor.
Create a tensor from a filter.
Create a filter from a tensor.
Logical unit of computation.
Create a value from user data.
Make a value visible to user.
Create a new value that rectifies its input capping the units at 6.
Create a new value that rectifies its input.
Create a new value that rectifies its input by tanh.
loco::Node * y(void) const
loco::Node * x(void) const
AVERAGE_POOL_2D in TensorFlow Lite.
loco::Node * value(void) const
CONV_2D in TensorFlow Lite.
loco::Node * filter(void) const
loco::Node * bias(void) const override
loco::Node * input(void) const
MAX_POOL_2D in TensorFlow Lite.
loco::Node * value(void) const
loco::Node * y(void) const
loco::Node * x(void) const
loco::Node * features(void) const
loco::Node * features(void) const
loco::Node * y(void) const
loco::Node * x(void) const
TRANSPOSE in TensorFlow Lite.
loco::Node * perm(void) const
loco::Node * a(void) const
Get the input node to transpose.
@ FilterEncode_FilterDecode
void link(GraphOutput *, Push *push)
std::unique_ptr< Graph > make_graph(void)