From e662a940d3378cfe669ff7e259a6911713fc0df9 Mon Sep 17 00:00:00 2001 From: Aron Virginas-Tar Date: Mon, 14 Oct 2019 15:12:00 +0100 Subject: IVGCVSW-3975 Add reference workload for LOG_SOFTMAX Signed-off-by: Aron Virginas-Tar Change-Id: I10bb7133e0e2d6d7199abdf39562b1226bbbd3e7 --- src/backends/reference/RefLayerSupport.cpp | 32 +++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) (limited to 'src/backends/reference/RefLayerSupport.cpp') diff --git a/src/backends/reference/RefLayerSupport.cpp b/src/backends/reference/RefLayerSupport.cpp index 0d6b16cdf8..9342b29f47 100644 --- a/src/backends/reference/RefLayerSupport.cpp +++ b/src/backends/reference/RefLayerSupport.cpp @@ -897,6 +897,32 @@ bool RefLayerSupport::IsL2NormalizationSupported(const TensorInfo& input, return supported; } +bool RefLayerSupport::IsLogSoftmaxSupported(const TensorInfo& input, + const TensorInfo& output, + const LogSoftmaxDescriptor& descriptor, + Optional reasonIfUnsupported) const +{ + ignore_unused(descriptor); + + std::array supportedTypes = + { + DataType::Float32, + DataType::Float16 + }; + + bool supported = true; + supported &= CheckSupportRule(TypeAnyOf(input, supportedTypes), reasonIfUnsupported, + "Reference LogSoftmax: input type not supported"); + + supported &= CheckSupportRule(TypeAnyOf(output, supportedTypes), reasonIfUnsupported, + "Reference LogSoftmax: output type not supported"); + + supported &= CheckSupportRule(TypesAreEqual(input, output), reasonIfUnsupported, + "Reference LogSoftmax: input and output types do not match"); + + return supported; +} + bool RefLayerSupport::IsLstmSupported(const TensorInfo& input, const TensorInfo& outputStateIn, const TensorInfo& cellStateIn, @@ -1499,13 +1525,13 @@ bool RefLayerSupport::IsSoftmaxSupported(const TensorInfo& input, }; supported &= CheckSupportRule(TypeAnyOf(input, supportedTypes), reasonIfUnsupported, - "Reference concatenation: output type not supported"); + "Reference Softmax: output type not supported"); supported &= CheckSupportRule(TypeAnyOf(output, supportedTypes), reasonIfUnsupported, - "Reference concatenation: input type not supported"); + "Reference Softmax: input type not supported"); supported &= CheckSupportRule(TypesAreEqual(input, output), reasonIfUnsupported, - "Reference concatenation: input type not supported"); + "Reference Softmax: input type not supported"); return supported; } -- cgit v1.2.1