blob: d6c17c10841fc762d3f4ff76b1737b9558f874f7 [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: NEL2NormalizeLayer 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_l2_normalize_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">NEL2NormalizeLayer Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Basic function to perform a L2 normalization on a given axis.
<a href="classarm__compute_1_1_n_e_l2_normalize_layer.xhtml#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="_n_e_l2_normalize_layer_8h_source.xhtml">NEL2NormalizeLayer.h</a>&gt;</code></p>
<div class="dynheader">
Collaboration diagram for NEL2NormalizeLayer:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="classarm__compute_1_1_n_e_l2_normalize_layer__coll__graph.svg" width="166" 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:ad15dc31c9ce02a1afd5762b64a11c1c4"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_n_e_l2_normalize_layer.xhtml#ad15dc31c9ce02a1afd5762b64a11c1c4">NEL2NormalizeLayer</a> (std::shared_ptr&lt; <a class="el" href="classarm__compute_1_1_i_memory_manager.xhtml">IMemoryManager</a> &gt; memory_manager=nullptr)</td></tr>
<tr class="memdesc:ad15dc31c9ce02a1afd5762b64a11c1c4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor. <a href="#ad15dc31c9ce02a1afd5762b64a11c1c4">More...</a><br /></td></tr>
<tr class="separator:ad15dc31c9ce02a1afd5762b64a11c1c4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9cebf91bfc60da0c952bcc7b9af9060c"><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_l2_normalize_layer.xhtml#a9cebf91bfc60da0c952bcc7b9af9060c">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, int axis, float <a class="el" href="_asymm_helpers_8cpp.xhtml#a552dc3787d7ea1675f3e4e8993501d58">epsilon</a>=1e-12f)</td></tr>
<tr class="memdesc:a9cebf91bfc60da0c952bcc7b9af9060c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the input and output tensors. <a href="#a9cebf91bfc60da0c952bcc7b9af9060c">More...</a><br /></td></tr>
<tr class="separator:a9cebf91bfc60da0c952bcc7b9af9060c"><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_l2_normalize_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:af1cacb4a8547f144a7fe6fab677fd672"><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_l2_normalize_layer.xhtml#af1cacb4a8547f144a7fe6fab677fd672">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, int axis, float <a class="el" href="_asymm_helpers_8cpp.xhtml#a552dc3787d7ea1675f3e4e8993501d58">epsilon</a>=1e-12f)</td></tr>
<tr class="memdesc:af1cacb4a8547f144a7fe6fab677fd672"><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_l2_normalize_layer.xhtml">NEL2NormalizeLayer</a>. <a href="#af1cacb4a8547f144a7fe6fab677fd672">More...</a><br /></td></tr>
<tr class="separator:af1cacb4a8547f144a7fe6fab677fd672"><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 perform a L2 normalization on a given axis. </p>
<p>This function runs the following kernels:</p><ol type="1">
<li><a class="el" href="classarm__compute_1_1_n_e_reduction_operation.xhtml">NEReductionOperation</a></li>
<li><a class="el" href="classarm__compute_1_1_n_e_l2_normalize_layer_kernel.xhtml">NEL2NormalizeLayerKernel</a> </li>
</ol>
<p class="definition">Definition at line <a class="el" href="_n_e_l2_normalize_layer_8h_source.xhtml#l00046">46</a> of file <a class="el" href="_n_e_l2_normalize_layer_8h_source.xhtml">NEL2NormalizeLayer.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="ad15dc31c9ce02a1afd5762b64a11c1c4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad15dc31c9ce02a1afd5762b64a11c1c4">&#9670;&nbsp;</a></span>NEL2NormalizeLayer()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classarm__compute_1_1_n_e_l2_normalize_layer.xhtml">NEL2NormalizeLayer</a> </td>
<td>(</td>
<td class="paramtype">std::shared_ptr&lt; <a class="el" href="classarm__compute_1_1_i_memory_manager.xhtml">IMemoryManager</a> &gt;&#160;</td>
<td class="paramname"><em>memory_manager</em> = <code>nullptr</code></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Constructor. </p>
<p class="definition">Definition at line <a class="el" href="_n_e_l2_normalize_layer_8cpp_source.xhtml#l00036">36</a> of file <a class="el" href="_n_e_l2_normalize_layer_8cpp_source.xhtml">NEL2NormalizeLayer.cpp</a>.</p>
<div class="fragment"><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; : _memory_group(std::move(memory_manager)), _reduce_func(), _normalize_kernel(), _sumsq()</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;{</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;}</div></div><!-- fragment -->
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a9cebf91bfc60da0c952bcc7b9af9060c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9cebf91bfc60da0c952bcc7b9af9060c">&#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">int&#160;</td>
<td class="paramname"><em>axis</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>epsilon</em> = <code>1e-12f</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the input and output tensors. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in,out]</td><td class="paramname">input</td><td>Source tensor. Data types supported: F16/F32. (Written to only for border_size != 0) </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">output</td><td>Destination tensor. Data types and data layouts supported: same as <code>input</code>. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">axis</td><td>Axis along which to reduce. Negative values wrap around. Maximum supported actual reduction axis : 2 </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">epsilon</td><td>(Optional) Lower bound value for the normalization. </td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="_n_e_l2_normalize_layer_8cpp_source.xhtml#l00041">41</a> of file <a class="el" href="_n_e_l2_normalize_layer_8cpp_source.xhtml">NEL2NormalizeLayer.cpp</a>.</p>
<div class="fragment"><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;{</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; <span class="comment">// Manage intermediate buffers</span></div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; _memory_group.<a class="code" href="classarm__compute_1_1_memory_group_base.xhtml#ac1f67376afb7822f262a0174ef4a3104">manage</a>(&amp;_sumsq);</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; <span class="comment">// Configure Kernels</span></div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; <span class="keyword">const</span> uint32_t actual_axis = <a class="code" href="namespacearm__compute.xhtml#aeb6881009f40f57d430752441ec5c4f4">wrap_around</a>(<a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#accc088009d44c521706aa98d6387ee21">axis</a>, max_input_tensor_dim);</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; _reduce_func.<a class="code" href="classarm__compute_1_1_n_e_reduction_operation.xhtml#a5a8b455c425ea5b09a3ad7686c619434">configure</a>(input, &amp;_sumsq, actual_axis, <a class="code" href="namespacearm__compute.xhtml#a5827eb9cb394e74af87f74bd354fb45ba2ce6e134b828b72fad160fa17c8d1b64">ReductionOperation::SUM_SQUARE</a>);</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; _normalize_kernel.<a class="code" href="classarm__compute_1_1_n_e_l2_normalize_layer_kernel.xhtml#a147182978b01716921bb69141c438b42">configure</a>(input, &amp;_sumsq, output, <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#accc088009d44c521706aa98d6387ee21">axis</a>, <a class="code" href="_asymm_helpers_8cpp.xhtml#a552dc3787d7ea1675f3e4e8993501d58">epsilon</a>);</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; <span class="comment">// Allocate intermediate tensors</span></div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; _sumsq.<a class="code" href="classarm__compute_1_1_tensor.xhtml#adbd0cf83a8e1b335a9bf405a8e5019fa">allocator</a>()-&gt;<a class="code" href="classarm__compute_1_1_tensor_allocator.xhtml#a6e509c2a177b0b29e9e2369535094dee">allocate</a>();</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;}</div><div class="ttc" id="namespacearm__compute_xhtml_a5827eb9cb394e74af87f74bd354fb45ba2ce6e134b828b72fad160fa17c8d1b64"><div class="ttname"><a href="namespacearm__compute.xhtml#a5827eb9cb394e74af87f74bd354fb45ba2ce6e134b828b72fad160fa17c8d1b64">arm_compute::ReductionOperation::SUM_SQUARE</a></div><div class="ttdoc">Sum of squares.</div></div>
<div class="ttc" id="_asymm_helpers_8cpp_xhtml_a552dc3787d7ea1675f3e4e8993501d58"><div class="ttname"><a href="_asymm_helpers_8cpp.xhtml#a552dc3787d7ea1675f3e4e8993501d58">epsilon</a></div><div class="ttdeci">constexpr float epsilon</div><div class="ttdef"><b>Definition:</b> <a href="_asymm_helpers_8cpp_source.xhtml#l00033">AsymmHelpers.cpp:33</a></div></div>
<div class="ttc" id="classarm__compute_1_1_tensor_xhtml_adbd0cf83a8e1b335a9bf405a8e5019fa"><div class="ttname"><a href="classarm__compute_1_1_tensor.xhtml#adbd0cf83a8e1b335a9bf405a8e5019fa">arm_compute::Tensor::allocator</a></div><div class="ttdeci">TensorAllocator * allocator()</div><div class="ttdoc">Return a pointer to the tensor's allocator.</div><div class="ttdef"><b>Definition:</b> <a href="runtime_2_tensor_8cpp_source.xhtml#l00048">Tensor.cpp:48</a></div></div>
<div class="ttc" id="namespacearm__compute_xhtml_aeb6881009f40f57d430752441ec5c4f4"><div class="ttname"><a href="namespacearm__compute.xhtml#aeb6881009f40f57d430752441ec5c4f4">arm_compute::wrap_around</a></div><div class="ttdeci">T wrap_around(T x, T m)</div><div class="ttdoc">Wrap-around a number within the range 0 &lt;= x &lt; m.</div><div class="ttdef"><b>Definition:</b> <a href="arm__compute_2core_2_helpers_8h_source.xhtml#l00764">Helpers.h:764</a></div></div>
<div class="ttc" id="classarm__compute_1_1_memory_group_base_xhtml_ac1f67376afb7822f262a0174ef4a3104"><div class="ttname"><a href="classarm__compute_1_1_memory_group_base.xhtml#ac1f67376afb7822f262a0174ef4a3104">arm_compute::MemoryGroupBase::manage</a></div><div class="ttdeci">void manage(TensorType *obj)</div><div class="ttdoc">Sets a object to be managed by the given memory group.</div><div class="ttdef"><b>Definition:</b> <a href="_memory_group_base_8h_source.xhtml#l00102">MemoryGroupBase.h:102</a></div></div>
<div class="ttc" id="classarm__compute_1_1_tensor_allocator_xhtml_a6e509c2a177b0b29e9e2369535094dee"><div class="ttname"><a href="classarm__compute_1_1_tensor_allocator.xhtml#a6e509c2a177b0b29e9e2369535094dee">arm_compute::TensorAllocator::allocate</a></div><div class="ttdeci">void allocate() override</div><div class="ttdoc">Allocate size specified by TensorInfo of CPU memory.</div><div class="ttdef"><b>Definition:</b> <a href="src_2runtime_2_tensor_allocator_8cpp_source.xhtml#l00133">TensorAllocator.cpp:133</a></div></div>
<div class="ttc" id="namespacearm__compute_1_1test_1_1validation_xhtml_accc088009d44c521706aa98d6387ee21"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation.xhtml#accc088009d44c521706aa98d6387ee21">arm_compute::test::validation::axis</a></div><div class="ttdeci">axis</div><div class="ttdef"><b>Definition:</b> <a href="_n_e_o_n_2_stack_layer_8cpp_source.xhtml#l00226">StackLayer.cpp:226</a></div></div>
<div class="ttc" id="classarm__compute_1_1_n_e_reduction_operation_xhtml_a5a8b455c425ea5b09a3ad7686c619434"><div class="ttname"><a href="classarm__compute_1_1_n_e_reduction_operation.xhtml#a5a8b455c425ea5b09a3ad7686c619434">arm_compute::NEReductionOperation::configure</a></div><div class="ttdeci">void configure(ITensor *input, ITensor *output, unsigned int axis, ReductionOperation op)</div><div class="ttdoc">Set the input and output tensors.</div><div class="ttdef"><b>Definition:</b> <a href="_n_e_reduction_operation_8cpp_source.xhtml#l00067">NEReductionOperation.cpp:67</a></div></div>
<div class="ttc" id="classarm__compute_1_1_n_e_l2_normalize_layer_kernel_xhtml_a147182978b01716921bb69141c438b42"><div class="ttname"><a href="classarm__compute_1_1_n_e_l2_normalize_layer_kernel.xhtml#a147182978b01716921bb69141c438b42">arm_compute::NEL2NormalizeLayerKernel::configure</a></div><div class="ttdeci">void configure(const ITensor *input, const ITensor *sum, ITensor *output, int axis, float epsilon)</div><div class="ttdoc">Set the input and output tensors.</div></div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="src_2runtime_2_tensor_allocator_8cpp_source.xhtml#l00133">TensorAllocator::allocate()</a>, <a class="el" href="runtime_2_tensor_8cpp_source.xhtml#l00048">Tensor::allocator()</a>, <a class="el" href="_n_e_o_n_2_stack_layer_8cpp_source.xhtml#l00226">arm_compute::test::validation::axis</a>, <a class="el" href="_n_e_reduction_operation_8cpp_source.xhtml#l00067">NEReductionOperation::configure()</a>, <a class="el" href="classarm__compute_1_1_n_e_l2_normalize_layer_kernel.xhtml#a147182978b01716921bb69141c438b42">NEL2NormalizeLayerKernel::configure()</a>, <a class="el" href="_asymm_helpers_8cpp_source.xhtml#l00033">epsilon</a>, <a class="el" href="_memory_group_base_8h_source.xhtml#l00102">MemoryGroupBase&lt; TensorType &gt;::manage()</a>, <a class="el" href="namespacearm__compute.xhtml#a5827eb9cb394e74af87f74bd354fb45ba2ce6e134b828b72fad160fa17c8d1b64">arm_compute::SUM_SQUARE</a>, and <a class="el" href="arm__compute_2core_2_helpers_8h_source.xhtml#l00764">arm_compute::wrap_around()</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_l2_normalize_layer_8cpp_source.xhtml#l00076">76</a> of file <a class="el" href="_n_e_l2_normalize_layer_8cpp_source.xhtml">NEL2NormalizeLayer.cpp</a>.</p>
<div class="fragment"><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160;{</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; MemoryGroupResourceScope scope_mg(_memory_group);</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; _reduce_func.<a class="code" href="classarm__compute_1_1_n_e_reduction_operation.xhtml#ad1717410afd0be936c6213a63c8005fb">run</a>();</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</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;_normalize_kernel, <a class="code" href="classarm__compute_1_1_window.xhtml#ad2d402364fa822b0b7775081291eeca9">Window::DimY</a>);</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160;}</div><div class="ttc" id="classarm__compute_1_1_n_e_reduction_operation_xhtml_ad1717410afd0be936c6213a63c8005fb"><div class="ttname"><a href="classarm__compute_1_1_n_e_reduction_operation.xhtml#ad1717410afd0be936c6213a63c8005fb">arm_compute::NEReductionOperation::run</a></div><div class="ttdeci">void run() override</div><div class="ttdoc">Run the kernels contained in the function.</div><div class="ttdef"><b>Definition:</b> <a href="_n_e_reduction_operation_8cpp_source.xhtml#l00157">NEReductionOperation.cpp:157</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="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="_window_8h_source.xhtml#l00045">Window::DimY</a>, <a class="el" href="_scheduler_8cpp_source.xhtml#l00096">Scheduler::get()</a>, <a class="el" href="_n_e_reduction_operation_8cpp_source.xhtml#l00157">NEReductionOperation::run()</a>, and <a class="el" href="classarm__compute_1_1_i_scheduler.xhtml#a4e58f95544bd5ac6559a421671bd9842">IScheduler::schedule()</a>.</p>
</div>
</div>
<a id="af1cacb4a8547f144a7fe6fab677fd672"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af1cacb4a8547f144a7fe6fab677fd672">&#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">int&#160;</td>
<td class="paramname"><em>axis</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>epsilon</em> = <code>1e-12f</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_l2_normalize_layer.xhtml">NEL2NormalizeLayer</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: F16/F32. (Written to only for border_size != 0) </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">output</td><td>Destination tensor info. Data types and data layouts supported: same as <code>input</code>. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">axis</td><td>Axis along which to reduce. Negative values wrap around. Maximum supported actual reduction axis : 2 </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">epsilon</td><td>(Optional) Lower bound value for the normalization.</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_l2_normalize_layer_8cpp_source.xhtml#l00055">55</a> of file <a class="el" href="_n_e_l2_normalize_layer_8cpp_source.xhtml">NEL2NormalizeLayer.cpp</a>.</p>
<div class="fragment"><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;{</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; TensorShape <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a45cde9abb508c62d67c3bb2b9bf566a5">shape</a>(input-&gt;tensor_shape());</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; <span class="comment">// Create intermediate tensor info</span></div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; TensorInfo sum_sq;</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; sum_sq.set_data_type(input-&gt;data_type());</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; sum_sq.set_tensor_shape(<a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a45cde9abb508c62d67c3bb2b9bf566a5">shape</a>);</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; <span class="keyword">const</span> uint32_t actual_axis = <a class="code" href="namespacearm__compute.xhtml#aeb6881009f40f57d430752441ec5c4f4">wrap_around</a>(<a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#accc088009d44c521706aa98d6387ee21">axis</a>, max_input_tensor_dim);</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</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_reduction_operation.xhtml#a358b25909dda0c7c6f49d40f91cd1112">NEReductionOperation::validate</a>(input, &amp;sum_sq, actual_axis, <a class="code" href="namespacearm__compute.xhtml#a5827eb9cb394e74af87f74bd354fb45ba2ce6e134b828b72fad160fa17c8d1b64">ReductionOperation::SUM_SQUARE</a>));</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160;</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; <span class="comment">// Reduce shape on axis</span></div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a45cde9abb508c62d67c3bb2b9bf566a5">shape</a>.set(actual_axis, 1);</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; sum_sq.set_tensor_shape(<a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a45cde9abb508c62d67c3bb2b9bf566a5">shape</a>);</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</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_l2_normalize_layer_kernel.xhtml#a5ccf783ebc64984ef6da6e5a8ccf27e7">NEL2NormalizeLayerKernel::validate</a>(input, &amp;sum_sq, output, <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#accc088009d44c521706aa98d6387ee21">axis</a>, <a class="code" href="_asymm_helpers_8cpp.xhtml#a552dc3787d7ea1675f3e4e8993501d58">epsilon</a>));</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160;</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; <span class="keywordflow">return</span> Status{};</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;}</div><div class="ttc" id="namespacearm__compute_1_1test_1_1validation_xhtml_a45cde9abb508c62d67c3bb2b9bf566a5"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation.xhtml#a45cde9abb508c62d67c3bb2b9bf566a5">arm_compute::test::validation::shape</a></div><div class="ttdeci">shape</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_2_absolute_difference_8cpp_source.xhtml#l00097">AbsoluteDifference.cpp:97</a></div></div>
<div class="ttc" id="namespacearm__compute_xhtml_a5827eb9cb394e74af87f74bd354fb45ba2ce6e134b828b72fad160fa17c8d1b64"><div class="ttname"><a href="namespacearm__compute.xhtml#a5827eb9cb394e74af87f74bd354fb45ba2ce6e134b828b72fad160fa17c8d1b64">arm_compute::ReductionOperation::SUM_SQUARE</a></div><div class="ttdoc">Sum of squares.</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="_asymm_helpers_8cpp_xhtml_a552dc3787d7ea1675f3e4e8993501d58"><div class="ttname"><a href="_asymm_helpers_8cpp.xhtml#a552dc3787d7ea1675f3e4e8993501d58">epsilon</a></div><div class="ttdeci">constexpr float epsilon</div><div class="ttdef"><b>Definition:</b> <a href="_asymm_helpers_8cpp_source.xhtml#l00033">AsymmHelpers.cpp:33</a></div></div>
<div class="ttc" id="namespacearm__compute_xhtml_aeb6881009f40f57d430752441ec5c4f4"><div class="ttname"><a href="namespacearm__compute.xhtml#aeb6881009f40f57d430752441ec5c4f4">arm_compute::wrap_around</a></div><div class="ttdeci">T wrap_around(T x, T m)</div><div class="ttdoc">Wrap-around a number within the range 0 &lt;= x &lt; m.</div><div class="ttdef"><b>Definition:</b> <a href="arm__compute_2core_2_helpers_8h_source.xhtml#l00764">Helpers.h:764</a></div></div>
<div class="ttc" id="classarm__compute_1_1_n_e_l2_normalize_layer_kernel_xhtml_a5ccf783ebc64984ef6da6e5a8ccf27e7"><div class="ttname"><a href="classarm__compute_1_1_n_e_l2_normalize_layer_kernel.xhtml#a5ccf783ebc64984ef6da6e5a8ccf27e7">arm_compute::NEL2NormalizeLayerKernel::validate</a></div><div class="ttdeci">static Status validate(const ITensorInfo *input, const ITensorInfo *sum, const ITensorInfo *output, int axis, float epsilon)</div><div class="ttdoc">Static function to check if given info will lead to a valid configuration of NEL2NormalizeLayerKernel...</div></div>
<div class="ttc" id="namespacearm__compute_1_1test_1_1validation_xhtml_accc088009d44c521706aa98d6387ee21"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation.xhtml#accc088009d44c521706aa98d6387ee21">arm_compute::test::validation::axis</a></div><div class="ttdeci">axis</div><div class="ttdef"><b>Definition:</b> <a href="_n_e_o_n_2_stack_layer_8cpp_source.xhtml#l00226">StackLayer.cpp:226</a></div></div>
<div class="ttc" id="classarm__compute_1_1_n_e_reduction_operation_xhtml_a358b25909dda0c7c6f49d40f91cd1112"><div class="ttname"><a href="classarm__compute_1_1_n_e_reduction_operation.xhtml#a358b25909dda0c7c6f49d40f91cd1112">arm_compute::NEReductionOperation::validate</a></div><div class="ttdeci">static Status validate(const ITensorInfo *input, const ITensorInfo *output, unsigned int axis, ReductionOperation op)</div><div class="ttdoc">Static function to check if given info will lead to a valid configuration of NEReductionOperation.</div><div class="ttdef"><b>Definition:</b> <a href="_n_e_reduction_operation_8cpp_source.xhtml#l00060">NEReductionOperation.cpp:60</a></div></div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="_error_8h_source.xhtml#l00193">ARM_COMPUTE_RETURN_ON_ERROR</a>, <a class="el" href="_n_e_o_n_2_stack_layer_8cpp_source.xhtml#l00226">arm_compute::test::validation::axis</a>, <a class="el" href="classarm__compute_1_1_i_tensor_info.xhtml#a7cfb31af63202568efef5214acfbf3ba">ITensorInfo::data_type()</a>, <a class="el" href="_asymm_helpers_8cpp_source.xhtml#l00033">epsilon</a>, <a class="el" href="src_2core_2_tensor_info_8cpp_source.xhtml#l00311">TensorInfo::set_data_type()</a>, <a class="el" href="classarm__compute_1_1_i_tensor_info.xhtml#a12a4f1190952613e36b44846962e26bb">ITensorInfo::set_tensor_shape()</a>, <a class="el" href="_c_l_2_absolute_difference_8cpp_source.xhtml#l00097">arm_compute::test::validation::shape</a>, <a class="el" href="namespacearm__compute.xhtml#a5827eb9cb394e74af87f74bd354fb45ba2ce6e134b828b72fad160fa17c8d1b64">arm_compute::SUM_SQUARE</a>, <a class="el" href="classarm__compute_1_1_i_tensor_info.xhtml#a7c66505457d00ece3aa4b34cab80757d">ITensorInfo::tensor_shape()</a>, <a class="el" href="_n_e_reduction_operation_8cpp_source.xhtml#l00060">NEReductionOperation::validate()</a>, <a class="el" href="classarm__compute_1_1_n_e_l2_normalize_layer_kernel.xhtml#a5ccf783ebc64984ef6da6e5a8ccf27e7">NEL2NormalizeLayerKernel::validate()</a>, and <a class="el" href="arm__compute_2core_2_helpers_8h_source.xhtml#l00764">arm_compute::wrap_around()</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_l2_normalize_layer_8h_source.xhtml">NEL2NormalizeLayer.h</a></li>
<li>src/runtime/NEON/functions/<a class="el" href="_n_e_l2_normalize_layer_8cpp_source.xhtml">NEL2NormalizeLayer.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_l2_normalize_layer.xhtml">NEL2NormalizeLayer</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>