diff options
author | Tracy Narine <tracy.narine@arm.com> | 2023-07-13 16:50:54 +0100 |
---|---|---|
committer | Tracy Narine <tracy.narine@arm.com> | 2023-07-17 14:19:36 +0100 |
commit | bb8d7591a35bd95480b39001f8b7e41a6671f3a6 (patch) | |
tree | abf2871aa1bb86378f423df405164b0d4521db3f /src/backends/reference/RefLayerSupport.cpp | |
parent | 688268328c69e7d4181cdd31fe4717c80a6d1685 (diff) | |
download | armnn-bb8d7591a35bd95480b39001f8b7e41a6671f3a6.tar.gz |
IVGCVSW-7879 Change REVERSE_V2 from LayerWithParameters with 1 input, to Layer with 2 inputs
* Changing ReverseV2 to use two inputs
* This is required by the backends
* The ReverseV2Descriptor was removed
* Tests updated
* Added a Run<> templatefor inputs with different data types
Signed-off-by: Tracy Narine <tracy.narine@arm.com>
Change-Id: I22f947de829b4b3da6bda3a74f4ffdef4052cc25
Diffstat (limited to 'src/backends/reference/RefLayerSupport.cpp')
-rw-r--r-- | src/backends/reference/RefLayerSupport.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/backends/reference/RefLayerSupport.cpp b/src/backends/reference/RefLayerSupport.cpp index 1d5fab1adc..e94478f088 100644 --- a/src/backends/reference/RefLayerSupport.cpp +++ b/src/backends/reference/RefLayerSupport.cpp @@ -344,7 +344,7 @@ bool RefLayerSupport::IsLayerSupported(const LayerType& type, case LayerType::ReverseV2: return IsReverseV2Supported(infos[0], infos[1], - *(PolymorphicDowncast<const ReverseV2Descriptor*>(&descriptor)), + infos[2], reasonIfUnsupported); case LayerType::Reduce: return IsReduceSupported(infos[0], @@ -2361,12 +2361,11 @@ bool RefLayerSupport::IsResizeSupported(const TensorInfo& input, return supported; } -bool RefLayerSupport::IsReverseV2Supported(const TensorInfo& input, +bool RefLayerSupport::IsReverseV2Supported(const TensorInfo& input0, + const TensorInfo& input1, const TensorInfo& output, - const ReverseV2Descriptor& descriptor, Optional<std::string&> reasonIfUnsupported) const { - IgnoreUnused(descriptor); bool supported = true; // ReverseV2 is data type agnostic so it can support all the types in the Reference backend std::array<DataType,6> supportedTypes = @@ -2379,14 +2378,22 @@ bool RefLayerSupport::IsReverseV2Supported(const TensorInfo& input, DataType::QSymmS16 }; - supported &= CheckSupportRule(TypeAnyOf(input, supportedTypes), reasonIfUnsupported, - "Reference ReverseV2: input type not supported"); + supported &= CheckSupportRule(TypeAnyOf(input0, supportedTypes), reasonIfUnsupported, + "Reference ReverseV2: input0 type not supported"); supported &= CheckSupportRule(TypeAnyOf(output, supportedTypes), reasonIfUnsupported, "Reference ReverseV2: output type not supported"); - supported &= CheckSupportRule(TypesAreEqual(input, output), reasonIfUnsupported, - "Reference ReverseV2: input and output types not matching"); + supported &= CheckSupportRule(TypesAreEqual(input0, output), reasonIfUnsupported, + "Reference ReverseV2: input0 and output types not matching"); + + std::array<DataType,6> input2SupportedTypes = + { + DataType::Signed32 + }; + + supported &= CheckSupportRule(TypeAnyOf(input1, input2SupportedTypes), reasonIfUnsupported, + "Reference ReverseV2: input1 type not supported"); return supported; } |