mxnet
|
Auxiliary data structure to index a graph. It maps Nodes in the graph to consecutive integers node_id. It also maps IndexedGraph::NodeEntry to consecutive integer entry_id. This allows storing properties of Node and NodeEntry into compact vector and quickly access them without resorting to hashmap. More...
#include <graph.h>
Classes | |
struct | Node |
Node data structure in IndexedGraph. More... | |
struct | NodeEntry |
represents a data in the graph More... | |
Public Member Functions | |
size_t | num_nodes () const |
size_t | num_node_entries () const |
uint32_t | entry_id (uint32_t node_id, uint32_t index) const |
Get a unique entry id between 0 to num_node_entries() for a given IndexedGraph::NodeEntry. More... | |
uint32_t | entry_id (const NodeEntry &e) const |
Get a unique entry id between 0 to num_node_entries() for a given IndexedGraph::NodeEntry. More... | |
uint32_t | entry_id (const nnvm::NodeEntry &e) const |
Get a unique entry id between 0 to num_node_entries() for a given NodeEntry. More... | |
uint32_t | node_id (const nnvm::Node *node) const |
Get the corresponding node id for a given Node in the IndexedGraph. More... | |
const Node & | operator[] (uint32_t node_id) const |
Get the corresponding Node structure for a given node_id. More... | |
const Node & | operator[] (const nnvm::Node *node) const |
Get the corresponding Node structure. More... | |
const std::vector< uint32_t > & | input_nodes () const |
const std::unordered_set< uint32_t > & | mutable_input_nodes () const |
const std::vector< NodeEntry > & | outputs () const |
bool | exist (const nnvm::Node *node) const |
IndexedGraph (const IndexedGraph &)=delete | |
Friends | |
class | Graph |
Auxiliary data structure to index a graph. It maps Nodes in the graph to consecutive integers node_id. It also maps IndexedGraph::NodeEntry to consecutive integer entry_id. This allows storing properties of Node and NodeEntry into compact vector and quickly access them without resorting to hashmap.
The node_id and entry_rptr are the same as the JSON graph produced by SaveJSON Pass.
|
delete |
|
inline |
Get a unique entry id between 0 to num_node_entries() for a given IndexedGraph::NodeEntry.
node_id | The node index |
index | the output index |
|
inline |
Get a unique entry id between 0 to num_node_entries() for a given IndexedGraph::NodeEntry.
e | The entry to query for index. |
|
inline |
Get a unique entry id between 0 to num_node_entries() for a given NodeEntry.
e | The entry to query for index. |
|
inline |
|
inline |
|
inline |
|
inline |
Get the corresponding node id for a given Node in the IndexedGraph.
node | The Node to query for index. |
|
inline |
|
inline |
|
inline |
Get the corresponding Node structure for a given node_id.
node_id | The node id |
|
inline |
Get the corresponding Node structure.
node | The pointer to the Node structure |
|
inline |
|
friend |