ONE - On-device Neural Engine
Loading...
Searching...
No Matches
moco::TFNode Struct Referenceabstract

#include <TFNodeDecl.h>

Collaboration diagram for moco::TFNode:

Public Member Functions

virtual ~TFNode ()=default
 
const loco::Dialectdialect (void) const final
 Return "Dialect" identifier that this node belongs to.
 
virtual TFOpcode opcode (void) const =0
 
template<typename T >
accept (TFNodeVisitorBase< T > *) const
 
template<typename T >
accept (TFNodeMutableVisitorBase< T > *)
 
NodeName name (void) const
 
void name (const NodeName &name)
 
- 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 opnum (void) const =0
 
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

Definition at line 40 of file TFNodeDecl.h.

Constructor & Destructor Documentation

◆ ~TFNode()

virtual moco::TFNode::~TFNode ( )
virtualdefault

Member Function Documentation

◆ accept() [1/2]

template<typename T >
T moco::TFNode::accept ( TFNodeMutableVisitorBase< T > *  v)

Definition at line 47 of file TFNodeImpl.h.

48{
49 switch (this->opcode())
50 {
51#define TENSORFLOW_NODE(OPCODE, CLASS) \
52 case TFOpcode::OPCODE: \
53 return v->visit(dynamic_cast<CLASS *>(this));
54
55#include "TFNodes.lst"
56#undef TENSORFLOW_NODE
57 default:
58 break;
59 }
60
61 // TODO including oops will make oops dependent to modules that include this
62 // postpone decision to this or not
63 throw std::runtime_error{"Unsupported Node"};
64}
virtual TFOpcode opcode(void) const =0

References opcode().

◆ accept() [2/2]

template<typename T >
T moco::TFNode::accept ( TFNodeVisitorBase< T > *  v) const

Definition at line 28 of file TFNodeImpl.h.

29{
30 switch (this->opcode())
31 {
32#define TENSORFLOW_NODE(OPCODE, CLASS) \
33 case TFOpcode::OPCODE: \
34 return v->visit(dynamic_cast<const CLASS *>(this));
35
36#include "TFNodes.lst"
37#undef TENSORFLOW_NODE
38 default:
39 break;
40 }
41
42 // TODO including oops will make oops dependent to modules that include this
43 // postpone decision to this or not
44 throw std::runtime_error{"Unsupported Node"};
45}

References opcode().

Referenced by moco::RemoveTFIdentityNode::run().

◆ dialect()

const loco::Dialect * moco::TFNode::dialect ( void  ) const
finalvirtual

Return "Dialect" identifier that this node belongs to.

dialect() SHOULD return a valid pointer.

Implements loco::Node.

Definition at line 27 of file TFNode.cpp.

27{ return TFDialect::get(); }
static loco::Dialect * get(void)
Definition TFDialect.cpp:84

References moco::TFDialect::get().

Referenced by moco::FuseBinaryIntoPreceding::run(), and moco::ResolveSquaredDifference::run().

◆ name() [1/2]

void moco::TFNode::name ( const NodeName name)
inline

Definition at line 51 of file TFNodeDecl.h.

51{ _name = name; }
NodeName name(void) const
Definition TFNodeDecl.h:50

References name().

Referenced by name().

◆ name() [2/2]

◆ opcode()


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