aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉanna Ó Catháin <eanna.ocathain@arm.com>2019-05-10 13:29:13 +0100
committerMatteo Martincigh <matteo.martincigh@arm.com>2019-05-10 14:29:36 +0000
commit5696bff29143667ffd69856e4939cecfbcbd03b3 (patch)
tree77e51754e25b83747b7b8d1dd43a050bdd79bccc
parent5200afa2742ad9cd1cda7fbce8604794c0616818 (diff)
downloadarmnn-5696bff29143667ffd69856e4939cecfbcbd03b3.tar.gz
IVGCVSW-3063 Modify Quantizer tool to take command line input
for preserving input/output types Change-Id: Ib30f1e2e58407526cd881fec33f45fc4e4ed4afe Signed-off-by: Éanna Ó Catháin <eanna.ocathain@arm.com>
-rw-r--r--src/armnnQuantizer/ArmNNQuantizerMain.cpp2
-rw-r--r--src/armnnQuantizer/CommandLineProcessor.cpp2
-rw-r--r--src/armnnQuantizer/CommandLineProcessor.hpp2
3 files changed, 6 insertions, 0 deletions
diff --git a/src/armnnQuantizer/ArmNNQuantizerMain.cpp b/src/armnnQuantizer/ArmNNQuantizerMain.cpp
index 96d6515ba0..227a105bba 100644
--- a/src/armnnQuantizer/ArmNNQuantizerMain.cpp
+++ b/src/armnnQuantizer/ArmNNQuantizerMain.cpp
@@ -40,6 +40,8 @@ int main(int argc, char* argv[])
? armnn::DataType::QuantisedSymm16
: armnn::DataType::QuantisedAsymm8;
+ quantizerOptions.m_PreserveType = cmdline.HasPreservedDataType();
+
armnn::INetworkPtr network = parser->CreateNetworkFromBinary(binaryContent);
armnn::INetworkQuantizerPtr quantizer = armnn::INetworkQuantizer::Create(network.get(), quantizerOptions);
diff --git a/src/armnnQuantizer/CommandLineProcessor.cpp b/src/armnnQuantizer/CommandLineProcessor.cpp
index 4f0d989d3f..758726e72a 100644
--- a/src/armnnQuantizer/CommandLineProcessor.cpp
+++ b/src/armnnQuantizer/CommandLineProcessor.cpp
@@ -97,6 +97,8 @@ bool CommandLineProcessor::ProcessCommandLine(int argc, char* argv[])
"Quantization scheme, \"QAsymm8\" or \"QSymm16\", default value QAsymm8")
("csvfile,c", po::value<std::string>(&m_CsvFileName)->default_value(""),
"CSV file containing paths for RAW input tensors")
+ ("preserve-data-type,p", po::bool_switch(&m_PreserveDataType)->default_value(false),
+ "Preserve the input and output data types")
("outdir,d", po::value<std::string>(&m_OutputDirectory)->required(),
"Directory that output file will be written to")
("outfile,o", po::value<std::string>(&m_OutputFileName)->required(), "Output file name");
diff --git a/src/armnnQuantizer/CommandLineProcessor.hpp b/src/armnnQuantizer/CommandLineProcessor.hpp
index ae39abb603..9de03fb327 100644
--- a/src/armnnQuantizer/CommandLineProcessor.hpp
+++ b/src/armnnQuantizer/CommandLineProcessor.hpp
@@ -34,6 +34,7 @@ public:
std::string GetOutputFileName() {return m_OutputFileName;}
std::string GetQuantizationScheme() {return m_QuantizationScheme;}
QuantizationDataSet GetQuantizationDataSet() {return m_QuantizationDataSet;}
+ bool HasPreservedDataType() {return m_PreserveDataType;}
bool HasQuantizationData() {return !m_QuantizationDataSet.IsEmpty();}
protected:
@@ -44,6 +45,7 @@ protected:
std::string m_OutputFileName;
std::string m_QuantizationScheme;
QuantizationDataSet m_QuantizationDataSet;
+ bool m_PreserveDataType;
};
} // namespace armnnQuantizer