aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/QuantizerVisitor.hpp
diff options
context:
space:
mode:
authorFrancis Murtagh <francis.murtagh@arm.com>2019-06-07 11:28:49 +0100
committerFrancis Murtagh <francis.murtagh@arm.com>2019-06-07 12:23:15 +0000
commitedf5230830f8d9794ef0aeb8986da99734ff925f (patch)
treee2f35f3088e594fdde2361af4b73fb23485f3702 /src/armnn/QuantizerVisitor.hpp
parent49ab7ada17a354caa5b6263c3a732e55d9cd2743 (diff)
downloadarmnn-edf5230830f8d9794ef0aeb8986da99734ff925f.tar.gz
IVGCVSW-3228 Fix bias quantization to be INT32 not QAsymm8
* Add function to calculate bias tensor quantization scale from input and weights scales. * Change visitor method of Conv2d, DepthwiseConv and FullyConnected to use the new function. * Fix Unit tests to expect correctly calculated quantization parameters. Change-Id: Ic36f47ceea81243c813d74ccf791e984c819cc71 Signed-off-by: Francis Murtagh <francis.murtagh@arm.com>
Diffstat (limited to 'src/armnn/QuantizerVisitor.hpp')
-rw-r--r--src/armnn/QuantizerVisitor.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/armnn/QuantizerVisitor.hpp b/src/armnn/QuantizerVisitor.hpp
index 6e5609df02..6463350f2b 100644
--- a/src/armnn/QuantizerVisitor.hpp
+++ b/src/armnn/QuantizerVisitor.hpp
@@ -139,6 +139,12 @@ private:
/// Record the guids so we can easily find the layers later
void RecordLayer(const IConnectableLayer* srcLayer, IConnectableLayer* qLayer);
+ /// Sets the bias quantization scale based on input and weight scales
+ ConstTensor CreateQuantizedBias(const IConnectableLayer* srcLayer,
+ const ConstTensor& weights,
+ const Optional<ConstTensor>& biases,
+ std::vector<int32_t>& weightsBacking);
+
/// Reference to the static range visitor used to retrieve the quantization ranges
const RangeTracker& m_Ranges;