aboutsummaryrefslogtreecommitdiff
path: root/src/backends/reference/RefLayerSupport.cpp
diff options
context:
space:
mode:
authorAron Virginas-Tar <Aron.Virginas-Tar@arm.com>2019-11-11 12:54:47 +0000
committerTeresaARM <teresa.charlinreyes@arm.com>2019-11-12 09:16:17 +0000
commit94d3b931eddd1f75fccb2ec111e6499cb9ccdeeb (patch)
tree3ebe2e73be1d93cb98e3189ad57a78783f96de1f /src/backends/reference/RefLayerSupport.cpp
parent62cdb08ed5d006b8f130d73665211d35e71f6cf3 (diff)
downloadarmnn-94d3b931eddd1f75fccb2ec111e6499cb9ccdeeb.tar.gz
IVGCVSW-3839 Add support of per-axis quantization to reference TransposeConvolution2d
Signed-off-by: Aron Virginas-Tar <Aron.Virginas-Tar@arm.com> Change-Id: Ie0dc1204eee925adfb1e59aba3f1137178302184
Diffstat (limited to 'src/backends/reference/RefLayerSupport.cpp')
-rw-r--r--src/backends/reference/RefLayerSupport.cpp27
1 files changed, 22 insertions, 5 deletions
diff --git a/src/backends/reference/RefLayerSupport.cpp b/src/backends/reference/RefLayerSupport.cpp
index 4252fecf35..e98af7097b 100644
--- a/src/backends/reference/RefLayerSupport.cpp
+++ b/src/backends/reference/RefLayerSupport.cpp
@@ -1802,14 +1802,31 @@ bool RefLayerSupport::IsTransposeConvolution2dSupported(const TensorInfo& input,
supported &= CheckSupportRule(TypeAnyOf(output, supportedTypes), reasonIfUnsupported,
"Reference TransposeConvolution2d: output is not a supported type.");
- supported &= CheckSupportRule(TypeAnyOf(weights, supportedTypes), reasonIfUnsupported,
- "Reference TransposeConvolution2d: weights is not a supported type.");
-
supported &= CheckSupportRule(TypesAreEqual(input, output), reasonIfUnsupported,
"Reference TransposeConvolution2d: input and output types mismatched.");
- supported &= CheckSupportRule(TypesAreEqual(input, weights), reasonIfUnsupported,
- "Reference TransposeConvolution2d: input and weights types mismatched.");
+
+ const DataType inputType = input.GetDataType();
+ if (inputType == DataType::QuantisedAsymm8)
+ {
+ std::array<DataType, 2> supportedWeightTypes =
+ {
+ DataType::QuantisedAsymm8,
+ DataType::QuantizedSymm8PerAxis
+ };
+
+ supported &= CheckSupportRule(TypeAnyOf(weights, supportedWeightTypes), reasonIfUnsupported,
+ "Reference TransposeConvolution2d: weights type not supported for "
+ "quantized input.");
+ }
+ else
+ {
+ supported &= CheckSupportRule(TypeAnyOf(weights, supportedTypes), reasonIfUnsupported,
+ "Reference TransposeConvolution2d: weights is not a supported type.");
+
+ supported &= CheckSupportRule(TypesAreEqual(input, weights), reasonIfUnsupported,
+ "Reference TransposeConvolution2d: input and weights types mismatched.");
+ }
if (biases.has_value())
{