From 80e55db85bb4842ef287c2732fc98ad869748b0a Mon Sep 17 00:00:00 2001 From: Usama Arif Date: Tue, 14 May 2019 17:48:47 +0100 Subject: COMPMID-2194: Add identity function to NEActivationLayerKernel.cpp Change-Id: Id9bc53722b7dfe277812e9e1d749ac4cea35260a Signed-off-by: Usama Arif Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/184712 Tested-by: bsgcomp Reviewed-by: Gian Marco Iodice Reviewed-on: https://review.mlplatform.org/c/1143 Comments-Addressed: Arm Jenkins Tested-by: Georgios Pinitas --- src/core/NEON/kernels/NEActivationLayerKernel.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/core/NEON/kernels/NEActivationLayerKernel.cpp') diff --git a/src/core/NEON/kernels/NEActivationLayerKernel.cpp b/src/core/NEON/kernels/NEActivationLayerKernel.cpp index 8de8db9ad9..bc6a281353 100644 --- a/src/core/NEON/kernels/NEActivationLayerKernel.cpp +++ b/src/core/NEON/kernels/NEActivationLayerKernel.cpp @@ -118,6 +118,7 @@ void NEActivationLayerKernel::configure(ITensor *input, ITensor *output, Activat { ActivationFunction::SQRT, &NEActivationLayerKernel::activation }, { ActivationFunction::SQUARE, &NEActivationLayerKernel::activation }, { ActivationFunction::TANH, &NEActivationLayerKernel::activation }, + { ActivationFunction::IDENTITY, &NEActivationLayerKernel::activation }, }; #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC @@ -135,6 +136,7 @@ void NEActivationLayerKernel::configure(ITensor *input, ITensor *output, Activat { ActivationFunction::SQRT, &NEActivationLayerKernel::activation }, { ActivationFunction::SQUARE, &NEActivationLayerKernel::activation }, { ActivationFunction::TANH, &NEActivationLayerKernel::activation }, + { ActivationFunction::IDENTITY, &NEActivationLayerKernel::activation }, }; #endif /* __ARM_FEATURE_FP16_VECTOR_ARITHMETIC*/ @@ -145,6 +147,7 @@ void NEActivationLayerKernel::configure(ITensor *input, ITensor *output, Activat { ActivationFunction::BOUNDED_RELU, &NEActivationLayerKernel::activation }, { ActivationFunction::LU_BOUNDED_RELU, &NEActivationLayerKernel::activation }, { ActivationFunction::RELU, &NEActivationLayerKernel::activation }, + { ActivationFunction::IDENTITY, &NEActivationLayerKernel::activation }, }; switch(input->info()->data_type()) @@ -242,6 +245,9 @@ NEActivationLayerKernel::activation(const Window &window) case ActivationFunction::TANH: tmp = wrapper::vmul(va, wrapper::vtanh(wrapper::vmul(vb, vin))); break; + case ActivationFunction::IDENTITY: + tmp = vin; + break; default: ARM_COMPUTE_ERROR("Unsupported activation function"); } @@ -288,6 +294,9 @@ NEActivationLayerKernel::activation(const Window &window) case ActivationFunction::TANH: tmp = a * std::tanh(b * in); break; + case ActivationFunction::IDENTITY: + tmp = in; + break; default: ARM_COMPUTE_ERROR("Unsupported activation function"); } -- cgit v1.2.1