blob: 551bad853d879294e913636e10f25900b6417917 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>mxnet: nnvm::Graph Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">mxnet
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacennvm.html">nnvm</a></li><li class="navelem"><a class="el" href="classnnvm_1_1Graph.html">Graph</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="classnnvm_1_1Graph-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">nnvm::Graph Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Symbolic computation graph. This is the intermediate representation for optimization pass.
<a href="classnnvm_1_1Graph.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="graph_8h_source.html">graph.h</a>&gt;</code></p>
<div class="dynheader">
Collaboration diagram for nnvm::Graph:</div>
<div class="dyncontent">
<div class="center"><img src="classnnvm_1_1Graph__coll__graph.png" border="0" usemap="#nnvm_1_1Graph_coll__map" alt="Collaboration graph"/></div>
<map name="nnvm_1_1Graph_coll__map" id="nnvm_1_1Graph_coll__map">
</map>
</div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ac3b5c307c14dd45179b0c916e8bb2220"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:ac3b5c307c14dd45179b0c916e8bb2220"><td class="memTemplItemLeft" align="right" valign="top">const T &amp;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classnnvm_1_1Graph.html#ac3b5c307c14dd45179b0c916e8bb2220">GetAttr</a> (const std::string &amp;attr_name) const</td></tr>
<tr class="memdesc:ac3b5c307c14dd45179b0c916e8bb2220"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the immutable attribute from attrs. <a href="#ac3b5c307c14dd45179b0c916e8bb2220">More...</a><br /></td></tr>
<tr class="separator:ac3b5c307c14dd45179b0c916e8bb2220"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a493eda4cf584454f1fb10419d0a87790"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnnvm_1_1Graph.html#a493eda4cf584454f1fb10419d0a87790">HasAttr</a> (const std::string &amp;attr_name) const</td></tr>
<tr class="memdesc:a493eda4cf584454f1fb10419d0a87790"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check whether has a specific attribute. <a href="#a493eda4cf584454f1fb10419d0a87790">More...</a><br /></td></tr>
<tr class="separator:a493eda4cf584454f1fb10419d0a87790"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aef2d59ea8a92838e09fb852ec79be083"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:aef2d59ea8a92838e09fb852ec79be083"><td class="memTemplItemLeft" align="right" valign="top">T&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classnnvm_1_1Graph.html#aef2d59ea8a92838e09fb852ec79be083">MoveCopyAttr</a> (const std::string &amp;attr_name)</td></tr>
<tr class="memdesc:aef2d59ea8a92838e09fb852ec79be083"><td class="mdescLeft">&#160;</td><td class="mdescRight">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. <a href="#aef2d59ea8a92838e09fb852ec79be083">More...</a><br /></td></tr>
<tr class="separator:aef2d59ea8a92838e09fb852ec79be083"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a428b2c98b62c8e74d48094e9e4d2b35c"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classnnvm_1_1IndexedGraph.html">IndexedGraph</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnnvm_1_1Graph.html#a428b2c98b62c8e74d48094e9e4d2b35c">indexed_graph</a> () const</td></tr>
<tr class="memdesc:a428b2c98b62c8e74d48094e9e4d2b35c"><td class="mdescLeft">&#160;</td><td class="mdescRight">get a indexed graph of current graph, if not exist, create it on demand <a href="#a428b2c98b62c8e74d48094e9e4d2b35c">More...</a><br /></td></tr>
<tr class="separator:a428b2c98b62c8e74d48094e9e4d2b35c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a1be6cd069643a2608625df12f49423eb"><td class="memItemLeft" align="right" valign="top">std::vector&lt; <a class="el" href="structnnvm_1_1NodeEntry.html">NodeEntry</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnnvm_1_1Graph.html#a1be6cd069643a2608625df12f49423eb">outputs</a></td></tr>
<tr class="memdesc:a1be6cd069643a2608625df12f49423eb"><td class="mdescLeft">&#160;</td><td class="mdescRight">outputs of the computation graph. <a href="#a1be6cd069643a2608625df12f49423eb">More...</a><br /></td></tr>
<tr class="separator:a1be6cd069643a2608625df12f49423eb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6590464798f3a02e9edfe760bd7ece22"><td class="memItemLeft" align="right" valign="top">std::unordered_map&lt; std::string, std::shared_ptr&lt; any &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnnvm_1_1Graph.html#a6590464798f3a02e9edfe760bd7ece22">attrs</a></td></tr>
<tr class="memdesc:a6590464798f3a02e9edfe760bd7ece22"><td class="mdescLeft">&#160;</td><td class="mdescRight">attributes of a graph Note that attribute is shared pointer and can be shared across graphs. <a href="#a6590464798f3a02e9edfe760bd7ece22">More...</a><br /></td></tr>
<tr class="separator:a6590464798f3a02e9edfe760bd7ece22"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Symbolic computation graph. This is the intermediate representation for optimization pass. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="ac3b5c307c14dd45179b0c916e8bb2220"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac3b5c307c14dd45179b0c916e8bb2220">&#9670;&nbsp;</a></span>GetAttr()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">const T &amp; nnvm::Graph::GetAttr </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>attr_name</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the immutable attribute from attrs. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">attr_name</td><td>the name of the attribute </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the reference to corresponding attribute </dd></dl>
<dl class="tparams"><dt>Template Parameters</dt><dd>
<table class="tparams">
<tr><td class="paramname">T</td><td>the type of the attribute. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a493eda4cf584454f1fb10419d0a87790"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a493eda4cf584454f1fb10419d0a87790">&#9670;&nbsp;</a></span>HasAttr()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool nnvm::Graph::HasAttr </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>attr_name</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Check whether has a specific attribute. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">attr_name</td><td>the name of the attribute </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a boolean result </dd></dl>
</div>
</div>
<a id="a428b2c98b62c8e74d48094e9e4d2b35c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a428b2c98b62c8e74d48094e9e4d2b35c">&#9670;&nbsp;</a></span>indexed_graph()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classnnvm_1_1IndexedGraph.html">IndexedGraph</a>&amp; nnvm::Graph::indexed_graph </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>get a indexed graph of current graph, if not exist, create it on demand </p>
<dl class="section return"><dt>Returns</dt><dd>The indexed graph. </dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classnnvm_1_1IndexedGraph.html" title="Auxiliary data structure to index a graph. It maps Nodes in the graph to consecutive integers node_id...">IndexedGraph</a> </dd></dl>
</div>
</div>
<a id="aef2d59ea8a92838e09fb852ec79be083"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aef2d59ea8a92838e09fb852ec79be083">&#9670;&nbsp;</a></span>MoveCopyAttr()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">T nnvm::Graph::MoveCopyAttr </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>attr_name</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>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. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">attr_name</td><td>the name of the attribute </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a new copy of the corresponding attribute. </dd></dl>
<dl class="tparams"><dt>Template Parameters</dt><dd>
<table class="tparams">
<tr><td class="paramname">T</td><td>the type of the attribute. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="a6590464798f3a02e9edfe760bd7ece22"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6590464798f3a02e9edfe760bd7ece22">&#9670;&nbsp;</a></span>attrs</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::unordered_map&lt;std::string, std::shared_ptr&lt;any&gt; &gt; nnvm::Graph::attrs</td>
</tr>
</table>
</div><div class="memdoc">
<p>attributes of a graph Note that attribute is shared pointer and can be shared across graphs. </p>
<p>It is highly recommended to keep each attribute immutable. It is also safe to implement an copy-on-write semnatics.</p>
<p>Copy when shared_ptr.unique is not true, while reuse original space when shared_ptr.unique is true. </p>
</div>
</div>
<a id="a1be6cd069643a2608625df12f49423eb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1be6cd069643a2608625df12f49423eb">&#9670;&nbsp;</a></span>outputs</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::vector&lt;<a class="el" href="structnnvm_1_1NodeEntry.html">NodeEntry</a>&gt; nnvm::Graph::outputs</td>
</tr>
</table>
</div><div class="memdoc">
<p>outputs of the computation graph. </p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>/work/mxnet/3rdparty/tvm/nnvm/include/nnvm/<a class="el" href="graph_8h_source.html">graph.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Jan 5 2023 00:58:44 for mxnet by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>