diff options
author | Kevin May <kevin.may@arm.com> | 2019-10-09 12:37:34 +0100 |
---|---|---|
committer | Áron Virginás-Tar <aron.virginas-tar@arm.com> | 2019-10-09 16:13:36 +0000 |
commit | 09ca49cdcfbe377da979a19df9bcdb7cbffc7b50 (patch) | |
tree | 62cf0881012c80498ded1963c82654efcb761bf2 /src/backends/reference/RefLayerSupport.cpp | |
parent | 0d4863dd3ef0d1cafea0857e70f70b22a841ed71 (diff) | |
download | armnn-09ca49cdcfbe377da979a19df9bcdb7cbffc7b50.tar.gz |
IVGCVSW-3888 Add INSTANCE_NORMALIZATION Reference implementation
Signed-off-by: Kevin May <kevin.may@arm.com>
Change-Id: I725022f86e990c482ea323fc90fd136fe493ed68
Diffstat (limited to 'src/backends/reference/RefLayerSupport.cpp')
-rw-r--r-- | src/backends/reference/RefLayerSupport.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/backends/reference/RefLayerSupport.cpp b/src/backends/reference/RefLayerSupport.cpp index 06da77603d..0d6b16cdf8 100644 --- a/src/backends/reference/RefLayerSupport.cpp +++ b/src/backends/reference/RefLayerSupport.cpp @@ -833,6 +833,37 @@ bool RefLayerSupport::IsInputSupported(const TensorInfo& input, return true; } +bool RefLayerSupport::IsInstanceNormalizationSupported(const TensorInfo& input, + const TensorInfo& output, + const InstanceNormalizationDescriptor& descriptor, + Optional<std::string&> reasonIfUnsupported) const +{ + ignore_unused(descriptor); + // Define supported types + std::array<DataType, 4> supportedTypes = + { + DataType::Float32, + DataType::Float16 + }; + + bool supported = true; + + supported &= CheckSupportRule(TypeAnyOf(input, supportedTypes), reasonIfUnsupported, + "Reference Instance Normalization: input type not supported."); + + supported &= CheckSupportRule(TypeAnyOf(output, supportedTypes), reasonIfUnsupported, + "Reference Instance Normalization: output type not supported."); + + supported &= CheckSupportRule(TypesAreEqual(input, output), reasonIfUnsupported, + "Reference Instance Normalization: input and output types mismatched."); + + supported &= CheckSupportRule(ShapesAreSameTotalSize(input, output), reasonIfUnsupported, + "Reference Instance Normalization: input and output shapes have different " + "num total elements."); + + return supported; +} + bool RefLayerSupport::IsL2NormalizationSupported(const TensorInfo& input, const TensorInfo& output, const L2NormalizationDescriptor& descriptor, |