1 <!-- HTML header for doxygen 1.8.9.1-->
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
5 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
6 <meta http-equiv="X-UA-Compatible" content="IE=9"/>
7 <meta name="generator" content="Doxygen 1.8.11"/>
8 <meta name="robots" content="NOINDEX, NOFOLLOW" /> <!-- Prevent indexing by search engines -->
9 <title>Compute Library: TensorShape Class Reference</title>
10 <link href="tabs.css" rel="stylesheet" type="text/css"/>
11 <script type="text/javascript" src="jquery.js"></script>
12 <script type="text/javascript" src="dynsections.js"></script>
13 <link href="navtree.css" rel="stylesheet" type="text/css"/>
14 <script type="text/javascript" src="resize.js"></script>
15 <script type="text/javascript" src="navtreedata.js"></script>
16 <script type="text/javascript" src="navtree.js"></script>
17 <script type="text/javascript">
18 $(document).ready(initResizable);
19 $(window).load(resizeHeight);
21 <link href="search/search.css" rel="stylesheet" type="text/css"/>
22 <script type="text/javascript" src="search/searchdata.js"></script>
23 <script type="text/javascript" src="search/search.js"></script>
24 <script type="text/javascript">
25 $(document).ready(function() { init_search(); });
27 <script type="text/x-mathjax-config">
29 extensions: ["tex2jax.js"],
30 jax: ["input/TeX","output/HTML-CSS"],
32 </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
33 <link href="doxygen.css" rel="stylesheet" type="text/css" />
36 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
38 <table cellspacing="0" cellpadding="0">
40 <tr style="height: 56px;">
41 <td style="padding-left: 0.5em;">
42 <div id="projectname">Compute Library
43  <span id="projectnumber">18.05</span>
50 <!-- end header part -->
51 <!-- Generated by Doxygen 1.8.11 -->
52 <script type="text/javascript">
53 var searchBox = new SearchBox("searchBox", "search",false,'Search');
55 <div id="navrow1" class="tabs">
57 <li><a href="index.xhtml"><span>Main Page</span></a></li>
58 <li><a href="pages.xhtml"><span>Related Pages</span></a></li>
59 <li><a href="namespaces.xhtml"><span>Namespaces</span></a></li>
60 <li class="current"><a href="annotated.xhtml"><span>Data Structures</span></a></li>
61 <li><a href="files.xhtml"><span>Files</span></a></li>
63 <div id="MSearchBox" class="MSearchBoxInactive">
65 <img id="MSearchSelect" src="search/mag_sel.png"
66 onmouseover="return searchBox.OnSearchSelectShow()"
67 onmouseout="return searchBox.OnSearchSelectHide()"
69 <input type="text" id="MSearchField" value="Search" accesskey="S"
70 onfocus="searchBox.OnSearchFieldFocus(true)"
71 onblur="searchBox.OnSearchFieldFocus(false)"
72 onkeyup="searchBox.OnSearchFieldChange(event)"/>
73 </span><span class="right">
74 <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
80 <div id="navrow2" class="tabs2">
82 <li><a href="annotated.xhtml"><span>Data Structures</span></a></li>
83 <li><a href="classes.xhtml"><span>Data Structure Index</span></a></li>
84 <li><a href="inherits.xhtml"><span>Class Hierarchy</span></a></li>
85 <li><a href="functions.xhtml"><span>Data Fields</span></a></li>
89 <div id="side-nav" class="ui-resizable side-nav-resizable">
91 <div id="nav-tree-contents">
92 <div id="nav-sync" class="sync"></div>
95 <div id="splitbar" style="-moz-user-select:none;"
96 class="ui-resizable-handle">
99 <script type="text/javascript">
100 $(document).ready(function(){initNavTree('classarm__compute_1_1_tensor_shape.xhtml','');});
102 <div id="doc-content">
103 <!-- window showing the filter options -->
104 <div id="MSearchSelectWindow"
105 onmouseover="return searchBox.OnSearchSelectShow()"
106 onmouseout="return searchBox.OnSearchSelectHide()"
107 onkeydown="return searchBox.OnSearchSelectKey(event)">
110 <!-- iframe showing the search results (closed by default) -->
111 <div id="MSearchResultsWindow">
112 <iframe src="javascript:void(0)" frameborder="0"
113 name="MSearchResults" id="MSearchResults">
118 <div class="summary">
119 <a href="#pub-methods">Public Member Functions</a> |
120 <a href="#pub-static-methods">Static Public Member Functions</a> </div>
121 <div class="headertitle">
122 <div class="title">TensorShape Class Reference</div> </div>
124 <div class="contents">
126 <p>Shape of a tensor.
127 <a href="classarm__compute_1_1_tensor_shape.xhtml#details">More...</a></p>
129 <p><code>#include <<a class="el" href="_tensor_shape_8h_source.xhtml">TensorShape.h</a>></code></p>
130 <div class="dynheader">
131 Collaboration diagram for TensorShape:</div>
132 <div class="dyncontent">
133 <div class="center"><iframe scrolling="no" frameborder="0" src="classarm__compute_1_1_tensor_shape__coll__graph.svg" width="175" height="203"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
135 <center><span class="legend">[<a target="top" href="graph_legend.xhtml">legend</a>]</span></center></div>
136 <table class="memberdecls">
137 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
138 Public Member Functions</h2></td></tr>
139 <tr class="memitem:a929d0b5223357298ada0ce4d42fa5ec7"><td class="memTemplParams" colspan="2">template<typename... Ts> </td></tr>
140 <tr class="memitem:a929d0b5223357298ada0ce4d42fa5ec7"><td class="memTemplItemLeft" align="right" valign="top"> </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_tensor_shape.xhtml#a929d0b5223357298ada0ce4d42fa5ec7">TensorShape</a> (Ts...dims)</td></tr>
141 <tr class="memdesc:a929d0b5223357298ada0ce4d42fa5ec7"><td class="mdescLeft"> </td><td class="mdescRight">Constructor to initialize the tensor shape. <a href="#a929d0b5223357298ada0ce4d42fa5ec7">More...</a><br /></td></tr>
142 <tr class="separator:a929d0b5223357298ada0ce4d42fa5ec7"><td class="memSeparator" colspan="2"> </td></tr>
143 <tr class="memitem:af156b289692f8c3f64688e9a2932ae78"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_tensor_shape.xhtml#af156b289692f8c3f64688e9a2932ae78">TensorShape</a> (const <a class="el" href="classarm__compute_1_1_tensor_shape.xhtml">TensorShape</a> &)=default</td></tr>
144 <tr class="memdesc:af156b289692f8c3f64688e9a2932ae78"><td class="mdescLeft"> </td><td class="mdescRight">Allow instances of this class to be copy constructed. <a href="#af156b289692f8c3f64688e9a2932ae78">More...</a><br /></td></tr>
145 <tr class="separator:af156b289692f8c3f64688e9a2932ae78"><td class="memSeparator" colspan="2"> </td></tr>
146 <tr class="memitem:a355b1a84ab7af3b8ef9a6bea1939450a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classarm__compute_1_1_tensor_shape.xhtml">TensorShape</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_tensor_shape.xhtml#a355b1a84ab7af3b8ef9a6bea1939450a">operator=</a> (const <a class="el" href="classarm__compute_1_1_tensor_shape.xhtml">TensorShape</a> &)=default</td></tr>
147 <tr class="memdesc:a355b1a84ab7af3b8ef9a6bea1939450a"><td class="mdescLeft"> </td><td class="mdescRight">Allow instances of this class to be copied. <a href="#a355b1a84ab7af3b8ef9a6bea1939450a">More...</a><br /></td></tr>
148 <tr class="separator:a355b1a84ab7af3b8ef9a6bea1939450a"><td class="memSeparator" colspan="2"> </td></tr>
149 <tr class="memitem:a5fa5abfb10a67d23a75339646e84517a"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_tensor_shape.xhtml#a5fa5abfb10a67d23a75339646e84517a">TensorShape</a> (<a class="el" href="classarm__compute_1_1_tensor_shape.xhtml">TensorShape</a> &&)=default</td></tr>
150 <tr class="memdesc:a5fa5abfb10a67d23a75339646e84517a"><td class="mdescLeft"> </td><td class="mdescRight">Allow instances of this class to be move constructed. <a href="#a5fa5abfb10a67d23a75339646e84517a">More...</a><br /></td></tr>
151 <tr class="separator:a5fa5abfb10a67d23a75339646e84517a"><td class="memSeparator" colspan="2"> </td></tr>
152 <tr class="memitem:afbfae7c97606fb71d556a9f4e46dda00"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classarm__compute_1_1_tensor_shape.xhtml">TensorShape</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_tensor_shape.xhtml#afbfae7c97606fb71d556a9f4e46dda00">operator=</a> (<a class="el" href="classarm__compute_1_1_tensor_shape.xhtml">TensorShape</a> &&)=default</td></tr>
153 <tr class="memdesc:afbfae7c97606fb71d556a9f4e46dda00"><td class="mdescLeft"> </td><td class="mdescRight">Allow instances of this class to be moved. <a href="#afbfae7c97606fb71d556a9f4e46dda00">More...</a><br /></td></tr>
154 <tr class="separator:afbfae7c97606fb71d556a9f4e46dda00"><td class="memSeparator" colspan="2"> </td></tr>
155 <tr class="memitem:a29ff524f0e3378fb25a8447bdeed6ba9"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_tensor_shape.xhtml#a29ff524f0e3378fb25a8447bdeed6ba9">~TensorShape</a> ()=default</td></tr>
156 <tr class="memdesc:a29ff524f0e3378fb25a8447bdeed6ba9"><td class="mdescLeft"> </td><td class="mdescRight">Default destructor. <a href="#a29ff524f0e3378fb25a8447bdeed6ba9">More...</a><br /></td></tr>
157 <tr class="separator:a29ff524f0e3378fb25a8447bdeed6ba9"><td class="memSeparator" colspan="2"> </td></tr>
158 <tr class="memitem:a9c54fb6cea3557692fe7c00c40bb40ad"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classarm__compute_1_1_tensor_shape.xhtml">TensorShape</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_tensor_shape.xhtml#a9c54fb6cea3557692fe7c00c40bb40ad">set</a> (size_t dimension, size_t value, bool apply_dim_correction=true)</td></tr>
159 <tr class="memdesc:a9c54fb6cea3557692fe7c00c40bb40ad"><td class="mdescLeft"> </td><td class="mdescRight">Accessor to set the value of one of the dimensions. <a href="#a9c54fb6cea3557692fe7c00c40bb40ad">More...</a><br /></td></tr>
160 <tr class="separator:a9c54fb6cea3557692fe7c00c40bb40ad"><td class="memSeparator" colspan="2"> </td></tr>
161 <tr class="memitem:acb74edf42335de0dca0da5158b704c4b"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_tensor_shape.xhtml#acb74edf42335de0dca0da5158b704c4b">remove_dimension</a> (size_t n)</td></tr>
162 <tr class="memdesc:acb74edf42335de0dca0da5158b704c4b"><td class="mdescLeft"> </td><td class="mdescRight">Accessor to remove the dimension n from the tensor shape. <a href="#acb74edf42335de0dca0da5158b704c4b">More...</a><br /></td></tr>
163 <tr class="separator:acb74edf42335de0dca0da5158b704c4b"><td class="memSeparator" colspan="2"> </td></tr>
164 <tr class="memitem:a8e15e87871211f98c2b566137e38ef99"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_tensor_shape.xhtml#a8e15e87871211f98c2b566137e38ef99">collapse</a> (size_t n, size_t first=0)</td></tr>
165 <tr class="memdesc:a8e15e87871211f98c2b566137e38ef99"><td class="mdescLeft"> </td><td class="mdescRight">Collapse the first n dimensions. <a href="#a8e15e87871211f98c2b566137e38ef99">More...</a><br /></td></tr>
166 <tr class="separator:a8e15e87871211f98c2b566137e38ef99"><td class="memSeparator" colspan="2"> </td></tr>
167 <tr class="memitem:a3b572f2fcba6fcf8b944a9161b2d365f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classarm__compute_1_1_tensor_shape.xhtml">TensorShape</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_tensor_shape.xhtml#a3b572f2fcba6fcf8b944a9161b2d365f">collapsed_from</a> (size_t start) const </td></tr>
168 <tr class="memdesc:a3b572f2fcba6fcf8b944a9161b2d365f"><td class="mdescLeft"> </td><td class="mdescRight">Return a copy with collapsed dimensions starting from a given point. <a href="#a3b572f2fcba6fcf8b944a9161b2d365f">More...</a><br /></td></tr>
169 <tr class="separator:a3b572f2fcba6fcf8b944a9161b2d365f"><td class="memSeparator" colspan="2"> </td></tr>
170 <tr class="memitem:a4eaec01ba2c12093db609d1034ad0bc1"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_tensor_shape.xhtml#a4eaec01ba2c12093db609d1034ad0bc1">total_size</a> () const </td></tr>
171 <tr class="memdesc:a4eaec01ba2c12093db609d1034ad0bc1"><td class="mdescLeft"> </td><td class="mdescRight">Collapses all dimensions to a single linear total size. <a href="#a4eaec01ba2c12093db609d1034ad0bc1">More...</a><br /></td></tr>
172 <tr class="separator:a4eaec01ba2c12093db609d1034ad0bc1"><td class="memSeparator" colspan="2"> </td></tr>
173 <tr class="memitem:a91d8061f66e7f8bc56da91d965f04376"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_tensor_shape.xhtml#a91d8061f66e7f8bc56da91d965f04376">total_size_upper</a> (size_t dimension) const </td></tr>
174 <tr class="memdesc:a91d8061f66e7f8bc56da91d965f04376"><td class="mdescLeft"> </td><td class="mdescRight">Collapses given dimension and above. <a href="#a91d8061f66e7f8bc56da91d965f04376">More...</a><br /></td></tr>
175 <tr class="separator:a91d8061f66e7f8bc56da91d965f04376"><td class="memSeparator" colspan="2"> </td></tr>
176 <tr class="memitem:a1a82725c69bdbd17294caa129743984c"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_tensor_shape.xhtml#a1a82725c69bdbd17294caa129743984c">total_size_lower</a> (size_t dimension) const </td></tr>
177 <tr class="memdesc:a1a82725c69bdbd17294caa129743984c"><td class="mdescLeft"> </td><td class="mdescRight">Compute size of dimensions lower than the given one. <a href="#a1a82725c69bdbd17294caa129743984c">More...</a><br /></td></tr>
178 <tr class="separator:a1a82725c69bdbd17294caa129743984c"><td class="memSeparator" colspan="2"> </td></tr>
179 <tr class="inherit_header pub_methods_classarm__compute_1_1_dimensions"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classarm__compute_1_1_dimensions')"><img src="closed.png" alt="-"/> Public Member Functions inherited from <a class="el" href="classarm__compute_1_1_dimensions.xhtml">Dimensions< size_t ></a></td></tr>
180 <tr class="memitem:aa521fcebc508ef8447da413cc64d020a inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_dimensions.xhtml#aa521fcebc508ef8447da413cc64d020a">Dimensions</a> (Ts...dims)</td></tr>
181 <tr class="memdesc:aa521fcebc508ef8447da413cc64d020a inherit pub_methods_classarm__compute_1_1_dimensions"><td class="mdescLeft"> </td><td class="mdescRight">Constructor to initialize the tensor shape. <a href="#aa521fcebc508ef8447da413cc64d020a">More...</a><br /></td></tr>
182 <tr class="separator:aa521fcebc508ef8447da413cc64d020a inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memSeparator" colspan="2"> </td></tr>
183 <tr class="memitem:a0d3c59537291735849c740364496a41c inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_dimensions.xhtml#a0d3c59537291735849c740364496a41c">Dimensions</a> (const <a class="el" href="classarm__compute_1_1_dimensions.xhtml">Dimensions</a> &)=default</td></tr>
184 <tr class="memdesc:a0d3c59537291735849c740364496a41c inherit pub_methods_classarm__compute_1_1_dimensions"><td class="mdescLeft"> </td><td class="mdescRight">Allow instances of this class to be copy constructed. <a href="#a0d3c59537291735849c740364496a41c">More...</a><br /></td></tr>
185 <tr class="separator:a0d3c59537291735849c740364496a41c inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memSeparator" colspan="2"> </td></tr>
186 <tr class="memitem:aa2c609345b3b6fa8da2486f75fff8ed8 inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_dimensions.xhtml#aa2c609345b3b6fa8da2486f75fff8ed8">Dimensions</a> (<a class="el" href="classarm__compute_1_1_dimensions.xhtml">Dimensions</a> &&)=default</td></tr>
187 <tr class="memdesc:aa2c609345b3b6fa8da2486f75fff8ed8 inherit pub_methods_classarm__compute_1_1_dimensions"><td class="mdescLeft"> </td><td class="mdescRight">Allow instances of this class to be move constructed. <a href="#aa2c609345b3b6fa8da2486f75fff8ed8">More...</a><br /></td></tr>
188 <tr class="separator:aa2c609345b3b6fa8da2486f75fff8ed8 inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memSeparator" colspan="2"> </td></tr>
189 <tr class="memitem:a2c96e96e2d005b4a8b66c2acd1688903 inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classarm__compute_1_1_dimensions.xhtml">Dimensions</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_dimensions.xhtml#a2c96e96e2d005b4a8b66c2acd1688903">operator=</a> (const <a class="el" href="classarm__compute_1_1_dimensions.xhtml">Dimensions</a> &)=default</td></tr>
190 <tr class="memdesc:a2c96e96e2d005b4a8b66c2acd1688903 inherit pub_methods_classarm__compute_1_1_dimensions"><td class="mdescLeft"> </td><td class="mdescRight">Allow instances of this class to be copied. <a href="#a2c96e96e2d005b4a8b66c2acd1688903">More...</a><br /></td></tr>
191 <tr class="separator:a2c96e96e2d005b4a8b66c2acd1688903 inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memSeparator" colspan="2"> </td></tr>
192 <tr class="memitem:a80565e11a35c48747bcc2cba06931e20 inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classarm__compute_1_1_dimensions.xhtml">Dimensions</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_dimensions.xhtml#a80565e11a35c48747bcc2cba06931e20">operator=</a> (<a class="el" href="classarm__compute_1_1_dimensions.xhtml">Dimensions</a> &&)=default</td></tr>
193 <tr class="memdesc:a80565e11a35c48747bcc2cba06931e20 inherit pub_methods_classarm__compute_1_1_dimensions"><td class="mdescLeft"> </td><td class="mdescRight">Allow instances of this class to be moved. <a href="#a80565e11a35c48747bcc2cba06931e20">More...</a><br /></td></tr>
194 <tr class="separator:a80565e11a35c48747bcc2cba06931e20 inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memSeparator" colspan="2"> </td></tr>
195 <tr class="memitem:a982730e6f0da5f9490f59bc5f6bb3f27 inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_dimensions.xhtml#a982730e6f0da5f9490f59bc5f6bb3f27">set</a> (size_t dimension, size_tvalue)</td></tr>
196 <tr class="memdesc:a982730e6f0da5f9490f59bc5f6bb3f27 inherit pub_methods_classarm__compute_1_1_dimensions"><td class="mdescLeft"> </td><td class="mdescRight">Accessor to set the value of one of the dimensions. <a href="#a982730e6f0da5f9490f59bc5f6bb3f27">More...</a><br /></td></tr>
197 <tr class="separator:a982730e6f0da5f9490f59bc5f6bb3f27 inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memSeparator" colspan="2"> </td></tr>
198 <tr class="memitem:afb5cd37bb08f1029691590372e6330f0 inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_dimensions.xhtml#afb5cd37bb08f1029691590372e6330f0">x</a> () const</td></tr>
199 <tr class="memdesc:afb5cd37bb08f1029691590372e6330f0 inherit pub_methods_classarm__compute_1_1_dimensions"><td class="mdescLeft"> </td><td class="mdescRight">Alias to access the size of the first dimension. <a href="#afb5cd37bb08f1029691590372e6330f0">More...</a><br /></td></tr>
200 <tr class="separator:afb5cd37bb08f1029691590372e6330f0 inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memSeparator" colspan="2"> </td></tr>
201 <tr class="memitem:a691c9cb93365c2e33f3429de43244098 inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_dimensions.xhtml#a691c9cb93365c2e33f3429de43244098">y</a> () const</td></tr>
202 <tr class="memdesc:a691c9cb93365c2e33f3429de43244098 inherit pub_methods_classarm__compute_1_1_dimensions"><td class="mdescLeft"> </td><td class="mdescRight">Alias to access the size of the second dimension. <a href="#a691c9cb93365c2e33f3429de43244098">More...</a><br /></td></tr>
203 <tr class="separator:a691c9cb93365c2e33f3429de43244098 inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memSeparator" colspan="2"> </td></tr>
204 <tr class="memitem:a336121cb63ed79fa0a072eed03d694ac inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_dimensions.xhtml#a336121cb63ed79fa0a072eed03d694ac">z</a> () const</td></tr>
205 <tr class="memdesc:a336121cb63ed79fa0a072eed03d694ac inherit pub_methods_classarm__compute_1_1_dimensions"><td class="mdescLeft"> </td><td class="mdescRight">Alias to access the size of the third dimension. <a href="#a336121cb63ed79fa0a072eed03d694ac">More...</a><br /></td></tr>
206 <tr class="separator:a336121cb63ed79fa0a072eed03d694ac inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memSeparator" colspan="2"> </td></tr>
207 <tr class="memitem:a4042981ab0351a730057258b672c8cab inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memItemLeft" align="right" valign="top">const size_t & </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_dimensions.xhtml#a4042981ab0351a730057258b672c8cab">operator[]</a> (size_t dimension) const</td></tr>
208 <tr class="memdesc:a4042981ab0351a730057258b672c8cab inherit pub_methods_classarm__compute_1_1_dimensions"><td class="mdescLeft"> </td><td class="mdescRight">Generic accessor to get the size of any dimension. <a href="#a4042981ab0351a730057258b672c8cab">More...</a><br /></td></tr>
209 <tr class="separator:a4042981ab0351a730057258b672c8cab inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memSeparator" colspan="2"> </td></tr>
210 <tr class="memitem:ac88390e0a6503d5d09c65d204980beb1 inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memItemLeft" align="right" valign="top">size_t & </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_dimensions.xhtml#ac88390e0a6503d5d09c65d204980beb1">operator[]</a> (size_t dimension)</td></tr>
211 <tr class="memdesc:ac88390e0a6503d5d09c65d204980beb1 inherit pub_methods_classarm__compute_1_1_dimensions"><td class="mdescLeft"> </td><td class="mdescRight">Generic accessor to get the size of any dimension. <a href="#ac88390e0a6503d5d09c65d204980beb1">More...</a><br /></td></tr>
212 <tr class="separator:ac88390e0a6503d5d09c65d204980beb1 inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memSeparator" colspan="2"> </td></tr>
213 <tr class="memitem:a0f59f175e7682c7ed5f4ea30ef687834 inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memItemLeft" align="right" valign="top">unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_dimensions.xhtml#a0f59f175e7682c7ed5f4ea30ef687834">num_dimensions</a> () const</td></tr>
214 <tr class="memdesc:a0f59f175e7682c7ed5f4ea30ef687834 inherit pub_methods_classarm__compute_1_1_dimensions"><td class="mdescLeft"> </td><td class="mdescRight">Returns the effective dimensionality of the tensor. <a href="#a0f59f175e7682c7ed5f4ea30ef687834">More...</a><br /></td></tr>
215 <tr class="separator:a0f59f175e7682c7ed5f4ea30ef687834 inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memSeparator" colspan="2"> </td></tr>
216 <tr class="memitem:a810a78f0b7cc0270f38d4136e023ea3b inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_dimensions.xhtml#a810a78f0b7cc0270f38d4136e023ea3b">set_num_dimensions</a> (size_t <a class="el" href="classarm__compute_1_1_dimensions.xhtml#a0f59f175e7682c7ed5f4ea30ef687834">num_dimensions</a>)</td></tr>
217 <tr class="memdesc:a810a78f0b7cc0270f38d4136e023ea3b inherit pub_methods_classarm__compute_1_1_dimensions"><td class="mdescLeft"> </td><td class="mdescRight">Set number of dimensions. <a href="#a810a78f0b7cc0270f38d4136e023ea3b">More...</a><br /></td></tr>
218 <tr class="separator:a810a78f0b7cc0270f38d4136e023ea3b inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memSeparator" colspan="2"> </td></tr>
219 <tr class="memitem:a0c265a91027decdda59e5086c550d0f7 inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_dimensions.xhtml#a0c265a91027decdda59e5086c550d0f7">collapse</a> (const size_t n, const size_t first=0)</td></tr>
220 <tr class="memdesc:a0c265a91027decdda59e5086c550d0f7 inherit pub_methods_classarm__compute_1_1_dimensions"><td class="mdescLeft"> </td><td class="mdescRight">Collapse dimensions. <a href="#a0c265a91027decdda59e5086c550d0f7">More...</a><br /></td></tr>
221 <tr class="separator:a0c265a91027decdda59e5086c550d0f7 inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memSeparator" colspan="2"> </td></tr>
222 <tr class="memitem:a112cc1d5093b7672bf11569659251a7c inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_dimensions.xhtml#a112cc1d5093b7672bf11569659251a7c">collapse_from</a> (size_t start)</td></tr>
223 <tr class="memdesc:a112cc1d5093b7672bf11569659251a7c inherit pub_methods_classarm__compute_1_1_dimensions"><td class="mdescLeft"> </td><td class="mdescRight">Collapse dimensions starting from a given point. <a href="#a112cc1d5093b7672bf11569659251a7c">More...</a><br /></td></tr>
224 <tr class="separator:a112cc1d5093b7672bf11569659251a7c inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memSeparator" colspan="2"> </td></tr>
225 <tr class="memitem:ab2878b67ca384a699c1270900b31290b inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memItemLeft" align="right" valign="top">std::array< size_t, <a class="el" href="classarm__compute_1_1_dimensions.xhtml#a1b67d5b720119d50faa286c774579ecc">num_max_dimensions</a> >::iterator </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_dimensions.xhtml#ab2878b67ca384a699c1270900b31290b">begin</a> ()</td></tr>
226 <tr class="memdesc:ab2878b67ca384a699c1270900b31290b inherit pub_methods_classarm__compute_1_1_dimensions"><td class="mdescLeft"> </td><td class="mdescRight">Returns a read/write iterator that points to the first element in the dimension array. <a href="#ab2878b67ca384a699c1270900b31290b">More...</a><br /></td></tr>
227 <tr class="separator:ab2878b67ca384a699c1270900b31290b inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memSeparator" colspan="2"> </td></tr>
228 <tr class="memitem:aeade0eaf149acac842e98d99d37e39c7 inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memItemLeft" align="right" valign="top">std::array< size_t, <a class="el" href="classarm__compute_1_1_dimensions.xhtml#a1b67d5b720119d50faa286c774579ecc">num_max_dimensions</a> >::const_iterator </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_dimensions.xhtml#aeade0eaf149acac842e98d99d37e39c7">begin</a> () const</td></tr>
229 <tr class="memdesc:aeade0eaf149acac842e98d99d37e39c7 inherit pub_methods_classarm__compute_1_1_dimensions"><td class="mdescLeft"> </td><td class="mdescRight">Returns a read-only (constant) iterator that points to the first element in the dimension array. <a href="#aeade0eaf149acac842e98d99d37e39c7">More...</a><br /></td></tr>
230 <tr class="separator:aeade0eaf149acac842e98d99d37e39c7 inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memSeparator" colspan="2"> </td></tr>
231 <tr class="memitem:a4498730adaf901d945c12841df994bba inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memItemLeft" align="right" valign="top">std::array< size_t, <a class="el" href="classarm__compute_1_1_dimensions.xhtml#a1b67d5b720119d50faa286c774579ecc">num_max_dimensions</a> >::const_iterator </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_dimensions.xhtml#a4498730adaf901d945c12841df994bba">cbegin</a> () const</td></tr>
232 <tr class="memdesc:a4498730adaf901d945c12841df994bba inherit pub_methods_classarm__compute_1_1_dimensions"><td class="mdescLeft"> </td><td class="mdescRight">Returns a read-only (constant) iterator that points to the first element in the dimension array. <a href="#a4498730adaf901d945c12841df994bba">More...</a><br /></td></tr>
233 <tr class="separator:a4498730adaf901d945c12841df994bba inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memSeparator" colspan="2"> </td></tr>
234 <tr class="memitem:ac684b52c6197edff9cccb3abd1e41f59 inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memItemLeft" align="right" valign="top">std::array< size_t, <a class="el" href="classarm__compute_1_1_dimensions.xhtml#a1b67d5b720119d50faa286c774579ecc">num_max_dimensions</a> >::iterator </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_dimensions.xhtml#ac684b52c6197edff9cccb3abd1e41f59">end</a> ()</td></tr>
235 <tr class="memdesc:ac684b52c6197edff9cccb3abd1e41f59 inherit pub_methods_classarm__compute_1_1_dimensions"><td class="mdescLeft"> </td><td class="mdescRight">Returns a read/write iterator that points one past the last element in the dimension array. <a href="#ac684b52c6197edff9cccb3abd1e41f59">More...</a><br /></td></tr>
236 <tr class="separator:ac684b52c6197edff9cccb3abd1e41f59 inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memSeparator" colspan="2"> </td></tr>
237 <tr class="memitem:a819e633cd63b404cf9938bc6e755c170 inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memItemLeft" align="right" valign="top">std::array< size_t, <a class="el" href="classarm__compute_1_1_dimensions.xhtml#a1b67d5b720119d50faa286c774579ecc">num_max_dimensions</a> >::const_iterator </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_dimensions.xhtml#a819e633cd63b404cf9938bc6e755c170">end</a> () const</td></tr>
238 <tr class="memdesc:a819e633cd63b404cf9938bc6e755c170 inherit pub_methods_classarm__compute_1_1_dimensions"><td class="mdescLeft"> </td><td class="mdescRight">Returns a read-only (constant) iterator that points one past the last element in the dimension array. <a href="#a819e633cd63b404cf9938bc6e755c170">More...</a><br /></td></tr>
239 <tr class="separator:a819e633cd63b404cf9938bc6e755c170 inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memSeparator" colspan="2"> </td></tr>
240 <tr class="memitem:adf9b6d55d708c285d58511a780e937fc inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memItemLeft" align="right" valign="top">std::array< size_t, <a class="el" href="classarm__compute_1_1_dimensions.xhtml#a1b67d5b720119d50faa286c774579ecc">num_max_dimensions</a> >::const_iterator </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_dimensions.xhtml#adf9b6d55d708c285d58511a780e937fc">cend</a> () const</td></tr>
241 <tr class="memdesc:adf9b6d55d708c285d58511a780e937fc inherit pub_methods_classarm__compute_1_1_dimensions"><td class="mdescLeft"> </td><td class="mdescRight">Returns a read-only (constant) iterator that points one past the last element in the dimension array. <a href="#adf9b6d55d708c285d58511a780e937fc">More...</a><br /></td></tr>
242 <tr class="separator:adf9b6d55d708c285d58511a780e937fc inherit pub_methods_classarm__compute_1_1_dimensions"><td class="memSeparator" colspan="2"> </td></tr>
243 </table><table class="memberdecls">
244 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
245 Static Public Member Functions</h2></td></tr>
246 <tr class="memitem:a58838fbdce5b5330d84e62329b45ff7d"><td class="memTemplParams" colspan="2">template<typename... Shapes> </td></tr>
247 <tr class="memitem:a58838fbdce5b5330d84e62329b45ff7d"><td class="memTemplItemLeft" align="right" valign="top">static <a class="el" href="classarm__compute_1_1_tensor_shape.xhtml">TensorShape</a> </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_tensor_shape.xhtml#a58838fbdce5b5330d84e62329b45ff7d">broadcast_shape</a> (const Shapes &...shapes)</td></tr>
248 <tr class="memdesc:a58838fbdce5b5330d84e62329b45ff7d"><td class="mdescLeft"> </td><td class="mdescRight">If shapes are broadcast compatible, return the broadcasted shape. <a href="#a58838fbdce5b5330d84e62329b45ff7d">More...</a><br /></td></tr>
249 <tr class="separator:a58838fbdce5b5330d84e62329b45ff7d"><td class="memSeparator" colspan="2"> </td></tr>
250 </table><table class="memberdecls">
251 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a>
252 Additional Inherited Members</h2></td></tr>
253 <tr class="inherit_header pub_static_attribs_classarm__compute_1_1_dimensions"><td colspan="2" onclick="javascript:toggleInherit('pub_static_attribs_classarm__compute_1_1_dimensions')"><img src="closed.png" alt="-"/> Static Public Attributes inherited from <a class="el" href="classarm__compute_1_1_dimensions.xhtml">Dimensions< size_t ></a></td></tr>
254 <tr class="memitem:a1b67d5b720119d50faa286c774579ecc inherit pub_static_attribs_classarm__compute_1_1_dimensions"><td class="memItemLeft" align="right" valign="top">static constexpr size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_dimensions.xhtml#a1b67d5b720119d50faa286c774579ecc">num_max_dimensions</a></td></tr>
255 <tr class="memdesc:a1b67d5b720119d50faa286c774579ecc inherit pub_static_attribs_classarm__compute_1_1_dimensions"><td class="mdescLeft"> </td><td class="mdescRight">Number of dimensions the tensor has. <a href="#a1b67d5b720119d50faa286c774579ecc">More...</a><br /></td></tr>
256 <tr class="separator:a1b67d5b720119d50faa286c774579ecc inherit pub_static_attribs_classarm__compute_1_1_dimensions"><td class="memSeparator" colspan="2"> </td></tr>
258 <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
259 <div class="textblock"><p>Shape of a tensor. </p>
261 <p>Definition at line <a class="el" href="_tensor_shape_8h_source.xhtml#l00039">39</a> of file <a class="el" href="_tensor_shape_8h_source.xhtml">TensorShape.h</a>.</p>
262 </div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
263 <a class="anchor" id="a929d0b5223357298ada0ce4d42fa5ec7"></a>
264 <div class="memitem">
265 <div class="memproto">
266 <table class="mlabels">
268 <td class="mlabels-left">
269 <table class="memname">
271 <td class="memname"><a class="el" href="classarm__compute_1_1_tensor_shape.xhtml">TensorShape</a> </td>
273 <td class="paramtype">Ts... </td>
274 <td class="paramname"><em>dims</em></td><td>)</td>
279 <td class="mlabels-right">
280 <span class="mlabels"><span class="mlabel">inline</span></span> </td>
283 </div><div class="memdoc">
285 <p>Constructor to initialize the tensor shape. </p>
286 <dl class="params"><dt>Parameters</dt><dd>
287 <table class="params">
288 <tr><td class="paramdir">[in]</td><td class="paramname">dims</td><td>Values to initialize the dimensions. </td></tr>
293 <p>Definition at line <a class="el" href="_tensor_shape_8h_source.xhtml#l00047">47</a> of file <a class="el" href="_tensor_shape_8h_source.xhtml">TensorShape.h</a>.</p>
295 <p>References <a class="el" href="classarm__compute_1_1_tensor_shape.xhtml#a355b1a84ab7af3b8ef9a6bea1939450a">TensorShape::operator=()</a>, and <a class="el" href="classarm__compute_1_1_tensor_shape.xhtml#a29ff524f0e3378fb25a8447bdeed6ba9">TensorShape::~TensorShape()</a>.</p>
296 <div class="fragment"><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  : <a class="code" href="classarm__compute_1_1_dimensions.xhtml#aa521fcebc508ef8447da413cc64d020a">Dimensions</a>{ dims... }</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  {</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  <span class="comment">// Initialize unspecified dimensions to 1</span></div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  <span class="keywordflow">if</span>(_num_dimensions > 0)</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  {</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  std::fill(_id.begin() + _num_dimensions, _id.end(), 1);</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  }</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span> </div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  <span class="comment">// Correct number dimensions to ignore trailing dimensions of size 1</span></div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  apply_dimension_correction();</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  }</div><div class="ttc" id="classarm__compute_1_1_dimensions_xhtml_aa521fcebc508ef8447da413cc64d020a"><div class="ttname"><a href="classarm__compute_1_1_dimensions.xhtml#aa521fcebc508ef8447da413cc64d020a">arm_compute::Dimensions< size_t >::Dimensions</a></div><div class="ttdeci">Dimensions(Ts...dims)</div><div class="ttdoc">Constructor to initialize the tensor shape. </div><div class="ttdef"><b>Definition:</b> <a href="_dimensions_8h_source.xhtml#l00052">Dimensions.h:52</a></div></div>
297 </div><!-- fragment -->
300 <a class="anchor" id="af156b289692f8c3f64688e9a2932ae78"></a>
301 <div class="memitem">
302 <div class="memproto">
303 <table class="mlabels">
305 <td class="mlabels-left">
306 <table class="memname">
308 <td class="memname"><a class="el" href="classarm__compute_1_1_tensor_shape.xhtml">TensorShape</a> </td>
310 <td class="paramtype">const <a class="el" href="classarm__compute_1_1_tensor_shape.xhtml">TensorShape</a> & </td>
311 <td class="paramname"></td><td>)</td>
316 <td class="mlabels-right">
317 <span class="mlabels"><span class="mlabel">default</span></span> </td>
320 </div><div class="memdoc">
322 <p>Allow instances of this class to be copy constructed. </p>
326 <a class="anchor" id="a5fa5abfb10a67d23a75339646e84517a"></a>
327 <div class="memitem">
328 <div class="memproto">
329 <table class="mlabels">
331 <td class="mlabels-left">
332 <table class="memname">
334 <td class="memname"><a class="el" href="classarm__compute_1_1_tensor_shape.xhtml">TensorShape</a> </td>
336 <td class="paramtype"><a class="el" href="classarm__compute_1_1_tensor_shape.xhtml">TensorShape</a> && </td>
337 <td class="paramname"></td><td>)</td>
342 <td class="mlabels-right">
343 <span class="mlabels"><span class="mlabel">default</span></span> </td>
346 </div><div class="memdoc">
348 <p>Allow instances of this class to be move constructed. </p>
352 <a class="anchor" id="a29ff524f0e3378fb25a8447bdeed6ba9"></a>
353 <div class="memitem">
354 <div class="memproto">
355 <table class="mlabels">
357 <td class="mlabels-left">
358 <table class="memname">
360 <td class="memname">~<a class="el" href="classarm__compute_1_1_tensor_shape.xhtml">TensorShape</a> </td>
362 <td class="paramname"></td><td>)</td>
367 <td class="mlabels-right">
368 <span class="mlabels"><span class="mlabel">default</span></span> </td>
371 </div><div class="memdoc">
373 <p>Default destructor. </p>
375 <p>Referenced by <a class="el" href="_tensor_shape_8h_source.xhtml#l00047">TensorShape::TensorShape()</a>.</p>
379 <h2 class="groupheader">Member Function Documentation</h2>
380 <a class="anchor" id="a58838fbdce5b5330d84e62329b45ff7d"></a>
381 <div class="memitem">
382 <div class="memproto">
383 <table class="mlabels">
385 <td class="mlabels-left">
386 <table class="memname">
388 <td class="memname">static <a class="el" href="classarm__compute_1_1_tensor_shape.xhtml">TensorShape</a> broadcast_shape </td>
390 <td class="paramtype">const Shapes &... </td>
391 <td class="paramname"><em>shapes</em></td><td>)</td>
396 <td class="mlabels-right">
397 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
400 </div><div class="memdoc">
402 <p>If shapes are broadcast compatible, return the broadcasted shape. </p>
403 <p>Two tensor shapes are broadcast compatible if for each dimension, they're equal or one of them is 1.</p>
404 <p>If two shapes are compatible, each dimension in the broadcasted shape is the max of the original dimensions.</p>
405 <dl class="params"><dt>Parameters</dt><dd>
406 <table class="params">
407 <tr><td class="paramdir">[in]</td><td class="paramname">shapes</td><td><a class="el" href="classarm__compute_1_1_tensor.xhtml" title="Basic implementation of the tensor interface. ">Tensor</a> shapes.</td></tr>
411 <dl class="section return"><dt>Returns</dt><dd>The broadcasted shape or an empty shape if the shapes are not broadcast compatible. </dd></dl>
413 <p>Definition at line <a class="el" href="_tensor_shape_8h_source.xhtml#l00196">196</a> of file <a class="el" href="_tensor_shape_8h_source.xhtml">TensorShape.h</a>.</p>
415 <p>References <a class="el" href="_utility_8h_source.xhtml#l00091">arm_compute::utility::for_each()</a>, <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00902">arm_compute::test::fixed_point_arithmetic::detail::max()</a>, <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00897">arm_compute::test::fixed_point_arithmetic::detail::min()</a>, <a class="el" href="_dimensions_8h_source.xhtml#l00122">Dimensions< T >::num_dimensions()</a>, <a class="el" href="_dimensions_8h_source.xhtml#l00045">Dimensions< size_t >::num_max_dimensions</a>, <a class="el" href="_tensor_shape_8h_source.xhtml#l00078">TensorShape::set()</a>, and <a class="el" href="namespacearm__compute.xhtml#a1ce9b523fd4f3b5bbcadcd796183455aa4c614360da93c0a041b22e537de151eb">arm_compute::U</a>.</p>
417 <p>Referenced by <a class="el" href="reference_2_arithmetic_addition_8cpp_source.xhtml#l00089">arm_compute::test::validation::reference::arithmetic_addition()</a>, <a class="el" href="_i_tensor_info_8h_source.xhtml#l00260">ITensorInfo::broadcast_shape_and_valid_region()</a>, and <a class="el" href="reference_2_pixel_wise_multiplication_8cpp_source.xhtml#l00131">arm_compute::test::validation::reference::pixel_wise_multiplication()</a>.</p>
418 <div class="fragment"><div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  {</div><div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  <a class="code" href="classarm__compute_1_1_tensor_shape.xhtml#a929d0b5223357298ada0ce4d42fa5ec7">TensorShape</a> bc_shape;</div><div class="line"><a name="l00199"></a><span class="lineno"> 199</span> </div><div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  <span class="keyword">auto</span> broadcast = [&bc_shape](<span class="keyword">const</span> <a class="code" href="classarm__compute_1_1_tensor_shape.xhtml#a929d0b5223357298ada0ce4d42fa5ec7">TensorShape</a> & other)</div><div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  {</div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  <span class="keywordflow">if</span>(bc_shape.num_dimensions() == 0)</div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  {</div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span>  bc_shape = other;</div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  }</div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span>(other.num_dimensions() != 0)</div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  {</div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  <span class="keywordflow">for</span>(<span class="keywordtype">size_t</span> d = 0; d < <a class="code" href="classarm__compute_1_1_dimensions.xhtml#a1b67d5b720119d50faa286c774579ecc">TensorShape::num_max_dimensions</a>; ++d)</div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  {</div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span>  <span class="keyword">const</span> <span class="keywordtype">size_t</span> dim_min = <a class="code" href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml#aabcf39e3917f842dbc5fbb0d802f24d5">std::min</a>(bc_shape[d], other[d]);</div><div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  <span class="keyword">const</span> <span class="keywordtype">size_t</span> dim_max = <a class="code" href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml#ad91bb73431b4de1f4946ed949d444849">std::max</a>(bc_shape[d], other[d]);</div><div class="line"><a name="l00212"></a><span class="lineno"> 212</span> </div><div class="line"><a name="l00213"></a><span class="lineno"> 213</span>  <span class="keywordflow">if</span>((dim_min != 1) && (dim_min != dim_max))</div><div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  {</div><div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  bc_shape = <a class="code" href="classarm__compute_1_1_tensor_shape.xhtml#a929d0b5223357298ada0ce4d42fa5ec7">TensorShape</a>{ 0<a class="code" href="namespacearm__compute.xhtml#a1ce9b523fd4f3b5bbcadcd796183455aa4c614360da93c0a041b22e537de151eb">U</a> };</div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  }</div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span> </div><div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  bc_shape.set(d, dim_max);</div><div class="line"><a name="l00220"></a><span class="lineno"> 220</span>  }</div><div class="line"><a name="l00221"></a><span class="lineno"> 221</span>  }</div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  };</div><div class="line"><a name="l00223"></a><span class="lineno"> 223</span> </div><div class="line"><a name="l00224"></a><span class="lineno"> 224</span>  <a class="code" href="namespacearm__compute_1_1utility.xhtml#a067ebd28103d827b6ec17032e2344064">utility::for_each</a>(broadcast, shapes...);</div><div class="line"><a name="l00225"></a><span class="lineno"> 225</span> </div><div class="line"><a name="l00226"></a><span class="lineno"> 226</span>  <span class="keywordflow">return</span> bc_shape;</div><div class="line"><a name="l00227"></a><span class="lineno"> 227</span>  }</div><div class="ttc" id="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_xhtml_aabcf39e3917f842dbc5fbb0d802f24d5"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml#aabcf39e3917f842dbc5fbb0d802f24d5">arm_compute::test::fixed_point_arithmetic::detail::min</a></div><div class="ttdeci">fixed_point< T > min(fixed_point< T > x, fixed_point< T > y)</div><div class="ttdef"><b>Definition:</b> <a href="tests_2validation_2_fixed_point_8h_source.xhtml#l00897">FixedPoint.h:897</a></div></div>
419 <div class="ttc" id="namespacearm__compute_xhtml_a1ce9b523fd4f3b5bbcadcd796183455aa4c614360da93c0a041b22e537de151eb"><div class="ttname"><a href="namespacearm__compute.xhtml#a1ce9b523fd4f3b5bbcadcd796183455aa4c614360da93c0a041b22e537de151eb">arm_compute::Channel::U</a></div><div class="ttdoc">Cb/U channel. </div></div>
420 <div class="ttc" id="classarm__compute_1_1_tensor_shape_xhtml_a929d0b5223357298ada0ce4d42fa5ec7"><div class="ttname"><a href="classarm__compute_1_1_tensor_shape.xhtml#a929d0b5223357298ada0ce4d42fa5ec7">arm_compute::TensorShape::TensorShape</a></div><div class="ttdeci">TensorShape(Ts...dims)</div><div class="ttdoc">Constructor to initialize the tensor shape. </div><div class="ttdef"><b>Definition:</b> <a href="_tensor_shape_8h_source.xhtml#l00047">TensorShape.h:47</a></div></div>
421 <div class="ttc" id="namespacearm__compute_1_1utility_xhtml_a067ebd28103d827b6ec17032e2344064"><div class="ttname"><a href="namespacearm__compute_1_1utility.xhtml#a067ebd28103d827b6ec17032e2344064">arm_compute::utility::for_each</a></div><div class="ttdeci">void for_each(F &&)</div><div class="ttdoc">Base case of for_each. </div><div class="ttdef"><b>Definition:</b> <a href="_utility_8h_source.xhtml#l00091">Utility.h:91</a></div></div>
422 <div class="ttc" id="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_xhtml_ad91bb73431b4de1f4946ed949d444849"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml#ad91bb73431b4de1f4946ed949d444849">arm_compute::test::fixed_point_arithmetic::detail::max</a></div><div class="ttdeci">fixed_point< T > max(fixed_point< T > x, fixed_point< T > y)</div><div class="ttdef"><b>Definition:</b> <a href="tests_2validation_2_fixed_point_8h_source.xhtml#l00902">FixedPoint.h:902</a></div></div>
423 <div class="ttc" id="classarm__compute_1_1_dimensions_xhtml_a1b67d5b720119d50faa286c774579ecc"><div class="ttname"><a href="classarm__compute_1_1_dimensions.xhtml#a1b67d5b720119d50faa286c774579ecc">arm_compute::Dimensions< size_t >::num_max_dimensions</a></div><div class="ttdeci">static constexpr size_t num_max_dimensions</div><div class="ttdoc">Number of dimensions the tensor has. </div><div class="ttdef"><b>Definition:</b> <a href="_dimensions_8h_source.xhtml#l00045">Dimensions.h:45</a></div></div>
424 </div><!-- fragment -->
427 <a class="anchor" id="a8e15e87871211f98c2b566137e38ef99"></a>
428 <div class="memitem">
429 <div class="memproto">
430 <table class="mlabels">
432 <td class="mlabels-left">
433 <table class="memname">
435 <td class="memname">void collapse </td>
437 <td class="paramtype">size_t </td>
438 <td class="paramname"><em>n</em>, </td>
441 <td class="paramkey"></td>
443 <td class="paramtype">size_t </td>
444 <td class="paramname"><em>first</em> = <code>0</code> </td>
453 <td class="mlabels-right">
454 <span class="mlabels"><span class="mlabel">inline</span></span> </td>
457 </div><div class="memdoc">
459 <p>Collapse the first n dimensions. </p>
460 <dl class="params"><dt>Parameters</dt><dd>
461 <table class="params">
462 <tr><td class="paramdir">[in]</td><td class="paramname">n</td><td>Number of dimensions to collapse into <code>first</code> </td></tr>
463 <tr><td class="paramdir">[in]</td><td class="paramname">first</td><td><a class="el" href="classarm__compute_1_1_dimensions.xhtml" title="Dimensions with dimensionality. ">Dimensions</a> into which the following <code>n</code> are collapsed. </td></tr>
468 <p>Definition at line <a class="el" href="_tensor_shape_8h_source.xhtml#l00132">132</a> of file <a class="el" href="_tensor_shape_8h_source.xhtml">TensorShape.h</a>.</p>
470 <p>References <a class="el" href="_dimensions_8h_source.xhtml#l00138">Dimensions< T >::collapse()</a>.</p>
472 <p>Referenced by <a class="el" href="_tensor_shape_8h_source.xhtml#l00146">TensorShape::collapsed_from()</a>, and <a class="el" href="_shape_calculator_8h_source.xhtml#l00045">arm_compute::misc::shape_calculator::compute_weights_reshaped_shape()</a>.</p>
473 <div class="fragment"><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  {</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  <a class="code" href="classarm__compute_1_1_dimensions.xhtml#a0c265a91027decdda59e5086c550d0f7">Dimensions::collapse</a>(n, first);</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span> </div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  <span class="comment">// Make sure all empty dimensions are filled with 1</span></div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  std::fill(_id.begin() + _num_dimensions, _id.end(), 1);</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  }</div><div class="ttc" id="classarm__compute_1_1_dimensions_xhtml_a0c265a91027decdda59e5086c550d0f7"><div class="ttname"><a href="classarm__compute_1_1_dimensions.xhtml#a0c265a91027decdda59e5086c550d0f7">arm_compute::Dimensions::collapse</a></div><div class="ttdeci">void collapse(const size_t n, const size_t first=0)</div><div class="ttdoc">Collapse dimensions. </div><div class="ttdef"><b>Definition:</b> <a href="_dimensions_8h_source.xhtml#l00138">Dimensions.h:138</a></div></div>
474 </div><!-- fragment -->
477 <a class="anchor" id="a3b572f2fcba6fcf8b944a9161b2d365f"></a>
478 <div class="memitem">
479 <div class="memproto">
480 <table class="mlabels">
482 <td class="mlabels-left">
483 <table class="memname">
485 <td class="memname"><a class="el" href="classarm__compute_1_1_tensor_shape.xhtml">TensorShape</a> collapsed_from </td>
487 <td class="paramtype">size_t </td>
488 <td class="paramname"><em>start</em></td><td>)</td>
493 <td class="mlabels-right">
494 <span class="mlabels"><span class="mlabel">inline</span></span> </td>
497 </div><div class="memdoc">
499 <p>Return a copy with collapsed dimensions starting from a given point. </p>
500 <dl class="params"><dt>Parameters</dt><dd>
501 <table class="params">
502 <tr><td class="paramdir">[in]</td><td class="paramname">start</td><td>Starting point of collapsing dimensions.</td></tr>
506 <dl class="section return"><dt>Returns</dt><dd>A copy with collapse dimensions starting from start. </dd></dl>
508 <p>Definition at line <a class="el" href="_tensor_shape_8h_source.xhtml#l00146">146</a> of file <a class="el" href="_tensor_shape_8h_source.xhtml">TensorShape.h</a>.</p>
510 <p>References <a class="el" href="_tensor_shape_8h_source.xhtml#l00132">TensorShape::collapse()</a>, <a class="el" href="reference_2_copy_8cpp_source.xhtml#l00037">arm_compute::test::validation::reference::copy()</a>, and <a class="el" href="_dimensions_8h_source.xhtml#l00122">Dimensions< size_t >::num_dimensions()</a>.</p>
511 <div class="fragment"><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  {</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  <a class="code" href="classarm__compute_1_1_tensor_shape.xhtml#a929d0b5223357298ada0ce4d42fa5ec7">TensorShape</a> <a class="code" href="namespacearm__compute_1_1test_1_1validation_1_1reference.xhtml#ad9000ce99b9ffcec5722cade36d7e757">copy</a>(*<span class="keyword">this</span>);</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  <a class="code" href="namespacearm__compute_1_1test_1_1validation_1_1reference.xhtml#ad9000ce99b9ffcec5722cade36d7e757">copy</a>.collapse(<a class="code" href="classarm__compute_1_1_dimensions.xhtml#a0f59f175e7682c7ed5f4ea30ef687834">num_dimensions</a>(), start);</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  <span class="keywordflow">return</span> <a class="code" href="namespacearm__compute_1_1test_1_1validation_1_1reference.xhtml#ad9000ce99b9ffcec5722cade36d7e757">copy</a>;</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  }</div><div class="ttc" id="namespacearm__compute_1_1test_1_1validation_1_1reference_xhtml_ad9000ce99b9ffcec5722cade36d7e757"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation_1_1reference.xhtml#ad9000ce99b9ffcec5722cade36d7e757">arm_compute::test::validation::reference::copy</a></div><div class="ttdeci">SimpleTensor< T > copy(const SimpleTensor< T > &src, const TensorShape &output_shape)</div><div class="ttdef"><b>Definition:</b> <a href="reference_2_copy_8cpp_source.xhtml#l00037">Copy.cpp:37</a></div></div>
512 <div class="ttc" id="classarm__compute_1_1_tensor_shape_xhtml_a929d0b5223357298ada0ce4d42fa5ec7"><div class="ttname"><a href="classarm__compute_1_1_tensor_shape.xhtml#a929d0b5223357298ada0ce4d42fa5ec7">arm_compute::TensorShape::TensorShape</a></div><div class="ttdeci">TensorShape(Ts...dims)</div><div class="ttdoc">Constructor to initialize the tensor shape. </div><div class="ttdef"><b>Definition:</b> <a href="_tensor_shape_8h_source.xhtml#l00047">TensorShape.h:47</a></div></div>
513 <div class="ttc" id="classarm__compute_1_1_dimensions_xhtml_a0f59f175e7682c7ed5f4ea30ef687834"><div class="ttname"><a href="classarm__compute_1_1_dimensions.xhtml#a0f59f175e7682c7ed5f4ea30ef687834">arm_compute::Dimensions< size_t >::num_dimensions</a></div><div class="ttdeci">unsigned int num_dimensions() const</div><div class="ttdoc">Returns the effective dimensionality of the tensor. </div><div class="ttdef"><b>Definition:</b> <a href="_dimensions_8h_source.xhtml#l00122">Dimensions.h:122</a></div></div>
514 </div><!-- fragment -->
517 <a class="anchor" id="a355b1a84ab7af3b8ef9a6bea1939450a"></a>
518 <div class="memitem">
519 <div class="memproto">
520 <table class="mlabels">
522 <td class="mlabels-left">
523 <table class="memname">
525 <td class="memname"><a class="el" href="classarm__compute_1_1_tensor_shape.xhtml">TensorShape</a>& operator= </td>
527 <td class="paramtype">const <a class="el" href="classarm__compute_1_1_tensor_shape.xhtml">TensorShape</a> & </td>
528 <td class="paramname"></td><td>)</td>
533 <td class="mlabels-right">
534 <span class="mlabels"><span class="mlabel">default</span></span> </td>
537 </div><div class="memdoc">
539 <p>Allow instances of this class to be copied. </p>
541 <p>Referenced by <a class="el" href="_tensor_shape_8h_source.xhtml#l00047">TensorShape::TensorShape()</a>.</p>
545 <a class="anchor" id="afbfae7c97606fb71d556a9f4e46dda00"></a>
546 <div class="memitem">
547 <div class="memproto">
548 <table class="mlabels">
550 <td class="mlabels-left">
551 <table class="memname">
553 <td class="memname"><a class="el" href="classarm__compute_1_1_tensor_shape.xhtml">TensorShape</a>& operator= </td>
555 <td class="paramtype"><a class="el" href="classarm__compute_1_1_tensor_shape.xhtml">TensorShape</a> && </td>
556 <td class="paramname"></td><td>)</td>
561 <td class="mlabels-right">
562 <span class="mlabels"><span class="mlabel">default</span></span> </td>
565 </div><div class="memdoc">
567 <p>Allow instances of this class to be moved. </p>
571 <a class="anchor" id="acb74edf42335de0dca0da5158b704c4b"></a>
572 <div class="memitem">
573 <div class="memproto">
574 <table class="mlabels">
576 <td class="mlabels-left">
577 <table class="memname">
579 <td class="memname">void remove_dimension </td>
581 <td class="paramtype">size_t </td>
582 <td class="paramname"><em>n</em></td><td>)</td>
587 <td class="mlabels-right">
588 <span class="mlabels"><span class="mlabel">inline</span></span> </td>
591 </div><div class="memdoc">
593 <p>Accessor to remove the dimension n from the tensor shape. </p>
594 <dl class="section note"><dt>Note</dt><dd>The upper dimensions of the tensor shape will be shifted down by 1</dd></dl>
595 <dl class="params"><dt>Parameters</dt><dd>
596 <table class="params">
597 <tr><td class="paramdir">[in]</td><td class="paramname">n</td><td>Dimension to remove </td></tr>
602 <p>Definition at line <a class="el" href="_tensor_shape_8h_source.xhtml#l00110">110</a> of file <a class="el" href="_tensor_shape_8h_source.xhtml">TensorShape.h</a>.</p>
604 <p>References <a class="el" href="_error_8h_source.xhtml#l00328">ARM_COMPUTE_ERROR_ON</a>, and <a class="el" href="reference_2_copy_8cpp_source.xhtml#l00037">arm_compute::test::validation::reference::copy()</a>.</p>
606 <p>Referenced by <a class="el" href="_shape_calculator_8h_source.xhtml#l00089">arm_compute::misc::shape_calculator::compute_reductionA_shape()</a>, <a class="el" href="_shape_calculator_8h_source.xhtml#l00099">arm_compute::misc::shape_calculator::compute_reductionB_shape()</a>, and <a class="el" href="validation_2_c_l_2_dequantization_layer_8cpp_source.xhtml#l00054">arm_compute::test::validation::DATA_TEST_CASE()</a>.</p>
607 <div class="fragment"><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  {</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  <a class="code" href="_error_8h.xhtml#a54a6080c9f4df1f908e57a9bbb46f5da">ARM_COMPUTE_ERROR_ON</a>(_num_dimensions < 1);</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  <a class="code" href="_error_8h.xhtml#a54a6080c9f4df1f908e57a9bbb46f5da">ARM_COMPUTE_ERROR_ON</a>(n >= _num_dimensions);</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span> </div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  <a class="code" href="namespacearm__compute_1_1test_1_1validation_1_1reference.xhtml#ad9000ce99b9ffcec5722cade36d7e757">std::copy</a>(_id.begin() + n + 1, _id.end(), _id.begin() + n);</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span> </div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  <span class="comment">// Reduce number of dimensions</span></div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  _num_dimensions--;</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span> </div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  <span class="comment">// Make sure all empty dimensions are filled with 1</span></div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  std::fill(_id.begin() + _num_dimensions, _id.end(), 1);</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span> </div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  <span class="comment">// Correct number dimensions to ignore trailing dimensions of size 1</span></div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  apply_dimension_correction();</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  }</div><div class="ttc" id="_error_8h_xhtml_a54a6080c9f4df1f908e57a9bbb46f5da"><div class="ttname"><a href="_error_8h.xhtml#a54a6080c9f4df1f908e57a9bbb46f5da">ARM_COMPUTE_ERROR_ON</a></div><div class="ttdeci">#define ARM_COMPUTE_ERROR_ON(cond)</div><div class="ttdoc">If the condition is true then an error message is printed and an exception thrown. </div><div class="ttdef"><b>Definition:</b> <a href="_error_8h_source.xhtml#l00328">Error.h:328</a></div></div>
608 <div class="ttc" id="namespacearm__compute_1_1test_1_1validation_1_1reference_xhtml_ad9000ce99b9ffcec5722cade36d7e757"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation_1_1reference.xhtml#ad9000ce99b9ffcec5722cade36d7e757">arm_compute::test::validation::reference::copy</a></div><div class="ttdeci">SimpleTensor< T > copy(const SimpleTensor< T > &src, const TensorShape &output_shape)</div><div class="ttdef"><b>Definition:</b> <a href="reference_2_copy_8cpp_source.xhtml#l00037">Copy.cpp:37</a></div></div>
609 </div><!-- fragment -->
612 <a class="anchor" id="a9c54fb6cea3557692fe7c00c40bb40ad"></a>
613 <div class="memitem">
614 <div class="memproto">
615 <table class="mlabels">
617 <td class="mlabels-left">
618 <table class="memname">
620 <td class="memname"><a class="el" href="classarm__compute_1_1_tensor_shape.xhtml">TensorShape</a>& set </td>
622 <td class="paramtype">size_t </td>
623 <td class="paramname"><em>dimension</em>, </td>
626 <td class="paramkey"></td>
628 <td class="paramtype">size_t </td>
629 <td class="paramname"><em>value</em>, </td>
632 <td class="paramkey"></td>
634 <td class="paramtype">bool </td>
635 <td class="paramname"><em>apply_dim_correction</em> = <code>true</code> </td>
644 <td class="mlabels-right">
645 <span class="mlabels"><span class="mlabel">inline</span></span> </td>
648 </div><div class="memdoc">
650 <p>Accessor to set the value of one of the dimensions. </p>
651 <dl class="params"><dt>Parameters</dt><dd>
652 <table class="params">
653 <tr><td class="paramdir">[in]</td><td class="paramname">dimension</td><td>Dimension for which the value is set. </td></tr>
654 <tr><td class="paramdir">[in]</td><td class="paramname">value</td><td>Value to be set for the dimension. </td></tr>
655 <tr><td class="paramdir">[in]</td><td class="paramname">apply_dim_correction</td><td>Flag to state whether apply dimension correction after setting one dimension. E.g. when permuting NCHW -> NHWC, 1x1x2 would become 2x1x1, but _num_dimensions should be 3 rather than 1.</td></tr>
659 <dl class="section return"><dt>Returns</dt><dd>*this. </dd></dl>
661 <p>Definition at line <a class="el" href="_tensor_shape_8h_source.xhtml#l00078">78</a> of file <a class="el" href="_tensor_shape_8h_source.xhtml">TensorShape.h</a>.</p>
663 <p>References <a class="el" href="_dimensions_8h_source.xhtml#l00074">Dimensions< T >::set()</a>.</p>
665 <p>Referenced by <a class="el" href="arm__compute_2core_2_utils_8h_source.xhtml#l00688">arm_compute::adjust_odd_shape()</a>, <a class="el" href="_tensor_shape_8h_source.xhtml#l00196">TensorShape::broadcast_shape()</a>, <a class="el" href="arm__compute_2core_2_utils_8h_source.xhtml#l00651">arm_compute::calculate_depth_concatenate_shape()</a>, <a class="el" href="arm__compute_2core_2_utils_8h_source.xhtml#l00715">arm_compute::calculate_subsampled_shape()</a>, <a class="el" href="_shape_calculator_8h_source.xhtml#l00382">arm_compute::misc::shape_calculator::calculate_width_concatenate_shape()</a>, <a class="el" href="_shape_calculator_8h_source.xhtml#l00110">arm_compute::misc::shape_calculator::compute_col2im_shape()</a>, <a class="el" href="_shape_calculator_8h_source.xhtml#l00056">arm_compute::misc::shape_calculator::compute_interleaved_shape()</a>, <a class="el" href="_shape_calculator_8h_source.xhtml#l00361">arm_compute::misc::shape_calculator::compute_mm_shape()</a>, <a class="el" href="_shape_calculator_8h_source.xhtml#l00099">arm_compute::misc::shape_calculator::compute_reductionB_shape()</a>, <a class="el" href="_shape_calculator_8h_source.xhtml#l00067">arm_compute::misc::shape_calculator::compute_transpose1xW_shape()</a>, <a class="el" href="_shape_calculator_8h_source.xhtml#l00076">arm_compute::misc::shape_calculator::compute_transpose1xW_with_element_size_shape()</a>, <a class="el" href="_shape_calculator_8h_source.xhtml#l00119">arm_compute::misc::shape_calculator::compute_transposed_shape()</a>, <a class="el" href="validation_2_n_e_o_n_2_depthwise_convolution_layer_8cpp_source.xhtml#l00057">arm_compute::test::validation::DATA_TEST_CASE()</a>, <a class="el" href="reference_2_deconvolution_layer_8cpp_source.xhtml#l00038">arm_compute::test::validation::reference::deconvolution_layer()</a>, <a class="el" href="tests_2_utils_8h_source.xhtml#l00419">arm_compute::test::index2coord()</a>, <a class="el" href="_helpers_8inl_source.xhtml#l00303">arm_compute::index2coords()</a>, <a class="el" href="utils_2_utils_8h_source.xhtml#l00564">NPYLoader::init_tensor()</a>, <a class="el" href="arm__compute_2core_2_helpers_8h_source.xhtml#l00469">arm_compute::intersect_valid_regions()</a>, <a class="el" href="arm__compute_2core_2_helpers_8h_source.xhtml#l00553">arm_compute::permute()</a>, <a class="el" href="validation_2reference_2_scale_8cpp_source.xhtml#l00040">arm_compute::test::validation::reference::scale()</a>, <a class="el" href="tests_2_utils_8h_source.xhtml#l00222">arm_compute::test::shape_to_valid_region()</a>, <a class="el" href="tests_2_utils_8h_source.xhtml#l00256">arm_compute::test::shape_to_valid_region_gaussian_pyramid_half()</a>, and <a class="el" href="tests_2validation_2reference_2_utils_8cpp_source.xhtml#l00069">arm_compute::test::validation::transpose()</a>.</p>
666 <div class="fragment"><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  {</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  <span class="comment">// Clear entire shape if one dimension is zero</span></div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  <span class="keywordflow">if</span>(value == 0)</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  {</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  _num_dimensions = 0;</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  std::fill(_id.begin(), _id.end(), 0);</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  }</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  <span class="keywordflow">else</span></div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  {</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  <span class="comment">// Make sure all empty dimensions are filled with 1</span></div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  std::fill(_id.begin() + _num_dimensions, _id.end(), 1);</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span> </div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  <span class="comment">// Set the specified dimension and increase the number of dimensions if</span></div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  <span class="comment">// necessary</span></div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  <a class="code" href="classarm__compute_1_1_dimensions.xhtml#a982730e6f0da5f9490f59bc5f6bb3f27">Dimensions::set</a>(dimension, value);</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span> </div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  <span class="comment">// Correct number dimensions to ignore trailing dimensions of size 1</span></div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  <span class="keywordflow">if</span>(apply_dim_correction)</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  {</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  apply_dimension_correction();</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  }</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  }</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  }</div><div class="ttc" id="classarm__compute_1_1_dimensions_xhtml_a982730e6f0da5f9490f59bc5f6bb3f27"><div class="ttname"><a href="classarm__compute_1_1_dimensions.xhtml#a982730e6f0da5f9490f59bc5f6bb3f27">arm_compute::Dimensions::set</a></div><div class="ttdeci">void set(size_t dimension, T value)</div><div class="ttdoc">Accessor to set the value of one of the dimensions. </div><div class="ttdef"><b>Definition:</b> <a href="_dimensions_8h_source.xhtml#l00074">Dimensions.h:74</a></div></div>
667 </div><!-- fragment -->
670 <a class="anchor" id="a4eaec01ba2c12093db609d1034ad0bc1"></a>
671 <div class="memitem">
672 <div class="memproto">
673 <table class="mlabels">
675 <td class="mlabels-left">
676 <table class="memname">
678 <td class="memname">size_t total_size </td>
680 <td class="paramname"></td><td>)</td>
685 <td class="mlabels-right">
686 <span class="mlabels"><span class="mlabel">inline</span></span> </td>
689 </div><div class="memdoc">
691 <p>Collapses all dimensions to a single linear total size. </p>
692 <dl class="section return"><dt>Returns</dt><dd>The total tensor size in terms of elements. </dd></dl>
694 <p>Definition at line <a class="el" href="_tensor_shape_8h_source.xhtml#l00157">157</a> of file <a class="el" href="_tensor_shape_8h_source.xhtml">TensorShape.h</a>.</p>
696 <p>References <a class="el" href="accumulate_8cl_source.xhtml#l00041">accumulate()</a>.</p>
698 <p>Referenced by <a class="el" href="_helpers_8inl_source.xhtml#l00201">arm_compute::auto_init_if_empty()</a>, <a class="el" href="tests_2_utils_8h_source.xhtml#l00448">arm_compute::test::coord2index()</a>, <a class="el" href="_helpers_8inl_source.xhtml#l00322">arm_compute::coords2index()</a>, <a class="el" href="_tensor_shape_8cpp_source.xhtml#l00039">arm_compute::test::validation::DATA_TEST_CASE()</a>, <a class="el" href="validation_2reference_2_depthwise_convolution_layer_8cpp_source.xhtml#l00122">arm_compute::test::validation::reference::depthwise_convolution()</a>, <a class="el" href="tests_2_utils_8h_source.xhtml#l00419">arm_compute::test::index2coord()</a>, <a class="el" href="_helpers_8inl_source.xhtml#l00303">arm_compute::index2coords()</a>, <a class="el" href="_g_c_accessor_8h_source.xhtml#l00123">GCAccessor::num_elements()</a>, <a class="el" href="_accessor_8h_source.xhtml#l00122">Accessor::num_elements()</a>, <a class="el" href="_c_l_accessor_8h_source.xhtml#l00135">CLAccessor::num_elements()</a>, <a class="el" href="_simple_tensor_8h_source.xhtml#l00386">SimpleTensor< T >::num_elements()</a>, <a class="el" href="validation_2reference_2_reshape_layer_8cpp_source.xhtml#l00037">arm_compute::test::validation::reference::reshape_layer()</a>, <a class="el" href="_helpers_8inl_source.xhtml#l00237">arm_compute::set_shape_if_empty()</a>, and <a class="el" href="_sub_tensor_info_8h_source.xhtml#l00210">SubTensorInfo::set_valid_region()</a>.</p>
699 <div class="fragment"><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  {</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  <span class="keywordflow">return</span> <a class="code" href="accumulate_8cl.xhtml#a00e540076dd545ad59ac7482f8cdf514">std::accumulate</a>(_id.begin(), _id.end(), 1, std::multiplies<size_t>());</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  }</div><div class="ttc" id="accumulate_8cl_xhtml_a00e540076dd545ad59ac7482f8cdf514"><div class="ttname"><a href="accumulate_8cl.xhtml#a00e540076dd545ad59ac7482f8cdf514">accumulate</a></div><div class="ttdeci">__kernel void accumulate(__global uchar *input_ptr, uint input_stride_x, uint input_step_x, uint input_stride_y, uint input_step_y, uint input_offset_first_element_in_bytes, __global uchar *accu_ptr, uint accu_stride_x, uint accu_step_x, uint accu_stride_y, uint accu_step_y, uint accu_offset_first_element_in_bytes)</div><div class="ttdoc">This function accumulates an input image into output image. </div><div class="ttdef"><b>Definition:</b> <a href="accumulate_8cl_source.xhtml#l00041">accumulate.cl:41</a></div></div>
700 </div><!-- fragment -->
703 <a class="anchor" id="a1a82725c69bdbd17294caa129743984c"></a>
704 <div class="memitem">
705 <div class="memproto">
706 <table class="mlabels">
708 <td class="mlabels-left">
709 <table class="memname">
711 <td class="memname">size_t total_size_lower </td>
713 <td class="paramtype">size_t </td>
714 <td class="paramname"><em>dimension</em></td><td>)</td>
719 <td class="mlabels-right">
720 <span class="mlabels"><span class="mlabel">inline</span></span> </td>
723 </div><div class="memdoc">
725 <p>Compute size of dimensions lower than the given one. </p>
726 <dl class="params"><dt>Parameters</dt><dd>
727 <table class="params">
728 <tr><td class="paramdir">[in]</td><td class="paramname">dimension</td><td>Upper boundary.</td></tr>
732 <dl class="section return"><dt>Returns</dt><dd>The linear size of the collapsed dimensions. </dd></dl>
734 <p>Definition at line <a class="el" href="_tensor_shape_8h_source.xhtml#l00179">179</a> of file <a class="el" href="_tensor_shape_8h_source.xhtml">TensorShape.h</a>.</p>
736 <p>References <a class="el" href="accumulate_8cl_source.xhtml#l00041">accumulate()</a>, <a class="el" href="_error_8h_source.xhtml#l00328">ARM_COMPUTE_ERROR_ON</a>, and <a class="el" href="_dimensions_8h_source.xhtml#l00045">Dimensions< size_t >::num_max_dimensions</a>.</p>
737 <div class="fragment"><div class="line"><a name="l00180"></a><span class="lineno"> 180</span>  {</div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span>  <a class="code" href="_error_8h.xhtml#a54a6080c9f4df1f908e57a9bbb46f5da">ARM_COMPUTE_ERROR_ON</a>(dimension > <a class="code" href="classarm__compute_1_1_dimensions.xhtml#a1b67d5b720119d50faa286c774579ecc">TensorShape::num_max_dimensions</a>);</div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  <span class="keywordflow">return</span> <a class="code" href="accumulate_8cl.xhtml#a00e540076dd545ad59ac7482f8cdf514">std::accumulate</a>(_id.begin(), _id.begin() + dimension, 1, std::multiplies<size_t>());</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  }</div><div class="ttc" id="_error_8h_xhtml_a54a6080c9f4df1f908e57a9bbb46f5da"><div class="ttname"><a href="_error_8h.xhtml#a54a6080c9f4df1f908e57a9bbb46f5da">ARM_COMPUTE_ERROR_ON</a></div><div class="ttdeci">#define ARM_COMPUTE_ERROR_ON(cond)</div><div class="ttdoc">If the condition is true then an error message is printed and an exception thrown. </div><div class="ttdef"><b>Definition:</b> <a href="_error_8h_source.xhtml#l00328">Error.h:328</a></div></div>
738 <div class="ttc" id="accumulate_8cl_xhtml_a00e540076dd545ad59ac7482f8cdf514"><div class="ttname"><a href="accumulate_8cl.xhtml#a00e540076dd545ad59ac7482f8cdf514">accumulate</a></div><div class="ttdeci">__kernel void accumulate(__global uchar *input_ptr, uint input_stride_x, uint input_step_x, uint input_stride_y, uint input_step_y, uint input_offset_first_element_in_bytes, __global uchar *accu_ptr, uint accu_stride_x, uint accu_step_x, uint accu_stride_y, uint accu_step_y, uint accu_offset_first_element_in_bytes)</div><div class="ttdoc">This function accumulates an input image into output image. </div><div class="ttdef"><b>Definition:</b> <a href="accumulate_8cl_source.xhtml#l00041">accumulate.cl:41</a></div></div>
739 <div class="ttc" id="classarm__compute_1_1_dimensions_xhtml_a1b67d5b720119d50faa286c774579ecc"><div class="ttname"><a href="classarm__compute_1_1_dimensions.xhtml#a1b67d5b720119d50faa286c774579ecc">arm_compute::Dimensions< size_t >::num_max_dimensions</a></div><div class="ttdeci">static constexpr size_t num_max_dimensions</div><div class="ttdoc">Number of dimensions the tensor has. </div><div class="ttdef"><b>Definition:</b> <a href="_dimensions_8h_source.xhtml#l00045">Dimensions.h:45</a></div></div>
740 </div><!-- fragment -->
743 <a class="anchor" id="a91d8061f66e7f8bc56da91d965f04376"></a>
744 <div class="memitem">
745 <div class="memproto">
746 <table class="mlabels">
748 <td class="mlabels-left">
749 <table class="memname">
751 <td class="memname">size_t total_size_upper </td>
753 <td class="paramtype">size_t </td>
754 <td class="paramname"><em>dimension</em></td><td>)</td>
759 <td class="mlabels-right">
760 <span class="mlabels"><span class="mlabel">inline</span></span> </td>
763 </div><div class="memdoc">
765 <p>Collapses given dimension and above. </p>
766 <dl class="params"><dt>Parameters</dt><dd>
767 <table class="params">
768 <tr><td class="paramdir">[in]</td><td class="paramname">dimension</td><td>Size of the wanted dimension</td></tr>
772 <dl class="section return"><dt>Returns</dt><dd>The linear size of the collapsed dimensions </dd></dl>
774 <p>Definition at line <a class="el" href="_tensor_shape_8h_source.xhtml#l00167">167</a> of file <a class="el" href="_tensor_shape_8h_source.xhtml">TensorShape.h</a>.</p>
776 <p>References <a class="el" href="accumulate_8cl_source.xhtml#l00041">accumulate()</a>, <a class="el" href="_error_8h_source.xhtml#l00328">ARM_COMPUTE_ERROR_ON</a>, and <a class="el" href="_dimensions_8h_source.xhtml#l00045">Dimensions< size_t >::num_max_dimensions</a>.</p>
778 <p>Referenced by <a class="el" href="validation_2reference_2_fully_connected_layer_8cpp_source.xhtml#l00152">arm_compute::test::validation::reference::fully_connected_layer()</a>, and <a class="el" href="_assembly_helper_8h_source.xhtml#l00159">arm_compute::setup_assembly_kernel()</a>.</p>
779 <div class="fragment"><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  {</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  <a class="code" href="_error_8h.xhtml#a54a6080c9f4df1f908e57a9bbb46f5da">ARM_COMPUTE_ERROR_ON</a>(dimension >= <a class="code" href="classarm__compute_1_1_dimensions.xhtml#a1b67d5b720119d50faa286c774579ecc">TensorShape::num_max_dimensions</a>);</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  <span class="keywordflow">return</span> <a class="code" href="accumulate_8cl.xhtml#a00e540076dd545ad59ac7482f8cdf514">std::accumulate</a>(_id.begin() + dimension, _id.end(), 1, std::multiplies<size_t>());</div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  }</div><div class="ttc" id="_error_8h_xhtml_a54a6080c9f4df1f908e57a9bbb46f5da"><div class="ttname"><a href="_error_8h.xhtml#a54a6080c9f4df1f908e57a9bbb46f5da">ARM_COMPUTE_ERROR_ON</a></div><div class="ttdeci">#define ARM_COMPUTE_ERROR_ON(cond)</div><div class="ttdoc">If the condition is true then an error message is printed and an exception thrown. </div><div class="ttdef"><b>Definition:</b> <a href="_error_8h_source.xhtml#l00328">Error.h:328</a></div></div>
780 <div class="ttc" id="accumulate_8cl_xhtml_a00e540076dd545ad59ac7482f8cdf514"><div class="ttname"><a href="accumulate_8cl.xhtml#a00e540076dd545ad59ac7482f8cdf514">accumulate</a></div><div class="ttdeci">__kernel void accumulate(__global uchar *input_ptr, uint input_stride_x, uint input_step_x, uint input_stride_y, uint input_step_y, uint input_offset_first_element_in_bytes, __global uchar *accu_ptr, uint accu_stride_x, uint accu_step_x, uint accu_stride_y, uint accu_step_y, uint accu_offset_first_element_in_bytes)</div><div class="ttdoc">This function accumulates an input image into output image. </div><div class="ttdef"><b>Definition:</b> <a href="accumulate_8cl_source.xhtml#l00041">accumulate.cl:41</a></div></div>
781 <div class="ttc" id="classarm__compute_1_1_dimensions_xhtml_a1b67d5b720119d50faa286c774579ecc"><div class="ttname"><a href="classarm__compute_1_1_dimensions.xhtml#a1b67d5b720119d50faa286c774579ecc">arm_compute::Dimensions< size_t >::num_max_dimensions</a></div><div class="ttdeci">static constexpr size_t num_max_dimensions</div><div class="ttdoc">Number of dimensions the tensor has. </div><div class="ttdef"><b>Definition:</b> <a href="_dimensions_8h_source.xhtml#l00045">Dimensions.h:45</a></div></div>
782 </div><!-- fragment -->
785 <hr/>The documentation for this class was generated from the following file:<ul>
786 <li>arm_compute/core/<a class="el" href="_tensor_shape_8h_source.xhtml">TensorShape.h</a></li>
788 </div><!-- contents -->
789 </div><!-- doc-content -->
790 <!-- start footer part -->
791 <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
793 <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_tensor_shape.xhtml">TensorShape</a></li>
794 <li class="footer">Generated on Wed May 23 2018 11:36:43 for Compute Library by
795 <a href="http://www.doxygen.org/index.html">
796 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>