ONE - On-device Neural Engine
Loading...
Searching...
No Matches
InputLayer Struct Referencefinal

#include <GraphBuilder.h>

Data Structures

class  Return
 

Public Member Functions

std::unique_ptr< Returnoperator() (GraphBuilder::Context *ctx)
 

Detailed Description

Definition at line 113 of file GraphBuilder.h.

Member Function Documentation

◆ operator()()

std::unique_ptr< Return > InputLayer::operator() ( GraphBuilder::Context ctx)
inline

Definition at line 147 of file GraphBuilder.h.

148 {
149 auto input_index = ctx->graph()->inputs()->size();
150 auto graph_input = ctx->graph()->inputs()->create();
151
152 auto pull_node = ctx->graph()->nodes()->create<loco::Pull>();
153
154 pull_node->index(input_index);
155
156 loco::link(graph_input, pull_node);
157
158 ctx->stack()->push(pull_node);
159
160 return std::make_unique<Return>(graph_input, pull_node);
161 }
loco::Graph * graph(void)
Stack * stack(void)
void push(loco::Node *node)
InputContext * inputs(void)
Definition Graph.h:220
NodeContext * nodes(void)
Definition Graph.h:218
Derived * create(Args &&...args)
Definition NodePool.h:37
uint32_t size(void) const
Return the number of objects.
Definition ObjectPool.h:38
Create a value from user data.
Definition Nodes.h:96
void index(const GraphInputIndex &index)
Definition Nodes.cpp:90
void link(GraphOutput *, Push *push)
Definition Nodes.cpp:65
Pull * pull_node(Graph *g, const GraphInputIndex &index)
Find a Pull node with a given input index.
Definition Nodes.cpp:162
GraphInput * create(void)
Definition Graph.cpp:52

References loco::NodePool::create(), loco::Graph::InputContext::create(), GraphBuilder::Context::graph(), loco::Pull::index(), loco::Graph::inputs(), loco::link(), loco::Graph::nodes(), GraphBuilder::Stack::push(), loco::ObjectPool< T >::size(), and GraphBuilder::Context::stack().


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