IVGCVSW-3061 Modify NetworkQuantizer to support option to preserve input/output types
* Also add unit tests for new preserve type option
Signed-off-by: Nattapat Chaimanowong <nattapat.chaimanowong@arm.com>
Change-Id: I860759072f2e3546698118d1bcd5e79eb4e805ec
diff --git a/include/armnnQuantizer/INetworkQuantizer.hpp b/include/armnnQuantizer/INetworkQuantizer.hpp
index 89548d1..826b077 100644
--- a/include/armnnQuantizer/INetworkQuantizer.hpp
+++ b/include/armnnQuantizer/INetworkQuantizer.hpp
@@ -14,10 +14,16 @@
struct QuantizerOptions
{
- QuantizerOptions() : m_ActivationFormat(DataType::QuantisedAsymm8) {}
- QuantizerOptions(DataType activationFormat) : m_ActivationFormat(activationFormat) {}
+ QuantizerOptions() : QuantizerOptions(DataType::QuantisedAsymm8, false) {}
+
+ QuantizerOptions(DataType activationFormat) : QuantizerOptions(activationFormat, false) {}
+
+ QuantizerOptions(DataType activationFormat, bool preserveType)
+ : m_ActivationFormat(activationFormat)
+ , m_PreserveType(preserveType) {}
DataType m_ActivationFormat;
+ bool m_PreserveType;
};
using INetworkQuantizerPtr = std::unique_ptr<class INetworkQuantizer, void(*)(INetworkQuantizer* quantizer)>;