| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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.17"/> |
| <meta name="viewport" content="width=device-width, initial-scale=1"/> |
| <title>mxnet: nnvm::pass Namespace 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.17 --> |
| <script type="text/javascript"> |
| /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ |
| var searchBox = new SearchBox("searchBox", "search",false,'Search'); |
| /* @license-end */ |
| </script> |
| <script type="text/javascript" src="menudata.js"></script> |
| <script type="text/javascript" src="menu.js"></script> |
| <script type="text/javascript"> |
| /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ |
| $(function() { |
| initMenu('',true,false,'search.php','Search'); |
| $(document).ready(function() { init_search(); }); |
| }); |
| /* @license-end */</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="namespacennvm_1_1pass.html">pass</a></li> </ul> |
| </div> |
| </div><!-- top --> |
| <div class="header"> |
| <div class="summary"> |
| <a href="#func-members">Functions</a> </div> |
| <div class="headertitle"> |
| <div class="title">nnvm::pass Namespace Reference</div> </div> |
| </div><!--header--> |
| <div class="contents"> |
| <table class="memberdecls"> |
| <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> |
| Functions</h2></td></tr> |
| <tr class="memitem:aac90eb2d4aea5e49892b0e0a914fe94b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classnnvm_1_1Graph.html">Graph</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="namespacennvm_1_1pass.html#aac90eb2d4aea5e49892b0e0a914fe94b">LoadJSON</a> (const std::string &json_str)</td></tr> |
| <tr class="memdesc:aac90eb2d4aea5e49892b0e0a914fe94b"><td class="mdescLeft"> </td><td class="mdescRight">Load a graph from JSON string, redirects to "LoadJSON" pass. <a href="namespacennvm_1_1pass.html#aac90eb2d4aea5e49892b0e0a914fe94b">More...</a><br /></td></tr> |
| <tr class="separator:aac90eb2d4aea5e49892b0e0a914fe94b"><td class="memSeparator" colspan="2"> </td></tr> |
| <tr class="memitem:ab82581d1205ed50203822366f2f5f5f5"><td class="memItemLeft" align="right" valign="top">std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="namespacennvm_1_1pass.html#ab82581d1205ed50203822366f2f5f5f5">SaveJSON</a> (<a class="el" href="classnnvm_1_1Graph.html">Graph</a> graph)</td></tr> |
| <tr class="memdesc:ab82581d1205ed50203822366f2f5f5f5"><td class="mdescLeft"> </td><td class="mdescRight">Save a graph to json, redirects to "SaveJSON" pass. <a href="namespacennvm_1_1pass.html#ab82581d1205ed50203822366f2f5f5f5">More...</a><br /></td></tr> |
| <tr class="separator:ab82581d1205ed50203822366f2f5f5f5"><td class="memSeparator" colspan="2"> </td></tr> |
| <tr class="memitem:aeb99f53fcc75259eb131a61fce2350f7"><td class="memItemLeft" align="right" valign="top">std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="namespacennvm_1_1pass.html#aeb99f53fcc75259eb131a61fce2350f7">PrintGraphIR</a> (<a class="el" href="classnnvm_1_1Graph.html">Graph</a> graph)</td></tr> |
| <tr class="memdesc:aeb99f53fcc75259eb131a61fce2350f7"><td class="mdescLeft"> </td><td class="mdescRight">Print graph ir. <a href="namespacennvm_1_1pass.html#aeb99f53fcc75259eb131a61fce2350f7">More...</a><br /></td></tr> |
| <tr class="separator:aeb99f53fcc75259eb131a61fce2350f7"><td class="memSeparator" colspan="2"> </td></tr> |
| <tr class="memitem:a58861df29a62ee368c4bc672f03eff62"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classnnvm_1_1Graph.html">Graph</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="namespacennvm_1_1pass.html#a58861df29a62ee368c4bc672f03eff62">OrderMutation</a> (<a class="el" href="classnnvm_1_1Graph.html">Graph</a> src)</td></tr> |
| <tr class="memdesc:a58861df29a62ee368c4bc672f03eff62"><td class="mdescLeft"> </td><td class="mdescRight">Add control flow dependencies between nodes. <a href="namespacennvm_1_1pass.html#a58861df29a62ee368c4bc672f03eff62">More...</a><br /></td></tr> |
| <tr class="separator:a58861df29a62ee368c4bc672f03eff62"><td class="memSeparator" colspan="2"> </td></tr> |
| <tr class="memitem:a9fd9e840e169150d3cb4439448fd1561"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classnnvm_1_1Graph.html">Graph</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="namespacennvm_1_1pass.html#a9fd9e840e169150d3cb4439448fd1561">InferShape</a> (<a class="el" href="classnnvm_1_1Graph.html">Graph</a> graph, <a class="el" href="namespacennvm.html#a77a000cfbb76bfc17042b49ef30fe36f">ShapeVector</a> shape_inputs, std::string shape_attr_key="")</td></tr> |
| <tr class="memdesc:a9fd9e840e169150d3cb4439448fd1561"><td class="mdescLeft"> </td><td class="mdescRight">Infer shapes in the graph given the information. <a href="namespacennvm_1_1pass.html#a9fd9e840e169150d3cb4439448fd1561">More...</a><br /></td></tr> |
| <tr class="separator:a9fd9e840e169150d3cb4439448fd1561"><td class="memSeparator" colspan="2"> </td></tr> |
| <tr class="memitem:ab29a181d9547fdac0f205c3aaec0de68"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classnnvm_1_1Graph.html">Graph</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="namespacennvm_1_1pass.html#ab29a181d9547fdac0f205c3aaec0de68">InferType</a> (<a class="el" href="classnnvm_1_1Graph.html">Graph</a> graph, <a class="el" href="namespacennvm.html#af3047555e6bce725a8abba02b4155de9">DTypeVector</a> dtype_inputs, std::string dtype_attr_key="")</td></tr> |
| <tr class="memdesc:ab29a181d9547fdac0f205c3aaec0de68"><td class="mdescLeft"> </td><td class="mdescRight">Infer types in the graph given the information. <a href="namespacennvm_1_1pass.html#ab29a181d9547fdac0f205c3aaec0de68">More...</a><br /></td></tr> |
| <tr class="separator:ab29a181d9547fdac0f205c3aaec0de68"><td class="memSeparator" colspan="2"> </td></tr> |
| <tr class="memitem:ad5d216c596bc52189f90b392e0e9b115"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classnnvm_1_1Graph.html">Graph</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="namespacennvm_1_1pass.html#ad5d216c596bc52189f90b392e0e9b115">PlaceDevice</a> (<a class="el" href="classnnvm_1_1Graph.html">Graph</a> graph, std::string device_group_attr_key, <a class="el" href="namespacennvm.html#a52d908d5e1bfdbd544f1b6d2c99682cc">DeviceAssignMap</a> device_assign_map, std::string device_copy_op)</td></tr> |
| <tr class="memdesc:ad5d216c596bc52189f90b392e0e9b115"><td class="mdescLeft"> </td><td class="mdescRight">Place the devices for each operator in the graph. <a href="namespacennvm_1_1pass.html#ad5d216c596bc52189f90b392e0e9b115">More...</a><br /></td></tr> |
| <tr class="separator:ad5d216c596bc52189f90b392e0e9b115"><td class="memSeparator" colspan="2"> </td></tr> |
| <tr class="memitem:a6f6dca71f8f7f168b7fb9043b49580db"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classnnvm_1_1Graph.html">Graph</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="namespacennvm_1_1pass.html#a6f6dca71f8f7f168b7fb9043b49580db">Gradient</a> (<a class="el" href="classnnvm_1_1Graph.html">Graph</a> graph, std::vector< <a class="el" href="structnnvm_1_1NodeEntry.html">NodeEntry</a> > ys, std::vector< <a class="el" href="structnnvm_1_1NodeEntry.html">NodeEntry</a> > xs, std::vector< <a class="el" href="structnnvm_1_1NodeEntry.html">NodeEntry</a> > ys_out_grad, std::function< <a class="el" href="structnnvm_1_1NodeEntry.html">NodeEntry</a>(std::vector< <a class="el" href="structnnvm_1_1NodeEntry.html">NodeEntry</a> > &&inputs)> aggregate_fun=nullptr, std::function< int(const <a class="el" href="classnnvm_1_1Node.html">Node</a> &node)> mirror_fun=nullptr, std::function< <a class="el" href="structnnvm_1_1NodeEntry.html">NodeEntry</a>(const <a class="el" href="structnnvm_1_1NodeEntry.html">NodeEntry</a> &src, const <a class="el" href="structnnvm_1_1NodeEntry.html">NodeEntry</a> &like)> attr_hint_fun=nullptr, std::vector< const <a class="el" href="classnnvm_1_1Op.html">Op</a> * > zero_ops=std::vector< const <a class="el" href="classnnvm_1_1Op.html">Op</a> * >(), std::string copy_op_str=std::string())</td></tr> |
| <tr class="memdesc:a6f6dca71f8f7f168b7fb9043b49580db"><td class="mdescLeft"> </td><td class="mdescRight">Get the gradient graph whose outputs are gradients of xs wrt to ys. <a href="namespacennvm_1_1pass.html#a6f6dca71f8f7f168b7fb9043b49580db">More...</a><br /></td></tr> |
| <tr class="separator:a6f6dca71f8f7f168b7fb9043b49580db"><td class="memSeparator" colspan="2"> </td></tr> |
| </table> |
| <h2 class="groupheader">Function Documentation</h2> |
| <a id="a6f6dca71f8f7f168b7fb9043b49580db"></a> |
| <h2 class="memtitle"><span class="permalink"><a href="#a6f6dca71f8f7f168b7fb9043b49580db">◆ </a></span>Gradient()</h2> |
| |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname"><a class="el" href="classnnvm_1_1Graph.html">Graph</a> nnvm::pass::Gradient </td> |
| <td>(</td> |
| <td class="paramtype"><a class="el" href="classnnvm_1_1Graph.html">Graph</a> </td> |
| <td class="paramname"><em>graph</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">std::vector< <a class="el" href="structnnvm_1_1NodeEntry.html">NodeEntry</a> > </td> |
| <td class="paramname"><em>ys</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">std::vector< <a class="el" href="structnnvm_1_1NodeEntry.html">NodeEntry</a> > </td> |
| <td class="paramname"><em>xs</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">std::vector< <a class="el" href="structnnvm_1_1NodeEntry.html">NodeEntry</a> > </td> |
| <td class="paramname"><em>ys_out_grad</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">std::function< <a class="el" href="structnnvm_1_1NodeEntry.html">NodeEntry</a>(std::vector< <a class="el" href="structnnvm_1_1NodeEntry.html">NodeEntry</a> > &&inputs)> </td> |
| <td class="paramname"><em>aggregate_fun</em> = <code>nullptr</code>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">std::function< int(const <a class="el" href="classnnvm_1_1Node.html">Node</a> &node)> </td> |
| <td class="paramname"><em>mirror_fun</em> = <code>nullptr</code>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">std::function< <a class="el" href="structnnvm_1_1NodeEntry.html">NodeEntry</a>(const <a class="el" href="structnnvm_1_1NodeEntry.html">NodeEntry</a> &src, const <a class="el" href="structnnvm_1_1NodeEntry.html">NodeEntry</a> &like)> </td> |
| <td class="paramname"><em>attr_hint_fun</em> = <code>nullptr</code>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">std::vector< const <a class="el" href="classnnvm_1_1Op.html">Op</a> * > </td> |
| <td class="paramname"><em>zero_ops</em> = <code>std::vector<const <a class="el" href="classnnvm_1_1Op.html">Op</a>*>()</code>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">std::string </td> |
| <td class="paramname"><em>copy_op_str</em> = <code>std::string()</code> </td> |
| </tr> |
| <tr> |
| <td></td> |
| <td>)</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 the gradient graph whose outputs are gradients of xs wrt to ys. </p> |
| <dl class="params"><dt>Parameters</dt><dd> |
| <table class="params"> |
| <tr><td class="paramname">graph</td><td>The input graph. </td></tr> |
| <tr><td class="paramname">ys</td><td>The entries we want to take gradient from. </td></tr> |
| <tr><td class="paramname">xs</td><td>The input to take gradient with respect to. </td></tr> |
| <tr><td class="paramname">ys_out_grad</td><td>The symbol for additional gradient to be propagate back to y. </td></tr> |
| <tr><td class="paramname">aggregate_fun</td><td>Aggregation function applied to aggregate the inputs. </td></tr> |
| <tr><td class="paramname">mirror_fun</td><td>Optional mirror function to do mirror optimization and save memory. </td></tr> |
| <tr><td class="paramname">attr_hint_fun</td><td>Optional, hint function to output a node that like src, but its attr is same as like.</td></tr> |
| <tr><td class="paramname">zero_ops</td><td>Optional, list of operators that outputs a single zero array. The first one must be zeros_like.</td></tr> |
| <tr><td class="paramname">copy_op_str</td><td>Optional, name of the copy operation required to handle duplicates on the edge of the graph </td></tr> |
| </table> |
| </dd> |
| </dl> |
| <dl class="section return"><dt>Returns</dt><dd>A new graph, whose outputs correspond to inputs of xs. </dd></dl> |
| |
| </div> |
| </div> |
| <a id="a9fd9e840e169150d3cb4439448fd1561"></a> |
| <h2 class="memtitle"><span class="permalink"><a href="#a9fd9e840e169150d3cb4439448fd1561">◆ </a></span>InferShape()</h2> |
| |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname"><a class="el" href="classnnvm_1_1Graph.html">Graph</a> nnvm::pass::InferShape </td> |
| <td>(</td> |
| <td class="paramtype"><a class="el" href="classnnvm_1_1Graph.html">Graph</a> </td> |
| <td class="paramname"><em>graph</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype"><a class="el" href="namespacennvm.html#a77a000cfbb76bfc17042b49ef30fe36f">ShapeVector</a> </td> |
| <td class="paramname"><em>shape_inputs</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">std::string </td> |
| <td class="paramname"><em>shape_attr_key</em> = <code>""</code> </td> |
| </tr> |
| <tr> |
| <td></td> |
| <td>)</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>Infer shapes in the graph given the information. </p> |
| <dl class="params"><dt>Parameters</dt><dd> |
| <table class="params"> |
| <tr><td class="paramname">graph</td><td>The input graph. </td></tr> |
| <tr><td class="paramname">shape_inputs</td><td>The shapes of input symbols to the graph. </td></tr> |
| <tr><td class="paramname">shape_attr_key</td><td>The key to the node attribute that can indicate shape. This is the place where manual hint for shapes could be injected. </td></tr> |
| </table> |
| </dd> |
| </dl> |
| <dl class="section return"><dt>Returns</dt><dd>A graph with new attribute "shape" containing inferred shape of each <a class="el" href="structnnvm_1_1NodeEntry.html" title="an entry that represents output data from a node">NodeEntry</a>. The index of ShapeVector is given by graph.indexed_graph().entry_id. </dd></dl> |
| |
| </div> |
| </div> |
| <a id="ab29a181d9547fdac0f205c3aaec0de68"></a> |
| <h2 class="memtitle"><span class="permalink"><a href="#ab29a181d9547fdac0f205c3aaec0de68">◆ </a></span>InferType()</h2> |
| |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname"><a class="el" href="classnnvm_1_1Graph.html">Graph</a> nnvm::pass::InferType </td> |
| <td>(</td> |
| <td class="paramtype"><a class="el" href="classnnvm_1_1Graph.html">Graph</a> </td> |
| <td class="paramname"><em>graph</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype"><a class="el" href="namespacennvm.html#af3047555e6bce725a8abba02b4155de9">DTypeVector</a> </td> |
| <td class="paramname"><em>dtype_inputs</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">std::string </td> |
| <td class="paramname"><em>dtype_attr_key</em> = <code>""</code> </td> |
| </tr> |
| <tr> |
| <td></td> |
| <td>)</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>Infer types in the graph given the information. </p> |
| <dl class="params"><dt>Parameters</dt><dd> |
| <table class="params"> |
| <tr><td class="paramname">graph</td><td>The input graph. </td></tr> |
| <tr><td class="paramname">dtype_inputs</td><td>The types of input symbols to the graph. </td></tr> |
| <tr><td class="paramname">dtype_attr_key</td><td>The key to the node attribute that can indicate types. This is the place where manual hint for types could be injected. </td></tr> |
| </table> |
| </dd> |
| </dl> |
| <dl class="section return"><dt>Returns</dt><dd>A graph with new attribute "dtype" containing inferred type of each <a class="el" href="structnnvm_1_1NodeEntry.html" title="an entry that represents output data from a node">NodeEntry</a>. The index of ShapeVector is given by graph.indexed_graph().entry_id. </dd></dl> |
| |
| </div> |
| </div> |
| <a id="aac90eb2d4aea5e49892b0e0a914fe94b"></a> |
| <h2 class="memtitle"><span class="permalink"><a href="#aac90eb2d4aea5e49892b0e0a914fe94b">◆ </a></span>LoadJSON()</h2> |
| |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname"><a class="el" href="classnnvm_1_1Graph.html">Graph</a> nnvm::pass::LoadJSON </td> |
| <td>(</td> |
| <td class="paramtype">const std::string & </td> |
| <td class="paramname"><em>json_str</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>Load a graph from JSON string, redirects to "LoadJSON" pass. </p> |
| <dl class="params"><dt>Parameters</dt><dd> |
| <table class="params"> |
| <tr><td class="paramname">json_str</td><td>The json string. </td></tr> |
| </table> |
| </dd> |
| </dl> |
| <dl class="section return"><dt>Returns</dt><dd>Loaded graph. </dd></dl> |
| |
| </div> |
| </div> |
| <a id="a58861df29a62ee368c4bc672f03eff62"></a> |
| <h2 class="memtitle"><span class="permalink"><a href="#a58861df29a62ee368c4bc672f03eff62">◆ </a></span>OrderMutation()</h2> |
| |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname"><a class="el" href="classnnvm_1_1Graph.html">Graph</a> nnvm::pass::OrderMutation </td> |
| <td>(</td> |
| <td class="paramtype"><a class="el" href="classnnvm_1_1Graph.html">Graph</a> </td> |
| <td class="paramname"><em>src</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>Add control flow dependencies between nodes. </p> |
| <p>This function will enforce the correct order between write (mutable operators) and read (immutable operators) to sovle write-after-read and read-after-write problems.</p> |
| <dl class="params"><dt>Parameters</dt><dd> |
| <table class="params"> |
| <tr><td class="paramname">src</td><td>The input graph. </td></tr> |
| </table> |
| </dd> |
| </dl> |
| <dl class="section return"><dt>Returns</dt><dd>A graph with proper control flow dependencies added. </dd></dl> |
| |
| </div> |
| </div> |
| <a id="ad5d216c596bc52189f90b392e0e9b115"></a> |
| <h2 class="memtitle"><span class="permalink"><a href="#ad5d216c596bc52189f90b392e0e9b115">◆ </a></span>PlaceDevice()</h2> |
| |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname"><a class="el" href="classnnvm_1_1Graph.html">Graph</a> nnvm::pass::PlaceDevice </td> |
| <td>(</td> |
| <td class="paramtype"><a class="el" href="classnnvm_1_1Graph.html">Graph</a> </td> |
| <td class="paramname"><em>graph</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">std::string </td> |
| <td class="paramname"><em>device_group_attr_key</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype"><a class="el" href="namespacennvm.html#a52d908d5e1bfdbd544f1b6d2c99682cc">DeviceAssignMap</a> </td> |
| <td class="paramname"><em>device_assign_map</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">std::string </td> |
| <td class="paramname"><em>device_copy_op</em> </td> |
| </tr> |
| <tr> |
| <td></td> |
| <td>)</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>Place the devices for each operator in the graph. </p> |
| <p>Current device placement is quite simple. Each operator is assigned to a "group" (stored in <code>device_group_attr_key</code> attribute). Each group is assigned to a device (stored in <code>device_assign_map</code> attribute). Operators will be placed to the device assigned to its group. Copy operators will be injected if cross device reference happens.</p> |
| <dl class="params"><dt>Parameters</dt><dd> |
| <table class="params"> |
| <tr><td class="paramname">graph</td><td>The input graph. </td></tr> |
| <tr><td class="paramname">device_group_attr_key</td><td>The attribute name for hints of device group. </td></tr> |
| <tr><td class="paramname">device_assign_map</td><td>The assignment map of device. </td></tr> |
| <tr><td class="paramname">device_copy_op</td><td>The name of copy op to be inserted when cross device copy happened. </td></tr> |
| </table> |
| </dd> |
| </dl> |
| <dl class="section return"><dt>Returns</dt><dd>A graph with new attribute "device", cotaining device information of each node. </dd></dl> |
| |
| </div> |
| </div> |
| <a id="aeb99f53fcc75259eb131a61fce2350f7"></a> |
| <h2 class="memtitle"><span class="permalink"><a href="#aeb99f53fcc75259eb131a61fce2350f7">◆ </a></span>PrintGraphIR()</h2> |
| |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">std::string nnvm::pass::PrintGraphIR </td> |
| <td>(</td> |
| <td class="paramtype"><a class="el" href="classnnvm_1_1Graph.html">Graph</a> </td> |
| <td class="paramname"><em>graph</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>Print graph ir. </p> |
| <dl class="params"><dt>Parameters</dt><dd> |
| <table class="params"> |
| <tr><td class="paramname">graph</td><td>The graph to be printed </td></tr> |
| </table> |
| </dd> |
| </dl> |
| <dl class="section return"><dt>Returns</dt><dd>The graph ir string. </dd></dl> |
| |
| </div> |
| </div> |
| <a id="ab82581d1205ed50203822366f2f5f5f5"></a> |
| <h2 class="memtitle"><span class="permalink"><a href="#ab82581d1205ed50203822366f2f5f5f5">◆ </a></span>SaveJSON()</h2> |
| |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">std::string nnvm::pass::SaveJSON </td> |
| <td>(</td> |
| <td class="paramtype"><a class="el" href="classnnvm_1_1Graph.html">Graph</a> </td> |
| <td class="paramname"><em>graph</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>Save a graph to json, redirects to "SaveJSON" pass. </p> |
| <dl class="params"><dt>Parameters</dt><dd> |
| <table class="params"> |
| <tr><td class="paramname">graph</td><td>The graph to be saved as json format. </td></tr> |
| </table> |
| </dd> |
| </dl> |
| <dl class="section return"><dt>Returns</dt><dd>The json string. </dd></dl> |
| |
| </div> |
| </div> |
| </div><!-- contents --> |
| <!-- start footer part --> |
| <hr class="footer"/><address class="footer"><small> |
| Generated on Sat Nov 5 2022 01:16:59 for mxnet by  <a href="http://www.doxygen.org/index.html"> |
| <img class="footer" src="doxygen.png" alt="doxygen"/> |
| </a> 1.8.17 |
| </small></address> |
| </body> |
| </html> |