Ryan OShea | de36e4a | 2020-03-13 16:26:19 +0000 | [diff] [blame] | 1 | <!-- Copyright (c) 2020 ARM Limited. --> |
| 2 | <!-- --> |
| 3 | <!-- SPDX-License-Identifier: MIT --> |
| 4 | <!-- --> |
| 5 | <!-- HTML header for doxygen 1.8.13--> |
| 6 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 7 | <html xmlns="http://www.w3.org/1999/xhtml"> |
| 8 | <head> |
| 9 | <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
| 10 | <meta http-equiv="X-UA-Compatible" content="IE=9"/> |
| 11 | <meta name="generator" content="Doxygen 1.8.13"/> |
| 12 | <meta name="robots" content="NOINDEX, NOFOLLOW" /> |
| 13 | <meta name="viewport" content="width=device-width, initial-scale=1"/> |
| 14 | <title>ArmNN: src/armnnQuantizer/ArmNNQuantizerMain.cpp File Reference</title> |
| 15 | <link href="tabs.css" rel="stylesheet" type="text/css"/> |
| 16 | <script type="text/javascript" src="jquery.js"></script> |
| 17 | <script type="text/javascript" src="dynsections.js"></script> |
| 18 | <link href="navtree.css" rel="stylesheet" type="text/css"/> |
| 19 | <script type="text/javascript" src="resize.js"></script> |
| 20 | <script type="text/javascript" src="navtreedata.js"></script> |
| 21 | <script type="text/javascript" src="navtree.js"></script> |
| 22 | <script type="text/javascript"> |
| 23 | $(document).ready(initResizable); |
| 24 | </script> |
| 25 | <link href="search/search.css" rel="stylesheet" type="text/css"/> |
| 26 | <script type="text/javascript" src="search/searchdata.js"></script> |
| 27 | <script type="text/javascript" src="search/search.js"></script> |
| 28 | <script type="text/x-mathjax-config"> |
| 29 | MathJax.Hub.Config({ |
| 30 | extensions: ["tex2jax.js"], |
| 31 | jax: ["input/TeX","output/HTML-CSS"], |
| 32 | }); |
| 33 | </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script> |
| 34 | <link href="doxygen.css" rel="stylesheet" type="text/css" /> |
| 35 | <link href="stylesheet.css" rel="stylesheet" type="text/css"/> |
| 36 | </head> |
| 37 | <body> |
| 38 | <div id="top"><!-- do not remove this div, it is closed by doxygen! --> |
| 39 | <div id="titlearea"> |
| 40 | <table cellspacing="0" cellpadding="0"> |
| 41 | <tbody> |
| 42 | <tr style="height: 56px;"> |
| 43 | <img alt="ArmNN" src="Arm_NN_horizontal_blue.png" style="max-width: 10rem; margin-top: .5rem; margin-left 10px"/> |
| 44 | <td style="padding-left: 0.5em;"> |
| 45 | <div id="projectname"> |
| 46 |  <span id="projectnumber">20.02</span> |
| 47 | </div> |
| 48 | </td> |
| 49 | </tr> |
| 50 | </tbody> |
| 51 | </table> |
| 52 | </div> |
| 53 | <!-- end header part --> |
| 54 | <!-- Generated by Doxygen 1.8.13 --> |
| 55 | <script type="text/javascript"> |
| 56 | var searchBox = new SearchBox("searchBox", "search",false,'Search'); |
| 57 | </script> |
| 58 | <script type="text/javascript" src="menudata.js"></script> |
| 59 | <script type="text/javascript" src="menu.js"></script> |
| 60 | <script type="text/javascript"> |
| 61 | $(function() { |
| 62 | initMenu('',true,false,'search.php','Search'); |
| 63 | $(document).ready(function() { init_search(); }); |
| 64 | }); |
| 65 | </script> |
| 66 | <div id="main-nav"></div> |
| 67 | </div><!-- top --> |
| 68 | <div id="side-nav" class="ui-resizable side-nav-resizable"> |
| 69 | <div id="nav-tree"> |
| 70 | <div id="nav-tree-contents"> |
| 71 | <div id="nav-sync" class="sync"></div> |
| 72 | </div> |
| 73 | </div> |
| 74 | <div id="splitbar" style="-moz-user-select:none;" |
| 75 | class="ui-resizable-handle"> |
| 76 | </div> |
| 77 | </div> |
| 78 | <script type="text/javascript"> |
| 79 | $(document).ready(function(){initNavTree('_arm_n_n_quantizer_main_8cpp.xhtml','');}); |
| 80 | </script> |
| 81 | <div id="doc-content"> |
| 82 | <!-- window showing the filter options --> |
| 83 | <div id="MSearchSelectWindow" |
| 84 | onmouseover="return searchBox.OnSearchSelectShow()" |
| 85 | onmouseout="return searchBox.OnSearchSelectHide()" |
| 86 | onkeydown="return searchBox.OnSearchSelectKey(event)"> |
| 87 | </div> |
| 88 | |
| 89 | <!-- iframe showing the search results (closed by default) --> |
| 90 | <div id="MSearchResultsWindow"> |
| 91 | <iframe src="javascript:void(0)" frameborder="0" |
| 92 | name="MSearchResults" id="MSearchResults"> |
| 93 | </iframe> |
| 94 | </div> |
| 95 | |
| 96 | <div class="header"> |
| 97 | <div class="summary"> |
| 98 | <a href="#func-members">Functions</a> </div> |
| 99 | <div class="headertitle"> |
| 100 | <div class="title">ArmNNQuantizerMain.cpp File Reference</div> </div> |
| 101 | </div><!--header--> |
| 102 | <div class="contents"> |
| 103 | <div class="textblock"><code>#include "<a class="el" href="src_2armnn_quantizer_2_command_line_processor_8hpp_source.xhtml">CommandLineProcessor.hpp</a>"</code><br /> |
| 104 | <code>#include <<a class="el" href="_i_deserializer_8hpp_source.xhtml">armnnDeserializer/IDeserializer.hpp</a>></code><br /> |
| 105 | <code>#include <<a class="el" href="_i_network_quantizer_8hpp_source.xhtml">armnnQuantizer/INetworkQuantizer.hpp</a>></code><br /> |
| 106 | <code>#include <<a class="el" href="_i_serializer_8hpp_source.xhtml">armnnSerializer/ISerializer.hpp</a>></code><br /> |
| 107 | <code>#include "<a class="el" href="_quantization_data_set_8hpp_source.xhtml">QuantizationDataSet.hpp</a>"</code><br /> |
| 108 | <code>#include "<a class="el" href="_quantization_input_8hpp_source.xhtml">QuantizationInput.hpp</a>"</code><br /> |
| 109 | <code>#include <algorithm></code><br /> |
| 110 | <code>#include <fstream></code><br /> |
| 111 | <code>#include <iostream></code><br /> |
| 112 | </div> |
| 113 | <p><a href="_arm_n_n_quantizer_main_8cpp_source.xhtml">Go to the source code of this file.</a></p> |
| 114 | <table class="memberdecls"> |
| 115 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> |
| 116 | Functions</h2></td></tr> |
| 117 | <tr class="memitem:a0ddf1224851353fc92bfbff6f499fa97"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="_arm_n_n_quantizer_main_8cpp.xhtml#a0ddf1224851353fc92bfbff6f499fa97">main</a> (int argc, char *argv[])</td></tr> |
| 118 | <tr class="separator:a0ddf1224851353fc92bfbff6f499fa97"><td class="memSeparator" colspan="2"> </td></tr> |
| 119 | </table> |
| 120 | <h2 class="groupheader">Function Documentation</h2> |
| 121 | <a id="a0ddf1224851353fc92bfbff6f499fa97"></a> |
| 122 | <h2 class="memtitle"><span class="permalink"><a href="#a0ddf1224851353fc92bfbff6f499fa97">◆ </a></span>main()</h2> |
| 123 | |
| 124 | <div class="memitem"> |
| 125 | <div class="memproto"> |
| 126 | <table class="memname"> |
| 127 | <tr> |
| 128 | <td class="memname">int main </td> |
| 129 | <td>(</td> |
| 130 | <td class="paramtype">int </td> |
| 131 | <td class="paramname"><em>argc</em>, </td> |
| 132 | </tr> |
| 133 | <tr> |
| 134 | <td class="paramkey"></td> |
| 135 | <td></td> |
| 136 | <td class="paramtype">char * </td> |
| 137 | <td class="paramname"><em>argv</em>[] </td> |
| 138 | </tr> |
| 139 | <tr> |
| 140 | <td></td> |
| 141 | <td>)</td> |
| 142 | <td></td><td></td> |
| 143 | </tr> |
| 144 | </table> |
| 145 | </div><div class="memdoc"> |
| 146 | |
| 147 | <p class="definition">Definition at line <a class="el" href="_arm_n_n_quantizer_main_8cpp_source.xhtml#l00017">17</a> of file <a class="el" href="_arm_n_n_quantizer_main_8cpp_source.xhtml">ArmNNQuantizerMain.cpp</a>.</p> |
| 148 | |
| 149 | <p class="reference">References <a class="el" href="_serializer_8cpp_source.xhtml#l01554">ISerializer::Create()</a>, <a class="el" href="_deserializer_8cpp_source.xhtml#l00661">IDeserializer::Create()</a>, <a class="el" href="_network_quantizer_8cpp_source.xhtml#l00040">INetworkQuantizer::Create()</a>, <a class="el" href="src_2armnn_quantizer_2_command_line_processor_8hpp_source.xhtml#l00030">CommandLineProcessor::GetInputFileName()</a>, <a class="el" href="src_2armnn_quantizer_2_command_line_processor_8hpp_source.xhtml#l00033">CommandLineProcessor::GetOutputDirectoryName()</a>, <a class="el" href="src_2armnn_quantizer_2_command_line_processor_8hpp_source.xhtml#l00034">CommandLineProcessor::GetOutputFileName()</a>, <a class="el" href="src_2armnn_quantizer_2_command_line_processor_8hpp_source.xhtml#l00036">CommandLineProcessor::GetQuantizationDataSet()</a>, <a class="el" href="src_2armnn_quantizer_2_command_line_processor_8hpp_source.xhtml#l00035">CommandLineProcessor::GetQuantizationScheme()</a>, <a class="el" href="_quantization_data_set_8cpp_source.xhtml#l00060">InputLayerVisitor::GetTensorInfo()</a>, <a class="el" href="src_2armnn_quantizer_2_command_line_processor_8hpp_source.xhtml#l00037">CommandLineProcessor::HasPreservedDataType()</a>, <a class="el" href="src_2armnn_quantizer_2_command_line_processor_8hpp_source.xhtml#l00038">CommandLineProcessor::HasQuantizationData()</a>, <a class="el" href="_quantization_data_set_8hpp_source.xhtml#l00029">QuantizationDataSet::IsEmpty()</a>, <a class="el" href="_i_network_quantizer_8hpp_source.xhtml#l00025">QuantizerOptions::m_ActivationFormat</a>, <a class="el" href="_i_network_quantizer_8hpp_source.xhtml#l00026">QuantizerOptions::m_PreserveType</a>, <a class="el" href="src_2armnn_quantizer_2_command_line_processor_8cpp_source.xhtml#l00087">CommandLineProcessor::ProcessCommandLine()</a>, <a class="el" href="namespacearmnn.xhtml#ad8ed01ff3ff33333d8e19db4d2818bb6a9d02ea768c081d4bdb2b7cab0b3f510d">armnn::QAsymmS8</a>, <a class="el" href="namespacearmnn.xhtml#ad8ed01ff3ff33333d8e19db4d2818bb6a0a3f57c876f5a230244c38e1453a8a6e">armnn::QAsymmU8</a>, and <a class="el" href="namespacearmnn.xhtml#ad8ed01ff3ff33333d8e19db4d2818bb6a053c769dcf82d66ef326c86980c02ba7">armnn::QSymmS16</a>.</p> |
| 150 | <div class="fragment"><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> {</div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>  <a class="code" href="classarmnn_quantizer_1_1_command_line_processor.xhtml">armnnQuantizer::CommandLineProcessor</a> cmdline;</div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>  <span class="keywordflow">if</span> (!cmdline.<a class="code" href="classarmnn_quantizer_1_1_command_line_processor.xhtml#a2f7e28f477647e992871d50e7b793221">ProcessCommandLine</a>(argc, argv))</div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>  {</div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>  <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>  }</div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>  <a class="code" href="namespacearmnn_deserializer.xhtml#ad33c6040680106b9af566d7269d8c949">armnnDeserializer::IDeserializerPtr</a> parser = <a class="code" href="classarmnn_deserializer_1_1_i_deserializer.xhtml#af116abd698a7feb92876ae48917005a4">armnnDeserializer::IDeserializer::Create</a>();</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>  std::ifstream inputFileStream(cmdline.<a class="code" href="classarmnn_quantizer_1_1_command_line_processor.xhtml#a71f5ab806743bf42f0556299af110015">GetInputFileName</a>(), std::ios::binary);</div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>  std::vector<std::uint8_t> binaryContent;</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>  <span class="keywordflow">while</span> (inputFileStream)</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  {</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>  <span class="keywordtype">char</span> c;</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  inputFileStream.get(c);</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  <span class="keywordflow">if</span> (inputFileStream)</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>  {</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  binaryContent.push_back(static_cast<std::uint8_t>(c));</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  }</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  }</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  inputFileStream.close();</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> </div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  <a class="code" href="structarmnn_1_1_quantizer_options.xhtml">armnn::QuantizerOptions</a> quantizerOptions;</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span> </div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  <span class="keywordflow">if</span> (cmdline.<a class="code" href="classarmnn_quantizer_1_1_command_line_processor.xhtml#a65f6aca5479ebf0814123ff8f1a528e3">GetQuantizationScheme</a>() == <span class="stringliteral">"QAsymmS8"</span>)</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  {</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  quantizerOptions.<a class="code" href="structarmnn_1_1_quantizer_options.xhtml#a64fb6dc5a9d3fe72b8f63364a10774a7">m_ActivationFormat</a> = <a class="code" href="namespacearmnn.xhtml#ad8ed01ff3ff33333d8e19db4d2818bb6a9d02ea768c081d4bdb2b7cab0b3f510d">armnn::DataType::QAsymmS8</a>;</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  }</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span> (cmdline.<a class="code" href="classarmnn_quantizer_1_1_command_line_processor.xhtml#a65f6aca5479ebf0814123ff8f1a528e3">GetQuantizationScheme</a>() == <span class="stringliteral">"QSymmS16"</span>)</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  {</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  quantizerOptions.<a class="code" href="structarmnn_1_1_quantizer_options.xhtml#a64fb6dc5a9d3fe72b8f63364a10774a7">m_ActivationFormat</a> = <a class="code" href="namespacearmnn.xhtml#ad8ed01ff3ff33333d8e19db4d2818bb6a053c769dcf82d66ef326c86980c02ba7">armnn::DataType::QSymmS16</a>;</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  }</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  <span class="keywordflow">else</span></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>  quantizerOptions.<a class="code" href="structarmnn_1_1_quantizer_options.xhtml#a64fb6dc5a9d3fe72b8f63364a10774a7">m_ActivationFormat</a> = <a class="code" href="namespacearmnn.xhtml#ad8ed01ff3ff33333d8e19db4d2818bb6a0a3f57c876f5a230244c38e1453a8a6e">armnn::DataType::QAsymmU8</a>;</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  }</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>  quantizerOptions.<a class="code" href="structarmnn_1_1_quantizer_options.xhtml#a5bc42c844726d5fe782741617a893f43">m_PreserveType</a> = cmdline.<a class="code" href="classarmnn_quantizer_1_1_command_line_processor.xhtml#af84a4d480d3705770b752645816f1cfb">HasPreservedDataType</a>();</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>  <a class="code" href="namespacearmnn.xhtml#ace74f6f9feb95a964a49d79458232703">armnn::INetworkPtr</a> network = parser->CreateNetworkFromBinary(binaryContent);</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  <a class="code" href="namespacearmnn.xhtml#a41119e261eec9343888d2ceab1e4999a">armnn::INetworkQuantizerPtr</a> quantizer = <a class="code" href="classarmnn_1_1_i_network_quantizer.xhtml#a3a4d01d9351c02a703740290f226441f">armnn::INetworkQuantizer::Create</a>(network.get(), quantizerOptions);</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span> </div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  <span class="keywordflow">if</span> (cmdline.<a class="code" href="classarmnn_quantizer_1_1_command_line_processor.xhtml#a1bb287242ae5ec2837a77f083c27a2ac">HasQuantizationData</a>())</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  {</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  <a class="code" href="classarmnn_quantizer_1_1_quantization_data_set.xhtml">armnnQuantizer::QuantizationDataSet</a> dataSet = cmdline.<a class="code" href="classarmnn_quantizer_1_1_command_line_processor.xhtml#ab15c4ff152f368723ed71c2bb5a89be9">GetQuantizationDataSet</a>();</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  <span class="keywordflow">if</span> (!dataSet.<a class="code" href="classarmnn_quantizer_1_1_quantization_data_set.xhtml#a8e12342fc420701fbffd97025421575a">IsEmpty</a>())</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  {</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  <span class="comment">// Get the Input Tensor Infos</span></div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  <a class="code" href="classarmnn_quantizer_1_1_input_layer_visitor.xhtml">armnnQuantizer::InputLayerVisitor</a> inputLayerVisitor;</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  network->Accept(inputLayerVisitor);</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span> </div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  <span class="keywordflow">for</span> (<a class="code" href="classarmnn_quantizer_1_1_quantization_input.xhtml">armnnQuantizer::QuantizationInput</a> quantizationInput : dataSet)</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  {</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  <a class="code" href="namespacearmnn.xhtml#aa01bce88f89975a5a031db4cc8861527">armnn::InputTensors</a> inputTensors;</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  std::vector<std::vector<float>> inputData(quantizationInput.GetNumberOfInputs());</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  std::vector<armnn::LayerBindingId> layerBindingIds = quantizationInput.GetLayerBindingIds();</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> count = 0;</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  <span class="keywordflow">for</span> (<a class="code" href="namespacearmnn.xhtml#ab8cf8f9fb6792e654c2d8d8382f6f01b">armnn::LayerBindingId</a> layerBindingId : quantizationInput.GetLayerBindingIds())</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  {</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  <a class="code" href="classarmnn_1_1_tensor_info.xhtml">armnn::TensorInfo</a> tensorInfo = inputLayerVisitor.<a class="code" href="classarmnn_quantizer_1_1_input_layer_visitor.xhtml#a92c60f374eb3e8a6cdbce39cb57c1db4">GetTensorInfo</a>(layerBindingId);</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  inputData[count] = quantizationInput.GetDataForEntry(layerBindingId);</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  <a class="code" href="classarmnn_1_1_const_tensor.xhtml">armnn::ConstTensor</a> inputTensor(tensorInfo, inputData[count].data());</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  inputTensors.push_back(std::make_pair(layerBindingId, inputTensor));</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  count++;</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  }</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  quantizer->Refine(inputTensors);</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>  }</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  }</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>  <a class="code" href="namespacearmnn.xhtml#ace74f6f9feb95a964a49d79458232703">armnn::INetworkPtr</a> quantizedNetwork = quantizer->ExportNetwork();</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  <a class="code" href="namespacearmnn_serializer.xhtml#a550a83250b3ddebf15d5c13c224e3609">armnnSerializer::ISerializerPtr</a> <a class="code" href="namespacearmnn_serializer.xhtml">serializer</a> = <a class="code" href="classarmnn_serializer_1_1_i_serializer.xhtml#a3c51b5b078572dee02528bfae7202524">armnnSerializer::ISerializer::Create</a>();</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  serializer->Serialize(*quantizedNetwork);</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span> </div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  std::string output(cmdline.<a class="code" href="classarmnn_quantizer_1_1_command_line_processor.xhtml#a4358b78a2efe952366bc32b0d54e663e">GetOutputDirectoryName</a>());</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  output.append(cmdline.<a class="code" href="classarmnn_quantizer_1_1_command_line_processor.xhtml#a98ba4e2ee687673cbf7546788c8ea099">GetOutputFileName</a>());</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  std::ofstream outputFileStream;</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  outputFileStream.open(output);</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  serializer->SaveSerializedToStream(outputFileStream);</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  outputFileStream.flush();</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  outputFileStream.close();</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>  <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span> }</div><div class="ttc" id="classarmnn_quantizer_1_1_command_line_processor_xhtml_a1bb287242ae5ec2837a77f083c27a2ac"><div class="ttname"><a href="classarmnn_quantizer_1_1_command_line_processor.xhtml#a1bb287242ae5ec2837a77f083c27a2ac">armnnQuantizer::CommandLineProcessor::HasQuantizationData</a></div><div class="ttdeci">bool HasQuantizationData()</div><div class="ttdef"><b>Definition:</b> <a href="src_2armnn_quantizer_2_command_line_processor_8hpp_source.xhtml#l00038">CommandLineProcessor.hpp:38</a></div></div> |
| 151 | <div class="ttc" id="classarmnn_quantizer_1_1_command_line_processor_xhtml_a98ba4e2ee687673cbf7546788c8ea099"><div class="ttname"><a href="classarmnn_quantizer_1_1_command_line_processor.xhtml#a98ba4e2ee687673cbf7546788c8ea099">armnnQuantizer::CommandLineProcessor::GetOutputFileName</a></div><div class="ttdeci">std::string GetOutputFileName()</div><div class="ttdef"><b>Definition:</b> <a href="src_2armnn_quantizer_2_command_line_processor_8hpp_source.xhtml#l00034">CommandLineProcessor.hpp:34</a></div></div> |
| 152 | <div class="ttc" id="structarmnn_1_1_quantizer_options_xhtml_a64fb6dc5a9d3fe72b8f63364a10774a7"><div class="ttname"><a href="structarmnn_1_1_quantizer_options.xhtml#a64fb6dc5a9d3fe72b8f63364a10774a7">armnn::QuantizerOptions::m_ActivationFormat</a></div><div class="ttdeci">DataType m_ActivationFormat</div><div class="ttdef"><b>Definition:</b> <a href="_i_network_quantizer_8hpp_source.xhtml#l00025">INetworkQuantizer.hpp:25</a></div></div> |
| 153 | <div class="ttc" id="namespacearmnn_serializer_xhtml"><div class="ttname"><a href="namespacearmnn_serializer.xhtml">armnnSerializer</a></div><div class="ttdef"><b>Definition:</b> <a href="_i_serializer_8hpp_source.xhtml#l00011">ISerializer.hpp:11</a></div></div> |
| 154 | <div class="ttc" id="classarmnn_quantizer_1_1_quantization_data_set_xhtml"><div class="ttname"><a href="classarmnn_quantizer_1_1_quantization_data_set.xhtml">armnnQuantizer::QuantizationDataSet</a></div><div class="ttdoc">QuantizationDataSet is a structure which is created after parsing a quantization CSV file...</div><div class="ttdef"><b>Definition:</b> <a href="_quantization_data_set_8hpp_source.xhtml#l00018">QuantizationDataSet.hpp:18</a></div></div> |
| 155 | <div class="ttc" id="classarmnn_1_1_tensor_info_xhtml"><div class="ttname"><a href="classarmnn_1_1_tensor_info.xhtml">armnn::TensorInfo</a></div><div class="ttdef"><b>Definition:</b> <a href="_tensor_8hpp_source.xhtml#l00053">Tensor.hpp:53</a></div></div> |
| 156 | <div class="ttc" id="classarmnn_quantizer_1_1_quantization_data_set_xhtml_a8e12342fc420701fbffd97025421575a"><div class="ttname"><a href="classarmnn_quantizer_1_1_quantization_data_set.xhtml#a8e12342fc420701fbffd97025421575a">armnnQuantizer::QuantizationDataSet::IsEmpty</a></div><div class="ttdeci">bool IsEmpty() const</div><div class="ttdef"><b>Definition:</b> <a href="_quantization_data_set_8hpp_source.xhtml#l00029">QuantizationDataSet.hpp:29</a></div></div> |
| 157 | <div class="ttc" id="classarmnn_quantizer_1_1_command_line_processor_xhtml_a2f7e28f477647e992871d50e7b793221"><div class="ttname"><a href="classarmnn_quantizer_1_1_command_line_processor.xhtml#a2f7e28f477647e992871d50e7b793221">armnnQuantizer::CommandLineProcessor::ProcessCommandLine</a></div><div class="ttdeci">bool ProcessCommandLine(int argc, char *argv[])</div><div class="ttdef"><b>Definition:</b> <a href="src_2armnn_quantizer_2_command_line_processor_8cpp_source.xhtml#l00087">CommandLineProcessor.cpp:87</a></div></div> |
| 158 | <div class="ttc" id="namespacearmnn_xhtml_a41119e261eec9343888d2ceab1e4999a"><div class="ttname"><a href="namespacearmnn.xhtml#a41119e261eec9343888d2ceab1e4999a">armnn::INetworkQuantizerPtr</a></div><div class="ttdeci">std::unique_ptr< class INetworkQuantizer, void(*)(INetworkQuantizer *quantizer)> INetworkQuantizerPtr</div><div class="ttdef"><b>Definition:</b> <a href="_i_network_quantizer_8hpp_source.xhtml#l00029">INetworkQuantizer.hpp:29</a></div></div> |
| 159 | <div class="ttc" id="classarmnn_deserializer_1_1_i_deserializer_xhtml_af116abd698a7feb92876ae48917005a4"><div class="ttname"><a href="classarmnn_deserializer_1_1_i_deserializer.xhtml#af116abd698a7feb92876ae48917005a4">armnnDeserializer::IDeserializer::Create</a></div><div class="ttdeci">static IDeserializerPtr Create()</div><div class="ttdef"><b>Definition:</b> <a href="_deserializer_8cpp_source.xhtml#l00661">Deserializer.cpp:661</a></div></div> |
| 160 | <div class="ttc" id="namespacearmnn_xhtml_ad8ed01ff3ff33333d8e19db4d2818bb6a9d02ea768c081d4bdb2b7cab0b3f510d"><div class="ttname"><a href="namespacearmnn.xhtml#ad8ed01ff3ff33333d8e19db4d2818bb6a9d02ea768c081d4bdb2b7cab0b3f510d">armnn::DataType::QAsymmS8</a></div></div> |
| 161 | <div class="ttc" id="namespacearmnn_xhtml_aa01bce88f89975a5a031db4cc8861527"><div class="ttname"><a href="namespacearmnn.xhtml#aa01bce88f89975a5a031db4cc8861527">armnn::InputTensors</a></div><div class="ttdeci">std::vector< std::pair< LayerBindingId, class ConstTensor > > InputTensors</div><div class="ttdef"><b>Definition:</b> <a href="_tensor_8hpp_source.xhtml#l00225">Tensor.hpp:225</a></div></div> |
| 162 | <div class="ttc" id="namespacearmnn_xhtml_ad8ed01ff3ff33333d8e19db4d2818bb6a053c769dcf82d66ef326c86980c02ba7"><div class="ttname"><a href="namespacearmnn.xhtml#ad8ed01ff3ff33333d8e19db4d2818bb6a053c769dcf82d66ef326c86980c02ba7">armnn::DataType::QSymmS16</a></div></div> |
| 163 | <div class="ttc" id="classarmnn_quantizer_1_1_quantization_input_xhtml"><div class="ttname"><a href="classarmnn_quantizer_1_1_quantization_input.xhtml">armnnQuantizer::QuantizationInput</a></div><div class="ttdoc">QuantizationInput for specific pass ID, can list a corresponding raw data file for each LayerBindingI...</div><div class="ttdef"><b>Definition:</b> <a href="_quantization_input_8hpp_source.xhtml#l00016">QuantizationInput.hpp:16</a></div></div> |
| 164 | <div class="ttc" id="structarmnn_1_1_quantizer_options_xhtml"><div class="ttname"><a href="structarmnn_1_1_quantizer_options.xhtml">armnn::QuantizerOptions</a></div><div class="ttdef"><b>Definition:</b> <a href="_i_network_quantizer_8hpp_source.xhtml#l00015">INetworkQuantizer.hpp:15</a></div></div> |
| 165 | <div class="ttc" id="classarmnn_quantizer_1_1_input_layer_visitor_xhtml"><div class="ttname"><a href="classarmnn_quantizer_1_1_input_layer_visitor.xhtml">armnnQuantizer::InputLayerVisitor</a></div><div class="ttdoc">Visitor class implementation to gather the TensorInfo for LayerBindingID for creation of ConstTensor ...</div><div class="ttdef"><b>Definition:</b> <a href="_quantization_data_set_8hpp_source.xhtml#l00046">QuantizationDataSet.hpp:46</a></div></div> |
| 166 | <div class="ttc" id="namespacearmnn_xhtml_ab8cf8f9fb6792e654c2d8d8382f6f01b"><div class="ttname"><a href="namespacearmnn.xhtml#ab8cf8f9fb6792e654c2d8d8382f6f01b">armnn::LayerBindingId</a></div><div class="ttdeci">int LayerBindingId</div><div class="ttdoc">Type of identifiers for bindable layers (inputs, outputs). </div><div class="ttdef"><b>Definition:</b> <a href="_types_8hpp_source.xhtml#l00171">Types.hpp:171</a></div></div> |
| 167 | <div class="ttc" id="classarmnn_quantizer_1_1_input_layer_visitor_xhtml_a92c60f374eb3e8a6cdbce39cb57c1db4"><div class="ttname"><a href="classarmnn_quantizer_1_1_input_layer_visitor.xhtml#a92c60f374eb3e8a6cdbce39cb57c1db4">armnnQuantizer::InputLayerVisitor::GetTensorInfo</a></div><div class="ttdeci">armnn::TensorInfo GetTensorInfo(armnn::LayerBindingId)</div><div class="ttdef"><b>Definition:</b> <a href="_quantization_data_set_8cpp_source.xhtml#l00060">QuantizationDataSet.cpp:60</a></div></div> |
| 168 | <div class="ttc" id="classarmnn_quantizer_1_1_command_line_processor_xhtml_af84a4d480d3705770b752645816f1cfb"><div class="ttname"><a href="classarmnn_quantizer_1_1_command_line_processor.xhtml#af84a4d480d3705770b752645816f1cfb">armnnQuantizer::CommandLineProcessor::HasPreservedDataType</a></div><div class="ttdeci">bool HasPreservedDataType()</div><div class="ttdef"><b>Definition:</b> <a href="src_2armnn_quantizer_2_command_line_processor_8hpp_source.xhtml#l00037">CommandLineProcessor.hpp:37</a></div></div> |
| 169 | <div class="ttc" id="namespacearmnn_xhtml_ad8ed01ff3ff33333d8e19db4d2818bb6a0a3f57c876f5a230244c38e1453a8a6e"><div class="ttname"><a href="namespacearmnn.xhtml#ad8ed01ff3ff33333d8e19db4d2818bb6a0a3f57c876f5a230244c38e1453a8a6e">armnn::DataType::QAsymmU8</a></div></div> |
| 170 | <div class="ttc" id="classarmnn_1_1_const_tensor_xhtml"><div class="ttname"><a href="classarmnn_1_1_const_tensor.xhtml">armnn::ConstTensor</a></div><div class="ttdoc">A tensor defined by a TensorInfo (shape and data type) and an immutable backing store. </div><div class="ttdef"><b>Definition:</b> <a href="_tensor_8hpp_source.xhtml#l00199">Tensor.hpp:199</a></div></div> |
| 171 | <div class="ttc" id="classarmnn_quantizer_1_1_command_line_processor_xhtml_a65f6aca5479ebf0814123ff8f1a528e3"><div class="ttname"><a href="classarmnn_quantizer_1_1_command_line_processor.xhtml#a65f6aca5479ebf0814123ff8f1a528e3">armnnQuantizer::CommandLineProcessor::GetQuantizationScheme</a></div><div class="ttdeci">std::string GetQuantizationScheme()</div><div class="ttdef"><b>Definition:</b> <a href="src_2armnn_quantizer_2_command_line_processor_8hpp_source.xhtml#l00035">CommandLineProcessor.hpp:35</a></div></div> |
| 172 | <div class="ttc" id="namespacearmnn_deserializer_xhtml_ad33c6040680106b9af566d7269d8c949"><div class="ttname"><a href="namespacearmnn_deserializer.xhtml#ad33c6040680106b9af566d7269d8c949">armnnDeserializer::IDeserializerPtr</a></div><div class="ttdeci">std::unique_ptr< IDeserializer, void(*)(IDeserializer *parser)> IDeserializerPtr</div><div class="ttdef"><b>Definition:</b> <a href="_i_deserializer_8hpp_source.xhtml#l00025">IDeserializer.hpp:25</a></div></div> |
| 173 | <div class="ttc" id="structarmnn_1_1_quantizer_options_xhtml_a5bc42c844726d5fe782741617a893f43"><div class="ttname"><a href="structarmnn_1_1_quantizer_options.xhtml#a5bc42c844726d5fe782741617a893f43">armnn::QuantizerOptions::m_PreserveType</a></div><div class="ttdeci">bool m_PreserveType</div><div class="ttdef"><b>Definition:</b> <a href="_i_network_quantizer_8hpp_source.xhtml#l00026">INetworkQuantizer.hpp:26</a></div></div> |
| 174 | <div class="ttc" id="classarmnn_quantizer_1_1_command_line_processor_xhtml_a71f5ab806743bf42f0556299af110015"><div class="ttname"><a href="classarmnn_quantizer_1_1_command_line_processor.xhtml#a71f5ab806743bf42f0556299af110015">armnnQuantizer::CommandLineProcessor::GetInputFileName</a></div><div class="ttdeci">std::string GetInputFileName()</div><div class="ttdef"><b>Definition:</b> <a href="src_2armnn_quantizer_2_command_line_processor_8hpp_source.xhtml#l00030">CommandLineProcessor.hpp:30</a></div></div> |
| 175 | <div class="ttc" id="namespacearmnn_serializer_xhtml_a550a83250b3ddebf15d5c13c224e3609"><div class="ttname"><a href="namespacearmnn_serializer.xhtml#a550a83250b3ddebf15d5c13c224e3609">armnnSerializer::ISerializerPtr</a></div><div class="ttdeci">std::unique_ptr< ISerializer, void(*)(ISerializer *serializer)> ISerializerPtr</div><div class="ttdef"><b>Definition:</b> <a href="_i_serializer_8hpp_source.xhtml#l00015">ISerializer.hpp:15</a></div></div> |
| 176 | <div class="ttc" id="classarmnn_quantizer_1_1_command_line_processor_xhtml_a4358b78a2efe952366bc32b0d54e663e"><div class="ttname"><a href="classarmnn_quantizer_1_1_command_line_processor.xhtml#a4358b78a2efe952366bc32b0d54e663e">armnnQuantizer::CommandLineProcessor::GetOutputDirectoryName</a></div><div class="ttdeci">std::string GetOutputDirectoryName()</div><div class="ttdef"><b>Definition:</b> <a href="src_2armnn_quantizer_2_command_line_processor_8hpp_source.xhtml#l00033">CommandLineProcessor.hpp:33</a></div></div> |
| 177 | <div class="ttc" id="classarmnn_quantizer_1_1_command_line_processor_xhtml_ab15c4ff152f368723ed71c2bb5a89be9"><div class="ttname"><a href="classarmnn_quantizer_1_1_command_line_processor.xhtml#ab15c4ff152f368723ed71c2bb5a89be9">armnnQuantizer::CommandLineProcessor::GetQuantizationDataSet</a></div><div class="ttdeci">QuantizationDataSet GetQuantizationDataSet()</div><div class="ttdef"><b>Definition:</b> <a href="src_2armnn_quantizer_2_command_line_processor_8hpp_source.xhtml#l00036">CommandLineProcessor.hpp:36</a></div></div> |
| 178 | <div class="ttc" id="classarmnn_serializer_1_1_i_serializer_xhtml_a3c51b5b078572dee02528bfae7202524"><div class="ttname"><a href="classarmnn_serializer_1_1_i_serializer.xhtml#a3c51b5b078572dee02528bfae7202524">armnnSerializer::ISerializer::Create</a></div><div class="ttdeci">static ISerializerPtr Create()</div><div class="ttdef"><b>Definition:</b> <a href="_serializer_8cpp_source.xhtml#l01554">Serializer.cpp:1554</a></div></div> |
| 179 | <div class="ttc" id="namespacearmnn_xhtml_ace74f6f9feb95a964a49d79458232703"><div class="ttname"><a href="namespacearmnn.xhtml#ace74f6f9feb95a964a49d79458232703">armnn::INetworkPtr</a></div><div class="ttdeci">std::unique_ptr< INetwork, void(*)(INetwork *network)> INetworkPtr</div><div class="ttdef"><b>Definition:</b> <a href="_i_network_8hpp_source.xhtml#l00101">INetwork.hpp:101</a></div></div> |
| 180 | <div class="ttc" id="classarmnn_1_1_i_network_quantizer_xhtml_a3a4d01d9351c02a703740290f226441f"><div class="ttname"><a href="classarmnn_1_1_i_network_quantizer.xhtml#a3a4d01d9351c02a703740290f226441f">armnn::INetworkQuantizer::Create</a></div><div class="ttdeci">static INetworkQuantizerPtr Create(INetwork *inputNetwork, const QuantizerOptions &options=QuantizerOptions())</div><div class="ttdoc">Create Quantizer object wrapped in unique_ptr. </div><div class="ttdef"><b>Definition:</b> <a href="_network_quantizer_8cpp_source.xhtml#l00040">NetworkQuantizer.cpp:40</a></div></div> |
| 181 | <div class="ttc" id="classarmnn_quantizer_1_1_command_line_processor_xhtml"><div class="ttname"><a href="classarmnn_quantizer_1_1_command_line_processor.xhtml">armnnQuantizer::CommandLineProcessor</a></div><div class="ttdef"><b>Definition:</b> <a href="src_2armnn_quantizer_2_command_line_processor_8hpp_source.xhtml#l00025">CommandLineProcessor.hpp:25</a></div></div> |
| 182 | </div><!-- fragment --> |
| 183 | </div> |
| 184 | </div> |
| 185 | </div><!-- contents --> |
| 186 | </div><!-- doc-content --> |
| 187 | <!-- start footer part --> |
| 188 | <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> |
| 189 | <ul> |
| 190 | <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.xhtml">src</a></li><li class="navelem"><a class="el" href="dir_0de8a5774692585e465aba8075a97653.xhtml">armnnQuantizer</a></li><li class="navelem"><a class="el" href="_arm_n_n_quantizer_main_8cpp.xhtml">ArmNNQuantizerMain.cpp</a></li> |
| 191 | <li class="footer">Generated on Fri Mar 13 2020 16:09:14 for ArmNN by |
| 192 | <a href="http://www.doxygen.org/index.html"> |
| 193 | <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li> |
| 194 | </ul> |
| 195 | </div> |
| 196 | </body> |
| 197 | </html> |