Symbolic computation graph. This is the intermediate representation for optimization pass.
More...
#include <graph.h>
|
| template<typename T > |
| const T & | GetAttr (const std::string &attr_name) const |
| | Get the immutable attribute from attrs. More...
|
| |
| bool | HasAttr (const std::string &attr_name) const |
| | Check whether has a specific attribute. More...
|
| |
| template<typename T > |
| T | MoveCopyAttr (const std::string &attr_name) |
| | Get a move copy of the attribute, implement copy on write semantics. The content is moved if the reference counter of shared_ptr is 1. The attribute is erased from attrs after the call. More...
|
| |
| const IndexedGraph & | indexed_graph () const |
| | get a indexed graph of current graph, if not exist, create it on demand More...
|
| |
|
| std::vector< NodeEntry > | outputs |
| | outputs of the computation graph. More...
|
| |
| std::unordered_map< std::string, std::shared_ptr< any > > | attrs |
| | attributes of a graph Note that attribute is shared pointer and can be shared across graphs. More...
|
| |
Symbolic computation graph. This is the intermediate representation for optimization pass.
template<typename T >
| const T & nnvm::Graph::GetAttr |
( |
const std::string & |
attr_name | ) |
const |
|
inline |
Get the immutable attribute from attrs.
- Parameters
-
| attr_name | the name of the attribute |
- Returns
- the reference to corresponding attribute
- Template Parameters
-
| T | the type of the attribute. |
| bool nnvm::Graph::HasAttr |
( |
const std::string & |
attr_name | ) |
const |
|
inline |
Check whether has a specific attribute.
- Parameters
-
| attr_name | the name of the attribute |
- Returns
- a boolean result
get a indexed graph of current graph, if not exist, create it on demand
- Returns
- The indexed graph.
- See also
- IndexedGraph
template<typename T >
| T nnvm::Graph::MoveCopyAttr |
( |
const std::string & |
attr_name | ) |
|
|
inline |
Get a move copy of the attribute, implement copy on write semantics. The content is moved if the reference counter of shared_ptr is 1. The attribute is erased from attrs after the call.
- Parameters
-
| attr_name | the name of the attribute |
- Returns
- a new copy of the corresponding attribute.
- Template Parameters
-
| T | the type of the attribute. |
| std::unordered_map<std::string, std::shared_ptr<any> > nnvm::Graph::attrs |
attributes of a graph Note that attribute is shared pointer and can be shared across graphs.
It is highly recommended to keep each attribute immutable. It is also safe to implement an copy-on-write semnatics.
Copy when shared_ptr.unique is not true, while reuse original space when shared_ptr.unique is true.
outputs of the computation graph.
The documentation for this class was generated from the following file:
- /work/mxnet/3rdparty/tvm/nnvm/include/nnvm/graph.h