ONE - On-device Neural Engine
Loading...
Searching...
No Matches
loco::Push Class Referencefinal

Make a value visible to user. More...

#include <Nodes.h>

Collaboration diagram for loco::Push:

Public Member Functions

 Push ()=default
 
Nodefrom (void) const
 
void from (Node *node)
 
void index (const GraphOutputIndex &index)
 
GraphOutputIndex index (void) const
 Get associated output index.
 
bool indexed (void) const
 Check whether index is initialized.
 
- Public Member Functions inherited from loco::CanonicalNodeDef< CanonicalOpcode::Push, FixedArity< 1 >::Mixin >
virtual ~CanonicalNodeDef ()=default
 
uint32_t opnum (void) const final
 
CanonicalOpcode opcode (void) const final
 
- Public Member Functions inherited from loco::CanonicalNode
virtual ~CanonicalNode ()=default
 
const Dialectdialect (void) const final
 Return "Dialect" identifier that this node belongs to.
 
template<typename T >
accept (CanonicalNodeVisitorBase< T > *) const
 
template<typename T >
accept (CanonicalNodeMutableVisitorBase< T > *)
 
- Public Member Functions inherited from loco::Node
 Node ()=default
 
 Node (const Node &)=delete
 
 Node (Node &&)=delete
 
virtual ~Node ()
 
Graphgraph (void)
 
const Graphgraph (void) const
 
virtual uint32_t arity (void) const =0
 Return the number of arguments.
 
virtual Nodearg (uint32_t N) const =0
 Access N-th argument node.
 
virtual void drop (void)=0
 Drop all the reference of arguments.
 
- Public Member Functions inherited from loco::AnnotatedItem< NodeAnnotation >
 AnnotatedItem ()=default
 
virtual ~AnnotatedItem ()=default
 
const T * annot (void) const
 Retrieve a stored annotation of type T.
 
void annot (std::unique_ptr< T > &&p)
 Attach or remove a new annotation of type T.
 

Detailed Description

Make a value visible to user.

Definition at line 51 of file Nodes.h.

Constructor & Destructor Documentation

◆ Push()

loco::Push::Push ( )
default

Member Function Documentation

◆ from() [1/2]

void loco::Push::from ( Node node)
inline

Definition at line 59 of file Nodes.h.

59{ at(0)->node(node); }

◆ from() [2/2]

◆ index() [1/2]

void loco::Push::index ( const GraphOutputIndex index)

Definition at line 52 of file Nodes.cpp.

53{
54 // Push internally stores "GraphOutputIndex" as int64_t
55 _index = static_cast<int64_t>(index);
56}
GraphOutputIndex index(void) const
Get associated output index.
Definition Nodes.cpp:58

References index().

Referenced by GraphTestcase< GraphCode::AvgPool2D >::GraphTestcase(), GraphTestcase< GraphCode::MaxPool2D >::GraphTestcase(), GraphTestcase< GraphCode::TensorConcat >::GraphTestcase(), GraphTestcase< GraphCode::TensorTranspose >::GraphTestcase(), loco::link(), and OutputLayer::operator()().

◆ index() [2/2]

GraphOutputIndex loco::Push::index ( void  ) const

Get associated output index.

The behavior of this method is undefined when "index" is not set before.

NOTE This method intentionally returns "GraphOutputIndex" instead of "const GraphOutputIndex &" not to expose the internal implementation details.

Definition at line 58 of file Nodes.cpp.

59{
60 assert(_index >= std::numeric_limits<GraphOutputIndex>::min());
61 assert(_index <= std::numeric_limits<GraphOutputIndex>::max());
62 return static_cast<GraphOutputIndex>(_index);
63}
uint32_t GraphOutputIndex

Referenced by index().

◆ indexed()

bool loco::Push::indexed ( void  ) const
inline

Check whether index is initialized.

NOTE "indexed" method does not validate whether index is in a valid range

Definition at line 79 of file Nodes.h.

79{ return _index != -1; }

The documentation for this class was generated from the following files: