diff options
Diffstat (limited to 'src/backends/reference/RefLayerSupport.cpp')
-rw-r--r-- | src/backends/reference/RefLayerSupport.cpp | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/backends/reference/RefLayerSupport.cpp b/src/backends/reference/RefLayerSupport.cpp index 4d164d58a2..d2cf6f904a 100644 --- a/src/backends/reference/RefLayerSupport.cpp +++ b/src/backends/reference/RefLayerSupport.cpp @@ -392,10 +392,27 @@ bool RefLayerSupport::IsDequantizeSupported(const TensorInfo& input, const TensorInfo& output, Optional<std::string&> reasonIfUnsupported) const { - return IsSupportedForDataTypeRef(reasonIfUnsupported, - input.GetDataType(), - &FalseFunc<>, - &TrueFunc<>); + bool supported = true; + + std::array<DataType,2> supportedInputTypes = { + DataType::QuantisedAsymm8, + DataType::QuantisedSymm16 + }; + + supported &= CheckSupportRule(TypeAnyOf(input, supportedInputTypes), reasonIfUnsupported, + "Reference dequantize: input type not supported."); + + std::array<DataType,2> supportedOutputTypes = { + DataType::Float32, + }; + + supported &= CheckSupportRule(TypeAnyOf(output, supportedOutputTypes), reasonIfUnsupported, + "Reference dequantize: output type not supported."); + + supported &= CheckSupportRule(ShapesAreSameTotalSize(input, output), reasonIfUnsupported, + "Reference dequantize: input and output shapes have different num total elements."); + + return supported; } bool RefLayerSupport::IsDetectionPostProcessSupported(const armnn::TensorInfo& input0, |