ONE - On-device Neural Engine
Loading...
Searching...
No Matches
locoex::TFLNode Struct Referenceabstract

#include <TFLNodeDecl.h>

Collaboration diagram for locoex::TFLNode:

Public Member Functions

virtual ~TFLNode ()=default
 
const loco::Dialectdialect (void) const final
 Return "Dialect" identifier that this node belongs to.
 
virtual TFLOpcode opcode (void) const =0
 
template<typename T >
accept (TFLNodeVisitorBase< T > *) const
 
template<typename T >
accept (TFLNodeMutableVisitorBase< 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 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 29 of file TFLNodeDecl.h.

Constructor & Destructor Documentation

◆ ~TFLNode()

virtual locoex::TFLNode::~TFLNode ( )
virtualdefault

Member Function Documentation

◆ accept() [1/2]

template<typename T >
T locoex::TFLNode::accept ( TFLNodeMutableVisitorBase< T > *  v)

Definition at line 48 of file TFLNodeImpl.h.

49{
50 switch (this->opcode())
51 {
52#define TFL_NODE(OPCODE, CLASS) \
53 \
54 case TFLOpcode::OPCODE: \
55 return v->visit(dynamic_cast<CLASS *>(this));
56
57#include "TFLNodes.lst"
58#undef TFL_NODE
59
60 default:
61 break;
62 }
63
64 INTERNAL_EXN("TFLNode::accept(TFLNodeMutableVisitorBase) not handled");
65}
#define INTERNAL_EXN(msg)
@ brief throw internal exception with message
Definition InternalExn.h:25
virtual TFLOpcode opcode(void) const =0

References INTERNAL_EXN, and opcode().

◆ accept() [2/2]

template<typename T >
T locoex::TFLNode::accept ( TFLNodeVisitorBase< T > *  v) const

Definition at line 29 of file TFLNodeImpl.h.

30{
31 switch (this->opcode())
32 {
33#define TFL_NODE(OPCODE, CLASS) \
34 \
35 case TFLOpcode::OPCODE: \
36 return v->visit(dynamic_cast<const CLASS *>(this));
37
38#include "TFLNodes.lst"
39#undef TFL_NODE
40
41 default:
42 break;
43 }
44
45 INTERNAL_EXN("TFLNode::accept(TFLNodeVisitorBase) not handled");
46}

References INTERNAL_EXN, and opcode().

Referenced by exo::FuseBiasAddPass::run().

◆ dialect()

const loco::Dialect * locoex::TFLNode::dialect ( void  ) const
finalvirtual

Return "Dialect" identifier that this node belongs to.

dialect() SHOULD return a valid pointer.

Implements loco::Node.

Definition at line 24 of file TFLNode.cpp.

24{ return TFLDialect::get(); }
static loco::Dialect * get(void)

References locoex::TFLDialect::get().

Referenced by exo::FuseBiasAddPass::run().

◆ opcode()


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