From 94d3b931eddd1f75fccb2ec111e6499cb9ccdeeb Mon Sep 17 00:00:00 2001 From: Aron Virginas-Tar Date: Mon, 11 Nov 2019 12:54:47 +0000 Subject: IVGCVSW-3839 Add support of per-axis quantization to reference TransposeConvolution2d Signed-off-by: Aron Virginas-Tar Change-Id: Ie0dc1204eee925adfb1e59aba3f1137178302184 --- src/backends/reference/RefLayerSupport.cpp | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'src/backends/reference/RefLayerSupport.cpp') 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 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()) { -- cgit v1.2.1