ONE - On-device Neural Engine
Loading...
Searching...
No Matches
moco::SymbolTable Class Reference

Class to store and query loco::Node* with string name key. More...

#include <GraphBuilderContext.h>

Public Member Functions

void enroll (const TensorName &tensor_name, loco::Node *node)
 Registers a name with corresponding loco::Node *.
 
loco::Nodenode (const TensorName &tensor_name) const
 Queries enrolled(registered) with name and return node if found Will throw runtime_error if not found.
 

Detailed Description

Class to store and query loco::Node* with string name key.

Definition at line 59 of file GraphBuilderContext.h.

Member Function Documentation

◆ enroll()

void moco::SymbolTable::enroll ( const TensorName tensor_name,
loco::Node node 
)

Registers a name with corresponding loco::Node *.

Definition at line 51 of file GraphBuilderContext.cpp.

52{
53 MapNameNode_t::iterator iter = _table.find(tensor_name);
54
55 if (iter != _table.end())
56 {
57 throw oops::UserExn("Duplicate node name in GraphDef", tensor_name.name());
58 }
59
60 _table[tensor_name] = node;
61}
loco::Node * node(const TensorName &tensor_name) const
Queries enrolled(registered) with name and return node if found Will throw runtime_error if not found...
Exception to user.
Definition UserExn.h:42
const char * tensor_name(const circle::Tensor *tensor)

References node().

Referenced by moco::AvgPoolGraphBuilder::build(), moco::BiasAddGraphBuilder::build(), moco::ConcatV2GraphBuilder::build(), moco::ConstGraphBuilder::build(), moco::Conv2DGraphBuilder::build(), moco::IdentityGraphBuilder::build(), moco::MaxPoolGraphBuilder::build(), moco::PackGraphBuilder::build(), moco::ReluGraphBuilder::build(), moco::Relu6GraphBuilder::build(), moco::StridedSliceGraphBuilder::build(), moco::tf::COpCallGraphBuilder::build(), moco::AddGraphBuilder::build(), moco::Conv2DBackpropInputGraphBuilder::build(), moco::DepthwiseConv2dNativeGraphBuilder::build(), moco::FakeQuantWithMinMaxVarsGraphBuilder::build(), moco::FusedBatchNormGraphBuilder::build(), moco::MaximumGraphBuilder::build(), moco::MeanGraphBuilder::build(), moco::MulGraphBuilder::build(), moco::PadGraphBuilder::build(), moco::PlaceholderGraphBuilder::build(), moco::RealDivGraphBuilder::build(), moco::ReshapeGraphBuilder::build(), moco::RsqrtGraphBuilder::build(), moco::ShapeGraphBuilder::build(), moco::SoftmaxGraphBuilder::build(), moco::SqrtGraphBuilder::build(), moco::SquaredDifferenceGraphBuilder::build(), moco::SqueezeGraphBuilder::build(), moco::StopGradientGraphBuilder::build(), moco::SubGraphBuilder::build(), and moco::TanhGraphBuilder::build().

◆ node()

loco::Node * moco::SymbolTable::node ( const TensorName tensor_name) const

Queries enrolled(registered) with name and return node if found Will throw runtime_error if not found.

Definition at line 63 of file GraphBuilderContext.cpp.

64{
65 MapNameNode_t::const_iterator iter = _table.find(tensor_name);
66
67 if (iter == _table.end())
68 {
69 throw oops::UserExn("Cannot find node with name in GraphDef", tensor_name.name());
70 }
71
72 return iter->second;
73}

Referenced by enroll().


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