blob: 588b96f40b7e6bed8014e1bc4e7322a1a8dcbecc [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.6"/>
<title>mxnet: mxnet::Operator 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/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</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 style="padding-left: 0.5em;">
<div id="projectname">mxnet
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Macros</a></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="namespacemxnet.html">mxnet</a></li><li class="navelem"><a class="el" href="classmxnet_1_1Operator.html">Operator</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classmxnet_1_1Operator-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">mxnet::Operator Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div> </div>
</div><!--header-->
<div class="contents">
<p><a class="el" href="classmxnet_1_1Operator.html" title="Operator interface. Operator defines basic operation unit of optimized computation graph in mxnet...">Operator</a> interface. <a class="el" href="classmxnet_1_1Operator.html" title="Operator interface. Operator defines basic operation unit of optimized computation graph in mxnet...">Operator</a> defines basic operation unit of optimized computation graph in mxnet. This interface relies on pre-allocated memory in <a class="el" href="classmxnet_1_1TBlob.html" title="tensor blob class that can be used to hold tensor of any dimension, any device and any data type...">TBlob</a>, the caller need to set the memory region in <a class="el" href="classmxnet_1_1TBlob.html" title="tensor blob class that can be used to hold tensor of any dimension, any device and any data type...">TBlob</a> correctly before calling Forward and Backward.
<a href="classmxnet_1_1Operator.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="operator_8h_source.html">operator.h</a>&gt;</code></p>
<div class="dynheader">
Collaboration diagram for mxnet::Operator:</div>
<div class="dyncontent">
<div class="center"><img src="classmxnet_1_1Operator__coll__graph.png" border="0" usemap="#mxnet_1_1Operator_coll__map" alt="Collaboration graph"/></div>
<map name="mxnet_1_1Operator_coll__map" id="mxnet_1_1Operator_coll__map">
</map>
</div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a89a284fada5cc1801ca1c0390b8ae17a"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmxnet_1_1Operator.html#a89a284fada5cc1801ca1c0390b8ae17a">ExecType</a> { <a class="el" href="classmxnet_1_1Operator.html#a89a284fada5cc1801ca1c0390b8ae17aa8adac8fd6acb05ff169a2913ad05122c">kSync</a>,
<a class="el" href="classmxnet_1_1Operator.html#a89a284fada5cc1801ca1c0390b8ae17aa6c403d828787dc2aafd6ee1e9cd02699">kAsync</a>,
<a class="el" href="classmxnet_1_1Operator.html#a89a284fada5cc1801ca1c0390b8ae17aaebe5a0e5db6ee71f6905f9b34a1f05ad">kCrossDeviceCopy</a>
}</td></tr>
<tr class="memdesc:a89a284fada5cc1801ca1c0390b8ae17a"><td class="mdescLeft">&#160;</td><td class="mdescRight">the execution type of the operator <a href="classmxnet_1_1Operator.html#a89a284fada5cc1801ca1c0390b8ae17a">More...</a><br/></td></tr>
<tr class="separator:a89a284fada5cc1801ca1c0390b8ae17a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><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:a4d34cc792d7271bd8b5b60eaa0b55767"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmxnet_1_1Operator.html#a4d34cc792d7271bd8b5b60eaa0b55767">~Operator</a> ()</td></tr>
<tr class="memdesc:a4d34cc792d7271bd8b5b60eaa0b55767"><td class="mdescLeft">&#160;</td><td class="mdescRight">destructor <a href="#a4d34cc792d7271bd8b5b60eaa0b55767">More...</a><br/></td></tr>
<tr class="separator:a4d34cc792d7271bd8b5b60eaa0b55767"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3dbe23d985df86da51eeb868439872dd"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmxnet_1_1Operator.html#a3dbe23d985df86da51eeb868439872dd">Forward</a> (const <a class="el" href="structmxnet_1_1OpContext.html">OpContext</a> &amp;ctx, const std::vector&lt; <a class="el" href="classmxnet_1_1TBlob.html">TBlob</a> &gt; &amp;in_data, const std::vector&lt; <a class="el" href="namespacemxnet.html#a7cd7094ef222e9ae1f520c3b6a214398">OpReqType</a> &gt; &amp;req, const std::vector&lt; <a class="el" href="classmxnet_1_1TBlob.html">TBlob</a> &gt; &amp;out_data, const std::vector&lt; <a class="el" href="classmxnet_1_1TBlob.html">TBlob</a> &gt; &amp;aux_states)=0</td></tr>
<tr class="memdesc:a3dbe23d985df86da51eeb868439872dd"><td class="mdescLeft">&#160;</td><td class="mdescRight">perform a forward operation of <a class="el" href="classmxnet_1_1Operator.html" title="Operator interface. Operator defines basic operation unit of optimized computation graph in mxnet...">Operator</a>, save the output to <a class="el" href="classmxnet_1_1TBlob.html" title="tensor blob class that can be used to hold tensor of any dimension, any device and any data type...">TBlob</a>. <a href="#a3dbe23d985df86da51eeb868439872dd">More...</a><br/></td></tr>
<tr class="separator:a3dbe23d985df86da51eeb868439872dd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad32d74b9bf56caf920b5e6379d2bb259"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmxnet_1_1Operator.html#ad32d74b9bf56caf920b5e6379d2bb259">Backward</a> (const <a class="el" href="structmxnet_1_1OpContext.html">OpContext</a> &amp;ctx, const std::vector&lt; <a class="el" href="classmxnet_1_1TBlob.html">TBlob</a> &gt; &amp;out_grad, const std::vector&lt; <a class="el" href="classmxnet_1_1TBlob.html">TBlob</a> &gt; &amp;in_data, const std::vector&lt; <a class="el" href="classmxnet_1_1TBlob.html">TBlob</a> &gt; &amp;out_data, const std::vector&lt; <a class="el" href="namespacemxnet.html#a7cd7094ef222e9ae1f520c3b6a214398">OpReqType</a> &gt; &amp;req, const std::vector&lt; <a class="el" href="classmxnet_1_1TBlob.html">TBlob</a> &gt; &amp;in_grad, const std::vector&lt; <a class="el" href="classmxnet_1_1TBlob.html">TBlob</a> &gt; &amp;aux_states)</td></tr>
<tr class="memdesc:ad32d74b9bf56caf920b5e6379d2bb259"><td class="mdescLeft">&#160;</td><td class="mdescRight">Perform a Backward Operation, write gradient to the in_grad. <a href="#ad32d74b9bf56caf920b5e6379d2bb259">More...</a><br/></td></tr>
<tr class="separator:ad32d74b9bf56caf920b5e6379d2bb259"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7bffb2be177edf8c29fd0148ebbd7ca5"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classmxnet_1_1Operator.html#a89a284fada5cc1801ca1c0390b8ae17a">ExecType</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmxnet_1_1Operator.html#a7bffb2be177edf8c29fd0148ebbd7ca5">exec_type</a> () const </td></tr>
<tr class="separator:a7bffb2be177edf8c29fd0148ebbd7ca5"><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><a class="el" href="classmxnet_1_1Operator.html" title="Operator interface. Operator defines basic operation unit of optimized computation graph in mxnet...">Operator</a> interface. <a class="el" href="classmxnet_1_1Operator.html" title="Operator interface. Operator defines basic operation unit of optimized computation graph in mxnet...">Operator</a> defines basic operation unit of optimized computation graph in mxnet. This interface relies on pre-allocated memory in <a class="el" href="classmxnet_1_1TBlob.html" title="tensor blob class that can be used to hold tensor of any dimension, any device and any data type...">TBlob</a>, the caller need to set the memory region in <a class="el" href="classmxnet_1_1TBlob.html" title="tensor blob class that can be used to hold tensor of any dimension, any device and any data type...">TBlob</a> correctly before calling Forward and Backward. </p>
<p><a class="el" href="classmxnet_1_1Operator.html" title="Operator interface. Operator defines basic operation unit of optimized computation graph in mxnet...">Operator</a> is generated by <a class="el" href="classmxnet_1_1OperatorProperty.html" title="OperatorProperty is a object that stores all information about Operator. It also contains method to g...">OperatorProperty</a>. To add new operator(aka. layers of neural nets) to mxnet, developer need to create a new <a class="el" href="classmxnet_1_1OperatorProperty.html" title="OperatorProperty is a object that stores all information about Operator. It also contains method to g...">OperatorProperty</a> and its corresponding <a class="el" href="classmxnet_1_1Operator.html" title="Operator interface. Operator defines basic operation unit of optimized computation graph in mxnet...">Operator</a>.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classmxnet_1_1TBlob.html" title="tensor blob class that can be used to hold tensor of any dimension, any device and any data type...">TBlob</a>, <a class="el" href="namespacemxnet.html#a6e14bb5f6ffc81892feca8d1da658687" title="Shape data structure used to record shape information. ">TShape</a>, <a class="el" href="classmxnet_1_1OperatorProperty.html" title="OperatorProperty is a object that stores all information about Operator. It also contains method to g...">OperatorProperty</a> </dd></dl>
</div><h2 class="groupheader">Member Enumeration Documentation</h2>
<a class="anchor" id="a89a284fada5cc1801ca1c0390b8ae17a"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="classmxnet_1_1Operator.html#a89a284fada5cc1801ca1c0390b8ae17a">mxnet::Operator::ExecType</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>the execution type of the operator </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="a89a284fada5cc1801ca1c0390b8ae17aa8adac8fd6acb05ff169a2913ad05122c"></a>kSync</em>&#160;</td><td class="fielddoc">
<p>Forward/Backward are synchronize calls. </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a89a284fada5cc1801ca1c0390b8ae17aa6c403d828787dc2aafd6ee1e9cd02699"></a>kAsync</em>&#160;</td><td class="fielddoc">
<p>Forward/Backward are asynchronize, will call <a class="el" href="structmxnet_1_1OpContext.html#a40ce0e3d4ac21412cfafafc5b1fd32ef" title="the callback when operation completes, used by asynchronize ops ">OpContext.async_on_complete</a> when operation finishes. </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a89a284fada5cc1801ca1c0390b8ae17aaebe5a0e5db6ee71f6905f9b34a1f05ad"></a>kCrossDeviceCopy</em>&#160;</td><td class="fielddoc">
<p>Cross device copy operation, this is a special operator That indicates copy across devices, the input and output can sit on different device. In current implementation, copy operator is specially handled by executor. This flag is used for special case treatment and future extension of different copy ops. </p>
</td></tr>
</table>
</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a4d34cc792d7271bd8b5b60eaa0b55767"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual mxnet::Operator::~Operator </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>destructor </p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="ad32d74b9bf56caf920b5e6379d2bb259"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual void mxnet::Operator::Backward </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="structmxnet_1_1OpContext.html">OpContext</a> &amp;&#160;</td>
<td class="paramname"><em>ctx</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::vector&lt; <a class="el" href="classmxnet_1_1TBlob.html">TBlob</a> &gt; &amp;&#160;</td>
<td class="paramname"><em>out_grad</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::vector&lt; <a class="el" href="classmxnet_1_1TBlob.html">TBlob</a> &gt; &amp;&#160;</td>
<td class="paramname"><em>in_data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::vector&lt; <a class="el" href="classmxnet_1_1TBlob.html">TBlob</a> &gt; &amp;&#160;</td>
<td class="paramname"><em>out_data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::vector&lt; <a class="el" href="namespacemxnet.html#a7cd7094ef222e9ae1f520c3b6a214398">OpReqType</a> &gt; &amp;&#160;</td>
<td class="paramname"><em>req</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::vector&lt; <a class="el" href="classmxnet_1_1TBlob.html">TBlob</a> &gt; &amp;&#160;</td>
<td class="paramname"><em>in_grad</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::vector&lt; <a class="el" href="classmxnet_1_1TBlob.html">TBlob</a> &gt; &amp;&#160;</td>
<td class="paramname"><em>aux_states</em>&#160;</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 class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Perform a Backward Operation, write gradient to the in_grad. </p>
<dl class="section note"><dt>Note</dt><dd>Convention: out_grad.size() == <a class="el" href="classmxnet_1_1OperatorProperty.html#a6dc5ecd089ef01dcc154c02b20ad2f4b" title="get number of visible return values during Symbol creation. If NumVisibleOutputs() = k...">OperatorProperty.NumVisibleOutputs()</a> out_data.size() == <a class="el" href="classmxnet_1_1OperatorProperty.html#a49e25d85c38199338a9fa8150bc86df1">OperatorProperty.NumOutputs()</a> out_data can contain additional invisible returns that remembers the state carried from the Forward pass. For example mask in the dropout. The gradients are passed from visible returns in this function.</dd></dl>
<dl class="section user"><dt></dt><dd>Not all the TBlobs in the arguments will be available if you override the DeclareBackwardDependency of corresponding <a class="el" href="classmxnet_1_1OperatorProperty.html" title="OperatorProperty is a object that stores all information about Operator. It also contains method to g...">OperatorProperty</a> class. Only the dependencies you declared will be available at corresponding position, the rest of the parameters are simply dummy where you will get a nullptr. You will be safe if you use the default DeclareBackwardDependency. But only declare what you need will give engine more chance for optimization.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">ctx</td><td>runtime context available to this call </td></tr>
<tr><td class="paramname">out_grad</td><td>the gradient value we get from of the <a class="el" href="classmxnet_1_1Operator.html" title="Operator interface. Operator defines basic operation unit of optimized computation graph in mxnet...">Operator</a>. </td></tr>
<tr><td class="paramname">in_data</td><td>the array of input data. </td></tr>
<tr><td class="paramname">out_data</td><td>the array of output data. </td></tr>
<tr><td class="paramname">req</td><td>request types of the saving operation, can be all types. </td></tr>
<tr><td class="paramname">in_grad</td><td>the array of gradient we need to write to. </td></tr>
<tr><td class="paramname">aux_states</td><td>Auxiliary states of operator. Normally operator doesn't need </td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classmxnet_1_1OperatorProperty.html" title="OperatorProperty is a object that stores all information about Operator. It also contains method to g...">OperatorProperty</a>, <a class="el" href="namespacemxnet.html#a7cd7094ef222e9ae1f520c3b6a214398" title="operation request type to Forward and Backward ">OpReqType</a>, <a class="el" href="structmxnet_1_1OpContext.html" title="All the possible information needed by Operator.Forward and Backward This is the superset of RunConte...">OpContext</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a7bffb2be177edf8c29fd0148ebbd7ca5"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="classmxnet_1_1Operator.html#a89a284fada5cc1801ca1c0390b8ae17a">ExecType</a> mxnet::Operator::exec_type </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>execution type of the operator </dd></dl>
</div>
</div>
<a class="anchor" id="a3dbe23d985df86da51eeb868439872dd"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual void mxnet::Operator::Forward </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="structmxnet_1_1OpContext.html">OpContext</a> &amp;&#160;</td>
<td class="paramname"><em>ctx</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::vector&lt; <a class="el" href="classmxnet_1_1TBlob.html">TBlob</a> &gt; &amp;&#160;</td>
<td class="paramname"><em>in_data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::vector&lt; <a class="el" href="namespacemxnet.html#a7cd7094ef222e9ae1f520c3b6a214398">OpReqType</a> &gt; &amp;&#160;</td>
<td class="paramname"><em>req</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::vector&lt; <a class="el" href="classmxnet_1_1TBlob.html">TBlob</a> &gt; &amp;&#160;</td>
<td class="paramname"><em>out_data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::vector&lt; <a class="el" href="classmxnet_1_1TBlob.html">TBlob</a> &gt; &amp;&#160;</td>
<td class="paramname"><em>aux_states</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>perform a forward operation of <a class="el" href="classmxnet_1_1Operator.html" title="Operator interface. Operator defines basic operation unit of optimized computation graph in mxnet...">Operator</a>, save the output to <a class="el" href="classmxnet_1_1TBlob.html" title="tensor blob class that can be used to hold tensor of any dimension, any device and any data type...">TBlob</a>. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">ctx</td><td>runtime context available to this call </td></tr>
<tr><td class="paramname">in_data</td><td>array of input data, it is const </td></tr>
<tr><td class="paramname">req</td><td>the request types of saving operation, can only be kWriteTo or kWriteInplace. </td></tr>
<tr><td class="paramname">out_data</td><td>array of output data, pointer is used to indicate that this is holder the space of <a class="el" href="classmxnet_1_1TBlob.html" title="tensor blob class that can be used to hold tensor of any dimension, any device and any data type...">TBlob</a> in out_data must be pre-allocated with InferShape </td></tr>
<tr><td class="paramname">aux_states</td><td>Auxiliary states of operator. Normally operator doesn't need, epecial case like Batch Norm requires. </td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="namespacemxnet.html#a7cd7094ef222e9ae1f520c3b6a214398" title="operation request type to Forward and Backward ">OpReqType</a>, <a class="el" href="structmxnet_1_1OpContext.html" title="All the possible information needed by Operator.Forward and Backward This is the superset of RunConte...">OpContext</a> </dd></dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>include/mxnet/<a class="el" href="operator_8h_source.html">operator.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sun Aug 6 2017 07:14:31 for mxnet by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.6
</small></address>
</body>
</html>