26 MapNameNode_t::iterator iter = _namenode.find(node_name);
28 if (iter != _namenode.end())
30 throw std::runtime_error{
"Error: Duplicate node name in Graph: " + node_name};
33 _namenode[node_name] =
node;
38 MapNameNode_t::iterator iter = _namenode.find(node_name);
40 if (iter == _namenode.end())
42 throw std::runtime_error{
"Error: Cannot find node with name in Graph: " + node_name};
50 MapNodeNames_t::iterator iter = _nodenames.find(
node);
52 if (iter == _nodenames.end())
64 MapNodeNames_t::iterator iter = _nodenames.find(
node);
66 if (iter == _nodenames.end())
71 return iter->second.size();
76 MapNodeNames_t::iterator iter = _nodenames.find(
node);
78 if (iter == _nodenames.end())
80 throw std::runtime_error{
"Error: Cannot find names given node"};
83 if (
index >= iter->second.size())
85 throw std::runtime_error{
"Error: Invalid name index for given node"};
88 return iter->second.at(
index);
Logical unit of computation.
const std::string & name(loco::Node *node, unsigned index)
Queries listed(registered) with node and index(from 0 to size-1) Will throw runtime_error if node is ...
void enroll(const std::string &node_name, loco::Node *node)
Registers one node for a name.
loco::Node * node(const std::string &node_name)
Queries enrolled(registered) with name and return node if found Will throw runtime_error if not found...
unsigned size(loco::Node *node)
Returns number of listed(registered) names for a node.
void list(loco::Node *node, const std::string &name)
Registers multiple (appends) names for a node Table is independent with registering with enroll()
loco::GraphInputIndex index(const TFPlaceholder *node)