blob: a64f73479bc33a43e6c1f53590d5b383076f6d6a [file] [log] [blame]
<!-- HTML header for doxygen 1.8.15-->
<!-- Remember to use version doxygen 1.8.15 +-->
<!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.15"/>
<meta name="robots" content="NOINDEX, NOFOLLOW" /> <!-- Prevent indexing by search engines -->
<title>Compute Library: NEPadLayer 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="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(initResizable);
/* @license-end */</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>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" async="async" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="stylesheet.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;">
<img alt="Compute Library" src="https://raw.githubusercontent.com/ARM-software/ComputeLibrary/gh-pages/ACL_logo.png" style="max-width: 100%;margin-top: 15px;margin-left: 10px"/>
<td style="padding-left: 0.5em;">
<div id="projectname">
&#160;<span id="projectnumber">19.08</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;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&amp;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>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('classarm__compute_1_1_n_e_pad_layer.xhtml','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- 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 class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> </div>
<div class="headertitle">
<div class="title">NEPadLayer Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Basic function to pad a tensor.
<a href="classarm__compute_1_1_n_e_pad_layer.xhtml#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="_n_e_pad_layer_8h_source.xhtml">NEPadLayer.h</a>&gt;</code></p>
<div class="dynheader">
Collaboration diagram for NEPadLayer:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="classarm__compute_1_1_n_e_pad_layer__coll__graph.svg" width="110" height="112"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
<center><span class="legend">[<a target="top" href="graph_legend.xhtml">legend</a>]</span></center></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:a79ddca98792472ac497d7acc81933398"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_n_e_pad_layer.xhtml#a79ddca98792472ac497d7acc81933398">NEPadLayer</a> ()</td></tr>
<tr class="memdesc:a79ddca98792472ac497d7acc81933398"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default constructor. <a href="#a79ddca98792472ac497d7acc81933398">More...</a><br /></td></tr>
<tr class="separator:a79ddca98792472ac497d7acc81933398"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac5a4e9c1564aa9892dfe02cdce2f55b3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_n_e_pad_layer.xhtml#ac5a4e9c1564aa9892dfe02cdce2f55b3">configure</a> (<a class="el" href="classarm__compute_1_1_i_tensor.xhtml">ITensor</a> *input, <a class="el" href="classarm__compute_1_1_i_tensor.xhtml">ITensor</a> *output, const <a class="el" href="namespacearm__compute.xhtml#ac1a1b012674e0f1de071a611391828ad">PaddingList</a> &amp;padding, const <a class="el" href="classarm__compute_1_1_pixel_value.xhtml">PixelValue</a> constant_value=<a class="el" href="classarm__compute_1_1_pixel_value.xhtml">PixelValue</a>(), const <a class="el" href="namespacearm__compute.xhtml#a14d24d90ab4ba2956e92e27890ba4c91">PaddingMode</a> mode=<a class="el" href="namespacearm__compute.xhtml#a14d24d90ab4ba2956e92e27890ba4c91a8d6b5cada83510220f59e00ce86d4d92">PaddingMode::CONSTANT</a>)</td></tr>
<tr class="memdesc:ac5a4e9c1564aa9892dfe02cdce2f55b3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the function. <a href="#ac5a4e9c1564aa9892dfe02cdce2f55b3">More...</a><br /></td></tr>
<tr class="separator:ac5a4e9c1564aa9892dfe02cdce2f55b3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad1717410afd0be936c6213a63c8005fb"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_n_e_pad_layer.xhtml#ad1717410afd0be936c6213a63c8005fb">run</a> () override</td></tr>
<tr class="memdesc:ad1717410afd0be936c6213a63c8005fb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Run the kernels contained in the function. <a href="#ad1717410afd0be936c6213a63c8005fb">More...</a><br /></td></tr>
<tr class="separator:ad1717410afd0be936c6213a63c8005fb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classarm__compute_1_1_i_function"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classarm__compute_1_1_i_function')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classarm__compute_1_1_i_function.xhtml">IFunction</a></td></tr>
<tr class="memitem:ab921ecc3f3f6ae2b4bd61f3e1998d8c4 inherit pub_methods_classarm__compute_1_1_i_function"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_i_function.xhtml#ab921ecc3f3f6ae2b4bd61f3e1998d8c4">~IFunction</a> ()=default</td></tr>
<tr class="memdesc:ab921ecc3f3f6ae2b4bd61f3e1998d8c4 inherit pub_methods_classarm__compute_1_1_i_function"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <a href="classarm__compute_1_1_i_function.xhtml#ab921ecc3f3f6ae2b4bd61f3e1998d8c4">More...</a><br /></td></tr>
<tr class="separator:ab921ecc3f3f6ae2b4bd61f3e1998d8c4 inherit pub_methods_classarm__compute_1_1_i_function"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a820f7291c24155a2980512fae45aac26 inherit pub_methods_classarm__compute_1_1_i_function"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_i_function.xhtml#a820f7291c24155a2980512fae45aac26">prepare</a> ()</td></tr>
<tr class="memdesc:a820f7291c24155a2980512fae45aac26 inherit pub_methods_classarm__compute_1_1_i_function"><td class="mdescLeft">&#160;</td><td class="mdescRight">Prepare the function for executing. <a href="classarm__compute_1_1_i_function.xhtml#a820f7291c24155a2980512fae45aac26">More...</a><br /></td></tr>
<tr class="separator:a820f7291c24155a2980512fae45aac26 inherit pub_methods_classarm__compute_1_1_i_function"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:ad225c9d90d11cba16d9b34137cdf965b"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classarm__compute_1_1_status.xhtml">Status</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_n_e_pad_layer.xhtml#ad225c9d90d11cba16d9b34137cdf965b">validate</a> (const <a class="el" href="classarm__compute_1_1_i_tensor_info.xhtml">ITensorInfo</a> *input, const <a class="el" href="classarm__compute_1_1_i_tensor_info.xhtml">ITensorInfo</a> *output, const <a class="el" href="namespacearm__compute.xhtml#ac1a1b012674e0f1de071a611391828ad">PaddingList</a> &amp;padding, const <a class="el" href="classarm__compute_1_1_pixel_value.xhtml">PixelValue</a> constant_value=<a class="el" href="classarm__compute_1_1_pixel_value.xhtml">PixelValue</a>(), const <a class="el" href="namespacearm__compute.xhtml#a14d24d90ab4ba2956e92e27890ba4c91">PaddingMode</a> mode=<a class="el" href="namespacearm__compute.xhtml#a14d24d90ab4ba2956e92e27890ba4c91a8d6b5cada83510220f59e00ce86d4d92">PaddingMode::CONSTANT</a>)</td></tr>
<tr class="memdesc:ad225c9d90d11cba16d9b34137cdf965b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Static function to check if given info will lead to a valid configuration of <a class="el" href="classarm__compute_1_1_n_e_pad_layer.xhtml">NEPadLayer</a>. <a href="#ad225c9d90d11cba16d9b34137cdf965b">More...</a><br /></td></tr>
<tr class="separator:ad225c9d90d11cba16d9b34137cdf965b"><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>Basic function to pad a tensor. </p>
<p>This function calls the following NEON kernels:</p>
<ol type="1">
<li><a class="el" href="classarm__compute_1_1_n_e_memset_kernel.xhtml">NEMemsetKernel</a></li>
<li><a class="el" href="classarm__compute_1_1_n_e_copy_kernel.xhtml">NECopyKernel</a> </li>
</ol>
<p class="definition">Definition at line <a class="el" href="_n_e_pad_layer_8h_source.xhtml#l00044">44</a> of file <a class="el" href="_n_e_pad_layer_8h_source.xhtml">NEPadLayer.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a79ddca98792472ac497d7acc81933398"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a79ddca98792472ac497d7acc81933398">&#9670;&nbsp;</a></span>NEPadLayer()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classarm__compute_1_1_n_e_pad_layer.xhtml">NEPadLayer</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Default constructor. </p>
<p class="definition">Definition at line <a class="el" href="_n_e_pad_layer_8cpp_source.xhtml#l00078">78</a> of file <a class="el" href="_n_e_pad_layer_8cpp_source.xhtml">NEPadLayer.cpp</a>.</p>
<div class="fragment"><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; : _copy_kernel(), _mode(), _padding(), _memset_kernel(), _num_dimensions(0), _slice_functions(), _concat_functions(), _slice_results(), _concat_results(), _output_subtensor()</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;{</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;}</div></div><!-- fragment -->
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="ac5a4e9c1564aa9892dfe02cdce2f55b3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac5a4e9c1564aa9892dfe02cdce2f55b3">&#9670;&nbsp;</a></span>configure()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void configure </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classarm__compute_1_1_i_tensor.xhtml">ITensor</a> *&#160;</td>
<td class="paramname"><em>input</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classarm__compute_1_1_i_tensor.xhtml">ITensor</a> *&#160;</td>
<td class="paramname"><em>output</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="namespacearm__compute.xhtml#ac1a1b012674e0f1de071a611391828ad">PaddingList</a> &amp;&#160;</td>
<td class="paramname"><em>padding</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classarm__compute_1_1_pixel_value.xhtml">PixelValue</a>&#160;</td>
<td class="paramname"><em>constant_value</em> = <code><a class="el" href="classarm__compute_1_1_pixel_value.xhtml">PixelValue</a>()</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="namespacearm__compute.xhtml#a14d24d90ab4ba2956e92e27890ba4c91">PaddingMode</a>&#160;</td>
<td class="paramname"><em>mode</em> = <code><a class="el" href="namespacearm__compute.xhtml#a14d24d90ab4ba2956e92e27890ba4c91a8d6b5cada83510220f59e00ce86d4d92">PaddingMode::CONSTANT</a></code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Initialize the function. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">input</td><td>Source tensor. Data types supported: U8/S8/QASYMM8/U16/S16/F16/U32/S32/F32. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">output</td><td>Output tensor. Data type supported: same as <code>input</code> </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">padding</td><td>The padding for each spatial dimension of the input tensor. The pair padding[i] specifies the front and the end padding in the i-th dimension. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">constant_value</td><td>(Optional) Constant value to be used for the padding </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">mode</td><td>(Optional) Controls whether the padding should be filled with <code>constant_value</code> using CONSTANT, or reflect the input, either including the border values (SYMMETRIC) or not (REFLECT). </td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="_n_e_pad_layer_8cpp_source.xhtml#l00201">201</a> of file <a class="el" href="_n_e_pad_layer_8cpp_source.xhtml">NEPadLayer.cpp</a>.</p>
<div class="fragment"><div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160;{</div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160; <a class="code" href="_error_8h.xhtml#a938dcd406ce611ef5345ad2531cdb948">ARM_COMPUTE_ERROR_THROW_ON</a>(<a class="code" href="classarm__compute_1_1_n_e_pad_layer.xhtml#ad225c9d90d11cba16d9b34137cdf965b">validate</a>(input-&gt;info(), output-&gt;info(), <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a735a025fce26c1ef147b54426df18181">padding</a>, constant_value, mode));</div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160;</div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; _padding = <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a735a025fce26c1ef147b54426df18181">padding</a>;</div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; _mode = mode;</div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160;</div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160; <span class="keyword">const</span> TensorShape padded_shape = <a class="code" href="namespacearm__compute_1_1misc_1_1shape__calculator.xhtml#a4e7f3187350db69156c1026860ace4e5">misc::shape_calculator::compute_padded_shape</a>(input-&gt;info()-&gt;tensor_shape(), _padding);</div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160;</div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160; <a class="code" href="namespacearm__compute.xhtml#a47be6fa38308d0003c25b60b7dbc45ce">auto_init_if_empty</a>(*output-&gt;info(), input-&gt;info()-&gt;clone()-&gt;set_tensor_shape(padded_shape));</div><div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160;</div><div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160; <span class="comment">// Find the last dimension requiring padding so that it is known when to write to output and whether any padding is applied.</span></div><div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160; _num_dimensions = last_padding_dimension(<a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a735a025fce26c1ef147b54426df18181">padding</a>) + 1;</div><div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; <span class="keywordflow">if</span>(_num_dimensions &gt; 0)</div><div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160; {</div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; <span class="keywordflow">switch</span>(_mode)</div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160; {</div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160; <span class="keywordflow">case</span> <a class="code" href="namespacearm__compute.xhtml#a14d24d90ab4ba2956e92e27890ba4c91a8d6b5cada83510220f59e00ce86d4d92">PaddingMode::CONSTANT</a>:</div><div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160; {</div><div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; configure_constant_mode(input, output, <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a735a025fce26c1ef147b54426df18181">padding</a>, constant_value);</div><div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160; <span class="keywordflow">break</span>;</div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; }</div><div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160; <span class="keywordflow">case</span> <a class="code" href="namespacearm__compute.xhtml#a14d24d90ab4ba2956e92e27890ba4c91ae4f6a05f82ed398f984f4bc1a55838df">PaddingMode::REFLECT</a>:</div><div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160; <span class="keywordflow">case</span> <a class="code" href="namespacearm__compute.xhtml#a14d24d90ab4ba2956e92e27890ba4c91a161b3d9016563aba9ac190fc02ada9bb">PaddingMode::SYMMETRIC</a>:</div><div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160; {</div><div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160; configure_reflect_symmetric_mode(input, output);</div><div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160; <span class="keywordflow">break</span>;</div><div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; }</div><div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160; <span class="keywordflow">default</span>:</div><div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160; <a class="code" href="_error_8h.xhtml#a05b19c75afe9c24200a62b9724734bbd">ARM_COMPUTE_ERROR</a>(<span class="stringliteral">&quot;Padding mode not supported.&quot;</span>);</div><div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; }</div><div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160; }</div><div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160; <span class="keywordflow">else</span></div><div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; {</div><div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160; <span class="comment">// Copy the input to the whole output if no padding is applied</span></div><div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160; _copy_kernel.<a class="code" href="classarm__compute_1_1_n_e_copy_kernel.xhtml#a83a344e60eb7db895953a942abf16628">configure</a>(input, output);</div><div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160; }</div><div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160;}</div><div class="ttc" id="_error_8h_xhtml_a05b19c75afe9c24200a62b9724734bbd"><div class="ttname"><a href="_error_8h.xhtml#a05b19c75afe9c24200a62b9724734bbd">ARM_COMPUTE_ERROR</a></div><div class="ttdeci">#define ARM_COMPUTE_ERROR(...)</div><div class="ttdoc">Print the given message then throw an std::runtime_error.</div><div class="ttdef"><b>Definition:</b> <a href="_error_8h_source.xhtml#l00261">Error.h:261</a></div></div>
<div class="ttc" id="_error_8h_xhtml_a938dcd406ce611ef5345ad2531cdb948"><div class="ttname"><a href="_error_8h.xhtml#a938dcd406ce611ef5345ad2531cdb948">ARM_COMPUTE_ERROR_THROW_ON</a></div><div class="ttdeci">#define ARM_COMPUTE_ERROR_THROW_ON(status)</div><div class="ttdef"><b>Definition:</b> <a href="_error_8h_source.xhtml#l00327">Error.h:327</a></div></div>
<div class="ttc" id="namespacearm__compute_xhtml_a14d24d90ab4ba2956e92e27890ba4c91a161b3d9016563aba9ac190fc02ada9bb"><div class="ttname"><a href="namespacearm__compute.xhtml#a14d24d90ab4ba2956e92e27890ba4c91a161b3d9016563aba9ac190fc02ada9bb">arm_compute::PaddingMode::SYMMETRIC</a></div></div>
<div class="ttc" id="namespacearm__compute_xhtml_a47be6fa38308d0003c25b60b7dbc45ce"><div class="ttname"><a href="namespacearm__compute.xhtml#a47be6fa38308d0003c25b60b7dbc45ce">arm_compute::auto_init_if_empty</a></div><div class="ttdeci">bool auto_init_if_empty(ITensorInfo &amp;info, const TensorShape &amp;shape, int num_channels, DataType data_type, QuantizationInfo quantization_info=QuantizationInfo())</div><div class="ttdoc">Auto initialize the tensor info (shape, number of channels and data type) if the current assignment i...</div><div class="ttdef"><b>Definition:</b> <a href="_helpers_8inl_source.xhtml#l00201">Helpers.inl:201</a></div></div>
<div class="ttc" id="classarm__compute_1_1_n_e_pad_layer_xhtml_ad225c9d90d11cba16d9b34137cdf965b"><div class="ttname"><a href="classarm__compute_1_1_n_e_pad_layer.xhtml#ad225c9d90d11cba16d9b34137cdf965b">arm_compute::NEPadLayer::validate</a></div><div class="ttdeci">static Status validate(const ITensorInfo *input, const ITensorInfo *output, const PaddingList &amp;padding, const PixelValue constant_value=PixelValue(), const PaddingMode mode=PaddingMode::CONSTANT)</div><div class="ttdoc">Static function to check if given info will lead to a valid configuration of NEPadLayer.</div><div class="ttdef"><b>Definition:</b> <a href="_n_e_pad_layer_8cpp_source.xhtml#l00240">NEPadLayer.cpp:240</a></div></div>
<div class="ttc" id="namespacearm__compute_1_1misc_1_1shape__calculator_xhtml_a4e7f3187350db69156c1026860ace4e5"><div class="ttname"><a href="namespacearm__compute_1_1misc_1_1shape__calculator.xhtml#a4e7f3187350db69156c1026860ace4e5">arm_compute::misc::shape_calculator::compute_padded_shape</a></div><div class="ttdeci">TensorShape compute_padded_shape(const TensorShape &amp;input_shape, const PaddingList &amp;padding)</div><div class="ttdoc">Calculate the padded shape of a tensor.</div><div class="ttdef"><b>Definition:</b> <a href="_shape_calculator_8h_source.xhtml#l01149">ShapeCalculator.h:1149</a></div></div>
<div class="ttc" id="namespacearm__compute_xhtml_a14d24d90ab4ba2956e92e27890ba4c91a8d6b5cada83510220f59e00ce86d4d92"><div class="ttname"><a href="namespacearm__compute.xhtml#a14d24d90ab4ba2956e92e27890ba4c91a8d6b5cada83510220f59e00ce86d4d92">arm_compute::PaddingMode::CONSTANT</a></div></div>
<div class="ttc" id="namespacearm__compute_xhtml_a14d24d90ab4ba2956e92e27890ba4c91ae4f6a05f82ed398f984f4bc1a55838df"><div class="ttname"><a href="namespacearm__compute.xhtml#a14d24d90ab4ba2956e92e27890ba4c91ae4f6a05f82ed398f984f4bc1a55838df">arm_compute::PaddingMode::REFLECT</a></div></div>
<div class="ttc" id="namespacearm__compute_1_1test_1_1validation_xhtml_a735a025fce26c1ef147b54426df18181"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation.xhtml#a735a025fce26c1ef147b54426df18181">arm_compute::test::validation::padding</a></div><div class="ttdeci">const PaddingSize padding</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_2_absolute_difference_8cpp_source.xhtml#l00113">AbsoluteDifference.cpp:113</a></div></div>
<div class="ttc" id="classarm__compute_1_1_n_e_copy_kernel_xhtml_a83a344e60eb7db895953a942abf16628"><div class="ttname"><a href="classarm__compute_1_1_n_e_copy_kernel.xhtml#a83a344e60eb7db895953a942abf16628">arm_compute::NECopyKernel::configure</a></div><div class="ttdeci">void configure(const ITensor *input, ITensor *output)</div><div class="ttdoc">Initialize the kernel's input, output.</div><div class="ttdef"><b>Definition:</b> <a href="_n_e_copy_kernel_8cpp_source.xhtml#l00040">NECopyKernel.cpp:40</a></div></div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="_error_8h_source.xhtml#l00261">ARM_COMPUTE_ERROR</a>, <a class="el" href="_error_8h_source.xhtml#l00327">ARM_COMPUTE_ERROR_THROW_ON</a>, <a class="el" href="_helpers_8inl_source.xhtml#l00201">arm_compute::auto_init_if_empty()</a>, <a class="el" href="classarm__compute_1_1misc_1_1_i_cloneable.xhtml#a4d10e5012a872e7f78f2b539b673049d">ICloneable&lt; T &gt;::clone()</a>, <a class="el" href="_shape_calculator_8h_source.xhtml#l01149">arm_compute::misc::shape_calculator::compute_padded_shape()</a>, <a class="el" href="_n_e_copy_kernel_8cpp_source.xhtml#l00040">NECopyKernel::configure()</a>, <a class="el" href="namespacearm__compute.xhtml#a14d24d90ab4ba2956e92e27890ba4c91a8d6b5cada83510220f59e00ce86d4d92">arm_compute::CONSTANT</a>, <a class="el" href="classarm__compute_1_1_i_tensor.xhtml#a0e95dc1e53c361348314873b168ae237">ITensor::info()</a>, <a class="el" href="_c_l_2_absolute_difference_8cpp_source.xhtml#l00113">arm_compute::test::validation::padding</a>, <a class="el" href="namespacearm__compute.xhtml#a14d24d90ab4ba2956e92e27890ba4c91ae4f6a05f82ed398f984f4bc1a55838df">arm_compute::REFLECT</a>, <a class="el" href="namespacearm__compute.xhtml#a14d24d90ab4ba2956e92e27890ba4c91a161b3d9016563aba9ac190fc02ada9bb">arm_compute::SYMMETRIC</a>, <a class="el" href="classarm__compute_1_1_i_tensor_info.xhtml#a7c66505457d00ece3aa4b34cab80757d">ITensorInfo::tensor_shape()</a>, and <a class="el" href="_n_e_pad_layer_8cpp_source.xhtml#l00240">NEPadLayer::validate()</a>.</p>
<p class="reference">Referenced by <a class="el" href="_n_e_f_f_t_convolution_layer_8cpp_source.xhtml#l00097">NEFFTConvolutionLayer::configure()</a>.</p>
</div>
</div>
<a id="ad1717410afd0be936c6213a63c8005fb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad1717410afd0be936c6213a63c8005fb">&#9670;&nbsp;</a></span>run()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void run </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Run the kernels contained in the function. </p>
<p>For NEON kernels:</p><ul>
<li>Multi-threading is used for the kernels which are parallelisable.</li>
<li>By default std::thread::hardware_concurrency() threads are used.</li>
</ul>
<dl class="section note"><dt>Note</dt><dd><a class="el" href="classarm__compute_1_1_c_p_p_scheduler.xhtml#ae64eebaa07f4d2da6cc2ba538c3cb095">CPPScheduler::set_num_threads()</a> can be used to manually set the number of threads</dd></dl>
<p>For OpenCL kernels:</p><ul>
<li>All the kernels are enqueued on the queue associated with <a class="el" href="classarm__compute_1_1_c_l_scheduler.xhtml" title="Provides global access to a CL context and command queue.">CLScheduler</a>.</li>
<li>The queue is then flushed.</li>
</ul>
<dl class="section note"><dt>Note</dt><dd>The function will not block until the kernels are executed. It is the user's responsibility to wait. </dd>
<dd>
Will call <a class="el" href="classarm__compute_1_1_i_function.xhtml#a820f7291c24155a2980512fae45aac26" title="Prepare the function for executing.">prepare()</a> on first run if hasn't been done </dd></dl>
<p>Implements <a class="el" href="classarm__compute_1_1_i_function.xhtml#a18954417d3124a8095783ea13dc6d00b">IFunction</a>.</p>
<p class="definition">Definition at line <a class="el" href="_n_e_pad_layer_8cpp_source.xhtml#l00288">288</a> of file <a class="el" href="_n_e_pad_layer_8cpp_source.xhtml">NEPadLayer.cpp</a>.</p>
<div class="fragment"><div class="line"><a name="l00289"></a><span class="lineno"> 289</span>&#160;{</div><div class="line"><a name="l00290"></a><span class="lineno"> 290</span>&#160; <span class="keywordflow">if</span>(_num_dimensions &gt; 0)</div><div class="line"><a name="l00291"></a><span class="lineno"> 291</span>&#160; {</div><div class="line"><a name="l00292"></a><span class="lineno"> 292</span>&#160; <span class="keywordflow">switch</span>(_mode)</div><div class="line"><a name="l00293"></a><span class="lineno"> 293</span>&#160; {</div><div class="line"><a name="l00294"></a><span class="lineno"> 294</span>&#160; <span class="keywordflow">case</span> <a class="code" href="namespacearm__compute.xhtml#a14d24d90ab4ba2956e92e27890ba4c91a8d6b5cada83510220f59e00ce86d4d92">PaddingMode::CONSTANT</a>:</div><div class="line"><a name="l00295"></a><span class="lineno"> 295</span>&#160; {</div><div class="line"><a name="l00296"></a><span class="lineno"> 296</span>&#160; <a class="code" href="classarm__compute_1_1_scheduler.xhtml#a0d63ca713bab377aabcfb63c192b8429">NEScheduler::get</a>().<a class="code" href="classarm__compute_1_1_i_scheduler.xhtml#a4e58f95544bd5ac6559a421671bd9842">schedule</a>(&amp;_memset_kernel, <a class="code" href="classarm__compute_1_1_window.xhtml#ad2d402364fa822b0b7775081291eeca9">Window::DimY</a>);</div><div class="line"><a name="l00297"></a><span class="lineno"> 297</span>&#160; <a class="code" href="classarm__compute_1_1_scheduler.xhtml#a0d63ca713bab377aabcfb63c192b8429">NEScheduler::get</a>().<a class="code" href="classarm__compute_1_1_i_scheduler.xhtml#a4e58f95544bd5ac6559a421671bd9842">schedule</a>(&amp;_copy_kernel, <a class="code" href="classarm__compute_1_1_window.xhtml#ad2d402364fa822b0b7775081291eeca9">Window::DimY</a>);</div><div class="line"><a name="l00298"></a><span class="lineno"> 298</span>&#160; <span class="keywordflow">break</span>;</div><div class="line"><a name="l00299"></a><span class="lineno"> 299</span>&#160; }</div><div class="line"><a name="l00300"></a><span class="lineno"> 300</span>&#160; <span class="keywordflow">case</span> <a class="code" href="namespacearm__compute.xhtml#a14d24d90ab4ba2956e92e27890ba4c91ae4f6a05f82ed398f984f4bc1a55838df">PaddingMode::REFLECT</a>:</div><div class="line"><a name="l00301"></a><span class="lineno"> 301</span>&#160; <span class="keywordflow">case</span> <a class="code" href="namespacearm__compute.xhtml#a14d24d90ab4ba2956e92e27890ba4c91a161b3d9016563aba9ac190fc02ada9bb">PaddingMode::SYMMETRIC</a>:</div><div class="line"><a name="l00302"></a><span class="lineno"> 302</span>&#160; {</div><div class="line"><a name="l00303"></a><span class="lineno"> 303</span>&#160; <span class="keywordflow">for</span>(uint32_t i = 0; i &lt; _num_dimensions; ++i)</div><div class="line"><a name="l00304"></a><span class="lineno"> 304</span>&#160; {</div><div class="line"><a name="l00305"></a><span class="lineno"> 305</span>&#160; <span class="keywordflow">if</span>(_padding[i].first &gt; 0 || _padding[i].second &gt; 0)</div><div class="line"><a name="l00306"></a><span class="lineno"> 306</span>&#160; {</div><div class="line"><a name="l00307"></a><span class="lineno"> 307</span>&#160; <span class="keywordflow">if</span>(_padding[i].first &gt; 0 &amp;&amp; _slice_results[2 * i].<a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a4f4125dba5283887b34f889b1c615c0c">info</a>()-&gt;total_size() &gt; 0)</div><div class="line"><a name="l00308"></a><span class="lineno"> 308</span>&#160; {</div><div class="line"><a name="l00309"></a><span class="lineno"> 309</span>&#160; _slice_functions[2 * i].run();</div><div class="line"><a name="l00310"></a><span class="lineno"> 310</span>&#160; }</div><div class="line"><a name="l00311"></a><span class="lineno"> 311</span>&#160; <span class="keywordflow">if</span>(_padding[i].second &gt; 0 &amp;&amp; _slice_results[2 * i + 1].<a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a4f4125dba5283887b34f889b1c615c0c">info</a>()-&gt;total_size() &gt; 0)</div><div class="line"><a name="l00312"></a><span class="lineno"> 312</span>&#160; {</div><div class="line"><a name="l00313"></a><span class="lineno"> 313</span>&#160; _slice_functions[2 * i + 1].run();</div><div class="line"><a name="l00314"></a><span class="lineno"> 314</span>&#160; }</div><div class="line"><a name="l00315"></a><span class="lineno"> 315</span>&#160; _concat_functions[i].run();</div><div class="line"><a name="l00316"></a><span class="lineno"> 316</span>&#160; }</div><div class="line"><a name="l00317"></a><span class="lineno"> 317</span>&#160; }</div><div class="line"><a name="l00318"></a><span class="lineno"> 318</span>&#160; <span class="keywordflow">break</span>;</div><div class="line"><a name="l00319"></a><span class="lineno"> 319</span>&#160; }</div><div class="line"><a name="l00320"></a><span class="lineno"> 320</span>&#160; <span class="keywordflow">default</span>:</div><div class="line"><a name="l00321"></a><span class="lineno"> 321</span>&#160; <a class="code" href="_error_8h.xhtml#a05b19c75afe9c24200a62b9724734bbd">ARM_COMPUTE_ERROR</a>(<span class="stringliteral">&quot;Padding mode not supported.&quot;</span>);</div><div class="line"><a name="l00322"></a><span class="lineno"> 322</span>&#160; }</div><div class="line"><a name="l00323"></a><span class="lineno"> 323</span>&#160; }</div><div class="line"><a name="l00324"></a><span class="lineno"> 324</span>&#160; <span class="keywordflow">else</span></div><div class="line"><a name="l00325"></a><span class="lineno"> 325</span>&#160; {</div><div class="line"><a name="l00326"></a><span class="lineno"> 326</span>&#160; <a class="code" href="classarm__compute_1_1_scheduler.xhtml#a0d63ca713bab377aabcfb63c192b8429">NEScheduler::get</a>().<a class="code" href="classarm__compute_1_1_i_scheduler.xhtml#a4e58f95544bd5ac6559a421671bd9842">schedule</a>(&amp;_copy_kernel, <a class="code" href="classarm__compute_1_1_window.xhtml#ad2d402364fa822b0b7775081291eeca9">Window::DimY</a>);</div><div class="line"><a name="l00327"></a><span class="lineno"> 327</span>&#160; }</div><div class="line"><a name="l00328"></a><span class="lineno"> 328</span>&#160;}</div><div class="ttc" id="_error_8h_xhtml_a05b19c75afe9c24200a62b9724734bbd"><div class="ttname"><a href="_error_8h.xhtml#a05b19c75afe9c24200a62b9724734bbd">ARM_COMPUTE_ERROR</a></div><div class="ttdeci">#define ARM_COMPUTE_ERROR(...)</div><div class="ttdoc">Print the given message then throw an std::runtime_error.</div><div class="ttdef"><b>Definition:</b> <a href="_error_8h_source.xhtml#l00261">Error.h:261</a></div></div>
<div class="ttc" id="namespacearm__compute_xhtml_a14d24d90ab4ba2956e92e27890ba4c91a161b3d9016563aba9ac190fc02ada9bb"><div class="ttname"><a href="namespacearm__compute.xhtml#a14d24d90ab4ba2956e92e27890ba4c91a161b3d9016563aba9ac190fc02ada9bb">arm_compute::PaddingMode::SYMMETRIC</a></div></div>
<div class="ttc" id="classarm__compute_1_1_window_xhtml_ad2d402364fa822b0b7775081291eeca9"><div class="ttname"><a href="classarm__compute_1_1_window.xhtml#ad2d402364fa822b0b7775081291eeca9">arm_compute::Window::DimY</a></div><div class="ttdeci">static constexpr size_t DimY</div><div class="ttdoc">Alias for dimension 1 also known as Y dimension.</div><div class="ttdef"><b>Definition:</b> <a href="_window_8h_source.xhtml#l00045">Window.h:45</a></div></div>
<div class="ttc" id="classarm__compute_1_1_i_scheduler_xhtml_a4e58f95544bd5ac6559a421671bd9842"><div class="ttname"><a href="classarm__compute_1_1_i_scheduler.xhtml#a4e58f95544bd5ac6559a421671bd9842">arm_compute::IScheduler::schedule</a></div><div class="ttdeci">virtual void schedule(ICPPKernel *kernel, const Hints &amp;hints)=0</div><div class="ttdoc">Runs the kernel in the same thread as the caller synchronously.</div></div>
<div class="ttc" id="namespacearm__compute_xhtml_a14d24d90ab4ba2956e92e27890ba4c91a8d6b5cada83510220f59e00ce86d4d92"><div class="ttname"><a href="namespacearm__compute.xhtml#a14d24d90ab4ba2956e92e27890ba4c91a8d6b5cada83510220f59e00ce86d4d92">arm_compute::PaddingMode::CONSTANT</a></div></div>
<div class="ttc" id="namespacearm__compute_xhtml_a14d24d90ab4ba2956e92e27890ba4c91ae4f6a05f82ed398f984f4bc1a55838df"><div class="ttname"><a href="namespacearm__compute.xhtml#a14d24d90ab4ba2956e92e27890ba4c91ae4f6a05f82ed398f984f4bc1a55838df">arm_compute::PaddingMode::REFLECT</a></div></div>
<div class="ttc" id="namespacearm__compute_1_1test_1_1validation_xhtml_a4f4125dba5283887b34f889b1c615c0c"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation.xhtml#a4f4125dba5283887b34f889b1c615c0c">arm_compute::test::validation::info</a></div><div class="ttdeci">info</div><div class="ttdef"><b>Definition:</b> <a href="validation_2_c_l_2_convolution_layer_8cpp_source.xhtml#l00174">ConvolutionLayer.cpp:174</a></div></div>
<div class="ttc" id="classarm__compute_1_1_scheduler_xhtml_a0d63ca713bab377aabcfb63c192b8429"><div class="ttname"><a href="classarm__compute_1_1_scheduler.xhtml#a0d63ca713bab377aabcfb63c192b8429">arm_compute::Scheduler::get</a></div><div class="ttdeci">static IScheduler &amp; get()</div><div class="ttdoc">Access the scheduler singleton.</div><div class="ttdef"><b>Definition:</b> <a href="_scheduler_8cpp_source.xhtml#l00096">Scheduler.cpp:96</a></div></div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="_error_8h_source.xhtml#l00261">ARM_COMPUTE_ERROR</a>, <a class="el" href="namespacearm__compute.xhtml#a14d24d90ab4ba2956e92e27890ba4c91a8d6b5cada83510220f59e00ce86d4d92">arm_compute::CONSTANT</a>, <a class="el" href="_window_8h_source.xhtml#l00045">Window::DimY</a>, <a class="el" href="_scheduler_8cpp_source.xhtml#l00096">Scheduler::get()</a>, <a class="el" href="validation_2_c_l_2_convolution_layer_8cpp_source.xhtml#l00174">arm_compute::test::validation::info</a>, <a class="el" href="namespacearm__compute.xhtml#a14d24d90ab4ba2956e92e27890ba4c91ae4f6a05f82ed398f984f4bc1a55838df">arm_compute::REFLECT</a>, <a class="el" href="classarm__compute_1_1_i_scheduler.xhtml#a4e58f95544bd5ac6559a421671bd9842">IScheduler::schedule()</a>, and <a class="el" href="namespacearm__compute.xhtml#a14d24d90ab4ba2956e92e27890ba4c91a161b3d9016563aba9ac190fc02ada9bb">arm_compute::SYMMETRIC</a>.</p>
<p class="reference">Referenced by <a class="el" href="_n_e_f_f_t_convolution_layer_8cpp_source.xhtml#l00337">NEFFTConvolutionLayer::prepare()</a>, and <a class="el" href="_n_e_f_f_t_convolution_layer_8cpp_source.xhtml#l00296">NEFFTConvolutionLayer::run()</a>.</p>
</div>
</div>
<a id="ad225c9d90d11cba16d9b34137cdf965b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad225c9d90d11cba16d9b34137cdf965b">&#9670;&nbsp;</a></span>validate()</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="classarm__compute_1_1_status.xhtml">Status</a> validate </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classarm__compute_1_1_i_tensor_info.xhtml">ITensorInfo</a> *&#160;</td>
<td class="paramname"><em>input</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classarm__compute_1_1_i_tensor_info.xhtml">ITensorInfo</a> *&#160;</td>
<td class="paramname"><em>output</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="namespacearm__compute.xhtml#ac1a1b012674e0f1de071a611391828ad">PaddingList</a> &amp;&#160;</td>
<td class="paramname"><em>padding</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classarm__compute_1_1_pixel_value.xhtml">PixelValue</a>&#160;</td>
<td class="paramname"><em>constant_value</em> = <code><a class="el" href="classarm__compute_1_1_pixel_value.xhtml">PixelValue</a>()</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="namespacearm__compute.xhtml#a14d24d90ab4ba2956e92e27890ba4c91">PaddingMode</a>&#160;</td>
<td class="paramname"><em>mode</em> = <code><a class="el" href="namespacearm__compute.xhtml#a14d24d90ab4ba2956e92e27890ba4c91a8d6b5cada83510220f59e00ce86d4d92">PaddingMode::CONSTANT</a></code>&#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">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Static function to check if given info will lead to a valid configuration of <a class="el" href="classarm__compute_1_1_n_e_pad_layer.xhtml">NEPadLayer</a>. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">input</td><td>Source tensor info. Data types supported: U8/S8/QASYMM8/U16/S16/F16/U32/S32/F32. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">output</td><td>Output tensor info. Data type supported: same as <code>input</code> </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">padding</td><td>The padding for each spatial dimension of the input tensor. The pair padding[i] specifies the front and the end padding in the i-th dimension. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">constant_value</td><td>(Optional) Constant value to be used for the padding </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">mode</td><td>(Optional) Controls whether the padding should be filled with <code>constant_value</code> using CONSTANT, or reflect the input, either including the border values (SYMMETRIC) or not (REFLECT).</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a status </dd></dl>
<p class="definition">Definition at line <a class="el" href="_n_e_pad_layer_8cpp_source.xhtml#l00240">240</a> of file <a class="el" href="_n_e_pad_layer_8cpp_source.xhtml">NEPadLayer.cpp</a>.</p>
<div class="fragment"><div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160;{</div><div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160; <a class="code" href="_error_8h.xhtml#a6dc630a6ae9cc063b3924bcea8dee9d6">ARM_COMPUTE_UNUSED</a>(constant_value);</div><div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160;</div><div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160; <span class="keyword">const</span> TensorShape padded_shape = <a class="code" href="namespacearm__compute_1_1misc_1_1shape__calculator.xhtml#a4e7f3187350db69156c1026860ace4e5">misc::shape_calculator::compute_padded_shape</a>(input-&gt;tensor_shape(), <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a735a025fce26c1ef147b54426df18181">padding</a>);</div><div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160;</div><div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160; <span class="keywordflow">if</span>(output-&gt;total_size() &gt; 0)</div><div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160; {</div><div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160; <a class="code" href="_validate_8h.xhtml#a1da797d2762c1cdbb73bfc83136c3a38">ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DIMENSIONS</a>(output-&gt;tensor_shape(), padded_shape);</div><div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160; <a class="code" href="_validate_8h.xhtml#a8f3ff7da485ff7e75dab07baadf5b4bd">ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES</a>(input, output);</div><div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160; }</div><div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160;</div><div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160; <span class="keywordflow">switch</span>(mode)</div><div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160; {</div><div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160; <span class="keywordflow">case</span> <a class="code" href="namespacearm__compute.xhtml#a14d24d90ab4ba2956e92e27890ba4c91a8d6b5cada83510220f59e00ce86d4d92">PaddingMode::CONSTANT</a>:</div><div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160; {</div><div class="line"><a name="l00256"></a><span class="lineno"> 256</span>&#160; <span class="keyword">auto</span> output_clone = output-&gt;clone();</div><div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160; SubTensorInfo output_subtensor_info(output_clone.get(), input-&gt;tensor_shape(), get_subtensor_coords(<a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a735a025fce26c1ef147b54426df18181">padding</a>), <span class="keyword">true</span>);</div><div class="line"><a name="l00258"></a><span class="lineno"> 258</span>&#160; <a class="code" href="_error_8h.xhtml#a8a1e1c105f0bdaf37db408c7cfcb77a4">ARM_COMPUTE_RETURN_ON_ERROR</a>(validate_arguments(*input, *output_clone, <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a735a025fce26c1ef147b54426df18181">padding</a>));</div><div class="line"><a name="l00259"></a><span class="lineno"> 259</span>&#160; <a class="code" href="_error_8h.xhtml#a8a1e1c105f0bdaf37db408c7cfcb77a4">ARM_COMPUTE_RETURN_ON_ERROR</a>(<a class="code" href="classarm__compute_1_1_n_e_copy_kernel.xhtml#a968b23a6ef327fcfb5b99d58e3fbe883">NECopyKernel::validate</a>(input, &amp;output_subtensor_info));</div><div class="line"><a name="l00260"></a><span class="lineno"> 260</span>&#160; <span class="keywordflow">break</span>;</div><div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160; }</div><div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160; <span class="keywordflow">case</span> <a class="code" href="namespacearm__compute.xhtml#a14d24d90ab4ba2956e92e27890ba4c91ae4f6a05f82ed398f984f4bc1a55838df">PaddingMode::REFLECT</a>:</div><div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160; <span class="keywordflow">case</span> <a class="code" href="namespacearm__compute.xhtml#a14d24d90ab4ba2956e92e27890ba4c91a161b3d9016563aba9ac190fc02ada9bb">PaddingMode::SYMMETRIC</a>:</div><div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160; {</div><div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160; <span class="keywordflow">for</span>(uint32_t i = 0; i &lt; <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a735a025fce26c1ef147b54426df18181">padding</a>.size(); ++i)</div><div class="line"><a name="l00266"></a><span class="lineno"> 266</span>&#160; {</div><div class="line"><a name="l00267"></a><span class="lineno"> 267</span>&#160; <span class="keywordflow">if</span>(mode == <a class="code" href="namespacearm__compute.xhtml#a14d24d90ab4ba2956e92e27890ba4c91ae4f6a05f82ed398f984f4bc1a55838df">PaddingMode::REFLECT</a>)</div><div class="line"><a name="l00268"></a><span class="lineno"> 268</span>&#160; {</div><div class="line"><a name="l00269"></a><span class="lineno"> 269</span>&#160; <a class="code" href="_error_8h.xhtml#a206d6e247e0957ac3dee45d27756fc25">ARM_COMPUTE_RETURN_ERROR_ON</a>(<a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a735a025fce26c1ef147b54426df18181">padding</a>[i].first &gt;= input-&gt;dimension(i));</div><div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160; <a class="code" href="_error_8h.xhtml#a206d6e247e0957ac3dee45d27756fc25">ARM_COMPUTE_RETURN_ERROR_ON</a>(<a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a735a025fce26c1ef147b54426df18181">padding</a>[i].second &gt;= input-&gt;dimension(i));</div><div class="line"><a name="l00271"></a><span class="lineno"> 271</span>&#160; }</div><div class="line"><a name="l00272"></a><span class="lineno"> 272</span>&#160; <span class="keywordflow">else</span></div><div class="line"><a name="l00273"></a><span class="lineno"> 273</span>&#160; {</div><div class="line"><a name="l00274"></a><span class="lineno"> 274</span>&#160; <a class="code" href="_error_8h.xhtml#a206d6e247e0957ac3dee45d27756fc25">ARM_COMPUTE_RETURN_ERROR_ON</a>(<a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a735a025fce26c1ef147b54426df18181">padding</a>[i].first &gt; input-&gt;dimension(i));</div><div class="line"><a name="l00275"></a><span class="lineno"> 275</span>&#160; <a class="code" href="_error_8h.xhtml#a206d6e247e0957ac3dee45d27756fc25">ARM_COMPUTE_RETURN_ERROR_ON</a>(<a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a735a025fce26c1ef147b54426df18181">padding</a>[i].second &gt; input-&gt;dimension(i));</div><div class="line"><a name="l00276"></a><span class="lineno"> 276</span>&#160; }</div><div class="line"><a name="l00277"></a><span class="lineno"> 277</span>&#160; }</div><div class="line"><a name="l00278"></a><span class="lineno"> 278</span>&#160; <span class="keywordflow">break</span>;</div><div class="line"><a name="l00279"></a><span class="lineno"> 279</span>&#160; }</div><div class="line"><a name="l00280"></a><span class="lineno"> 280</span>&#160; <span class="keywordflow">default</span>:</div><div class="line"><a name="l00281"></a><span class="lineno"> 281</span>&#160; {</div><div class="line"><a name="l00282"></a><span class="lineno"> 282</span>&#160; <a class="code" href="_error_8h.xhtml#a05b19c75afe9c24200a62b9724734bbd">ARM_COMPUTE_ERROR</a>(<span class="stringliteral">&quot;Invalid mode&quot;</span>);</div><div class="line"><a name="l00283"></a><span class="lineno"> 283</span>&#160; }</div><div class="line"><a name="l00284"></a><span class="lineno"> 284</span>&#160; }</div><div class="line"><a name="l00285"></a><span class="lineno"> 285</span>&#160; <span class="keywordflow">return</span> Status{};</div><div class="line"><a name="l00286"></a><span class="lineno"> 286</span>&#160;}</div><div class="ttc" id="_error_8h_xhtml_a05b19c75afe9c24200a62b9724734bbd"><div class="ttname"><a href="_error_8h.xhtml#a05b19c75afe9c24200a62b9724734bbd">ARM_COMPUTE_ERROR</a></div><div class="ttdeci">#define ARM_COMPUTE_ERROR(...)</div><div class="ttdoc">Print the given message then throw an std::runtime_error.</div><div class="ttdef"><b>Definition:</b> <a href="_error_8h_source.xhtml#l00261">Error.h:261</a></div></div>
<div class="ttc" id="_validate_8h_xhtml_a8f3ff7da485ff7e75dab07baadf5b4bd"><div class="ttname"><a href="_validate_8h.xhtml#a8f3ff7da485ff7e75dab07baadf5b4bd">ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES</a></div><div class="ttdeci">#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(...)</div><div class="ttdef"><b>Definition:</b> <a href="_validate_8h_source.xhtml#l00545">Validate.h:545</a></div></div>
<div class="ttc" id="_error_8h_xhtml_a8a1e1c105f0bdaf37db408c7cfcb77a4"><div class="ttname"><a href="_error_8h.xhtml#a8a1e1c105f0bdaf37db408c7cfcb77a4">ARM_COMPUTE_RETURN_ON_ERROR</a></div><div class="ttdeci">#define ARM_COMPUTE_RETURN_ON_ERROR(status)</div><div class="ttdoc">Checks if a status contains an error and returns it.</div><div class="ttdef"><b>Definition:</b> <a href="_error_8h_source.xhtml#l00193">Error.h:193</a></div></div>
<div class="ttc" id="_error_8h_xhtml_a206d6e247e0957ac3dee45d27756fc25"><div class="ttname"><a href="_error_8h.xhtml#a206d6e247e0957ac3dee45d27756fc25">ARM_COMPUTE_RETURN_ERROR_ON</a></div><div class="ttdeci">#define ARM_COMPUTE_RETURN_ERROR_ON(cond)</div><div class="ttdoc">If the condition is true, an error is returned.</div><div class="ttdef"><b>Definition:</b> <a href="_error_8h_source.xhtml#l00244">Error.h:244</a></div></div>
<div class="ttc" id="namespacearm__compute_xhtml_a14d24d90ab4ba2956e92e27890ba4c91a161b3d9016563aba9ac190fc02ada9bb"><div class="ttname"><a href="namespacearm__compute.xhtml#a14d24d90ab4ba2956e92e27890ba4c91a161b3d9016563aba9ac190fc02ada9bb">arm_compute::PaddingMode::SYMMETRIC</a></div></div>
<div class="ttc" id="classarm__compute_1_1_n_e_copy_kernel_xhtml_a968b23a6ef327fcfb5b99d58e3fbe883"><div class="ttname"><a href="classarm__compute_1_1_n_e_copy_kernel.xhtml#a968b23a6ef327fcfb5b99d58e3fbe883">arm_compute::NECopyKernel::validate</a></div><div class="ttdeci">static Status validate(const ITensorInfo *input, const ITensorInfo *output)</div><div class="ttdoc">Static function to check if given info will lead to a valid configuration of NECopyKernel.</div><div class="ttdef"><b>Definition:</b> <a href="_n_e_copy_kernel_8cpp_source.xhtml#l00050">NECopyKernel.cpp:50</a></div></div>
<div class="ttc" id="_error_8h_xhtml_a6dc630a6ae9cc063b3924bcea8dee9d6"><div class="ttname"><a href="_error_8h.xhtml#a6dc630a6ae9cc063b3924bcea8dee9d6">ARM_COMPUTE_UNUSED</a></div><div class="ttdeci">#define ARM_COMPUTE_UNUSED(...)</div><div class="ttdoc">To avoid unused variables warnings.</div><div class="ttdef"><b>Definition:</b> <a href="_error_8h_source.xhtml#l00160">Error.h:160</a></div></div>
<div class="ttc" id="_validate_8h_xhtml_a1da797d2762c1cdbb73bfc83136c3a38"><div class="ttname"><a href="_validate_8h.xhtml#a1da797d2762c1cdbb73bfc83136c3a38">ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DIMENSIONS</a></div><div class="ttdeci">#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DIMENSIONS(...)</div><div class="ttdef"><b>Definition:</b> <a href="_validate_8h_source.xhtml#l00288">Validate.h:288</a></div></div>
<div class="ttc" id="namespacearm__compute_1_1misc_1_1shape__calculator_xhtml_a4e7f3187350db69156c1026860ace4e5"><div class="ttname"><a href="namespacearm__compute_1_1misc_1_1shape__calculator.xhtml#a4e7f3187350db69156c1026860ace4e5">arm_compute::misc::shape_calculator::compute_padded_shape</a></div><div class="ttdeci">TensorShape compute_padded_shape(const TensorShape &amp;input_shape, const PaddingList &amp;padding)</div><div class="ttdoc">Calculate the padded shape of a tensor.</div><div class="ttdef"><b>Definition:</b> <a href="_shape_calculator_8h_source.xhtml#l01149">ShapeCalculator.h:1149</a></div></div>
<div class="ttc" id="namespacearm__compute_xhtml_a14d24d90ab4ba2956e92e27890ba4c91a8d6b5cada83510220f59e00ce86d4d92"><div class="ttname"><a href="namespacearm__compute.xhtml#a14d24d90ab4ba2956e92e27890ba4c91a8d6b5cada83510220f59e00ce86d4d92">arm_compute::PaddingMode::CONSTANT</a></div></div>
<div class="ttc" id="namespacearm__compute_xhtml_a14d24d90ab4ba2956e92e27890ba4c91ae4f6a05f82ed398f984f4bc1a55838df"><div class="ttname"><a href="namespacearm__compute.xhtml#a14d24d90ab4ba2956e92e27890ba4c91ae4f6a05f82ed398f984f4bc1a55838df">arm_compute::PaddingMode::REFLECT</a></div></div>
<div class="ttc" id="namespacearm__compute_1_1test_1_1validation_xhtml_a735a025fce26c1ef147b54426df18181"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation.xhtml#a735a025fce26c1ef147b54426df18181">arm_compute::test::validation::padding</a></div><div class="ttdeci">const PaddingSize padding</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_2_absolute_difference_8cpp_source.xhtml#l00113">AbsoluteDifference.cpp:113</a></div></div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="_error_8h_source.xhtml#l00261">ARM_COMPUTE_ERROR</a>, <a class="el" href="_error_8h_source.xhtml#l00244">ARM_COMPUTE_RETURN_ERROR_ON</a>, <a class="el" href="_validate_8h_source.xhtml#l00545">ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES</a>, <a class="el" href="_validate_8h_source.xhtml#l00288">ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DIMENSIONS</a>, <a class="el" href="_error_8h_source.xhtml#l00193">ARM_COMPUTE_RETURN_ON_ERROR</a>, <a class="el" href="_error_8h_source.xhtml#l00160">ARM_COMPUTE_UNUSED</a>, <a class="el" href="classarm__compute_1_1misc_1_1_i_cloneable.xhtml#a4d10e5012a872e7f78f2b539b673049d">ICloneable&lt; T &gt;::clone()</a>, <a class="el" href="_shape_calculator_8h_source.xhtml#l01149">arm_compute::misc::shape_calculator::compute_padded_shape()</a>, <a class="el" href="namespacearm__compute.xhtml#a14d24d90ab4ba2956e92e27890ba4c91a8d6b5cada83510220f59e00ce86d4d92">arm_compute::CONSTANT</a>, <a class="el" href="classarm__compute_1_1_i_tensor_info.xhtml#a178f0d3d87f959e00a743328d95359d2">ITensorInfo::dimension()</a>, <a class="el" href="_c_l_2_absolute_difference_8cpp_source.xhtml#l00113">arm_compute::test::validation::padding</a>, <a class="el" href="namespacearm__compute.xhtml#a14d24d90ab4ba2956e92e27890ba4c91ae4f6a05f82ed398f984f4bc1a55838df">arm_compute::REFLECT</a>, <a class="el" href="namespacearm__compute.xhtml#a14d24d90ab4ba2956e92e27890ba4c91a161b3d9016563aba9ac190fc02ada9bb">arm_compute::SYMMETRIC</a>, <a class="el" href="classarm__compute_1_1_i_tensor_info.xhtml#a7c66505457d00ece3aa4b34cab80757d">ITensorInfo::tensor_shape()</a>, <a class="el" href="classarm__compute_1_1_i_tensor_info.xhtml#a18064e0011c3869d884653e9e7c47b66">ITensorInfo::total_size()</a>, and <a class="el" href="_n_e_copy_kernel_8cpp_source.xhtml#l00050">NECopyKernel::validate()</a>.</p>
<p class="reference">Referenced by <a class="el" href="_n_e_pad_layer_8cpp_source.xhtml#l00201">NEPadLayer::configure()</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>arm_compute/runtime/NEON/functions/<a class="el" href="_n_e_pad_layer_8h_source.xhtml">NEPadLayer.h</a></li>
<li>src/runtime/NEON/functions/<a class="el" href="_n_e_pad_layer_8cpp_source.xhtml">NEPadLayer.cpp</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="namespacearm__compute.xhtml">arm_compute</a></li><li class="navelem"><a class="el" href="classarm__compute_1_1_n_e_pad_layer.xhtml">NEPadLayer</a></li>
<li class="footer">Generated on Mon Sep 2 2019 11:47:37 for Compute Library by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.15 </li>
</ul>
</div>
</body>
</html>