diff options
author | nikraj01 <nikhil.raj@arm.com> | 2019-06-14 09:40:34 +0100 |
---|---|---|
committer | nikraj01 <nikhil.raj@arm.com> | 2019-06-14 09:40:34 +0100 |
commit | 0421e7f22d9ccd5d810b345731b766a96c841492 (patch) | |
tree | 395a4a57125652be45925c16d65d8dc725cd125d /src/backends/reference/RefLayerSupport.cpp | |
parent | c4223d135b1637ba05141d5375a22a182a03d4b3 (diff) | |
download | armnn-0421e7f22d9ccd5d810b345731b766a96c841492.tar.gz |
IVGCVSW-3224 Add Uint8 support for Rsqrt
Change-Id: I45598fc9b6d408b19d8d050e64c12b1d48535fa3
Signed-off-by: nikraj01 <nikhil.raj@arm.com>
Diffstat (limited to 'src/backends/reference/RefLayerSupport.cpp')
-rw-r--r-- | src/backends/reference/RefLayerSupport.cpp | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/src/backends/reference/RefLayerSupport.cpp b/src/backends/reference/RefLayerSupport.cpp index f2ab9edca7..b508dfd29d 100644 --- a/src/backends/reference/RefLayerSupport.cpp +++ b/src/backends/reference/RefLayerSupport.cpp @@ -1116,11 +1116,26 @@ bool RefLayerSupport::IsRsqrtSupported(const TensorInfo& input, const TensorInfo& output, Optional<std::string&> reasonIfUnsupported) const { - ignore_unused(output); - return IsSupportedForDataTypeRef(reasonIfUnsupported, - input.GetDataType(), - &TrueFunc<>, - &FalseFuncU8<>); + bool supported = true; + std::array<DataType,2> supportedTypes = + { + DataType::Float32, + DataType::QuantisedAsymm8 + }; + + supported &= CheckSupportRule(TypeAnyOf(input, supportedTypes), reasonIfUnsupported, + "Reference rsqrt: input type not supported"); + + supported &= CheckSupportRule(TypeAnyOf(output, supportedTypes), reasonIfUnsupported, + "Reference rsqrt: output type not supported"); + + supported &= CheckSupportRule(TypesAreEqual(input, output), reasonIfUnsupported, + "Reference rsqrt: input and output types not matching"); + + supported &= CheckSupportRule(ShapesAreSameTotalSize(input, output), reasonIfUnsupported, + "Reference Rsqrt: input and output shapes have different number of total elements"); + + return supported; } bool RefLayerSupport::IsSoftmaxSupported(const TensorInfo& input, |