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

#include <GraphBuilder.h>

Data Structures

class  Return
 

Public Member Functions

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

Detailed Description

Definition at line 165 of file GraphBuilder.h.

Member Function Documentation

◆ operator()()

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

Definition at line 192 of file GraphBuilder.h.

193 {
194 auto output_index = ctx->graph()->outputs()->size();
195 auto graph_output = ctx->graph()->outputs()->create();
196
197 auto push_node = ctx->graph()->nodes()->create<loco::Push>();
198
199 push_node->from(ctx->stack()->pop());
200 push_node->index(output_index);
201
202 loco::link(graph_output, push_node);
203
204 ctx->stack()->push(push_node);
205
206 return std::make_unique<Return>(graph_output, push_node);
207 }
loco::Graph * graph(void)
Stack * stack(void)
void push(loco::Node *node)
loco::Node * pop(void)
NodeContext * nodes(void)
Definition Graph.h:218
OutputContext * outputs(void)
Definition Graph.h:222
Derived * create(Args &&...args)
Definition NodePool.h:37
uint32_t size(void) const
Return the number of objects.
Definition ObjectPool.h:38
Make a value visible to user.
Definition Nodes.h:53
Node * from(void) const
Definition Nodes.h:58
void index(const GraphOutputIndex &index)
Definition Nodes.cpp:52
void link(GraphOutput *, Push *push)
Definition Nodes.cpp:65
Push * push_node(Graph *g, const GraphOutputIndex &index)
Find a Push node with a given output index.
Definition Nodes.cpp:67
GraphOutput * create(void)
Definition Graph.cpp:54

References loco::NodePool::create(), loco::Graph::OutputContext::create(), loco::Push::from(), GraphBuilder::Context::graph(), loco::Push::index(), loco::link(), loco::Graph::nodes(), loco::Graph::outputs(), GraphBuilder::Stack::pop(), GraphBuilder::Stack::push(), loco::ObjectPool< T >::size(), and GraphBuilder::Context::stack().


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