From c255aa7df3e61a73cc4af86d21d3b1848653b7a9 Mon Sep 17 00:00:00 2001 From: Usama Arif Date: Mon, 13 May 2019 16:26:29 +0100 Subject: COMPMID-2263: Implement NELogLayer Change-Id: Ie2ae8f7a0b1803dae42873201cb643c71b26129f Signed-off-by: Usama Arif Reviewed-on: https://review.mlplatform.org/c/1122 Tested-by: Arm Jenkins Reviewed-by: Michalis Spyrou Comments-Addressed: Arm Jenkins --- arm_compute/core/Types.h | 1 + .../runtime/NEON/functions/NEElementwiseUnaryLayer.h | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) (limited to 'arm_compute') diff --git a/arm_compute/core/Types.h b/arm_compute/core/Types.h index 544ebff410..9ecd7ff2e1 100644 --- a/arm_compute/core/Types.h +++ b/arm_compute/core/Types.h @@ -579,6 +579,7 @@ enum class ElementWiseUnary RSQRT, /**< Reverse square root */ EXP, /**< Exponential */ NEG, /**< Negate */ + LOG, /**< Natural Logarithm */ }; /** The normalization type used for the normalization layer */ diff --git a/arm_compute/runtime/NEON/functions/NEElementwiseUnaryLayer.h b/arm_compute/runtime/NEON/functions/NEElementwiseUnaryLayer.h index f4b7e89889..cce2837a8d 100644 --- a/arm_compute/runtime/NEON/functions/NEElementwiseUnaryLayer.h +++ b/arm_compute/runtime/NEON/functions/NEElementwiseUnaryLayer.h @@ -89,5 +89,25 @@ public: */ static Status validate(const ITensorInfo *input, const ITensorInfo *output); }; + +/** Basic function to compute the natural logarithm of an input tensor. */ +class NELogLayer : public INESimpleFunction +{ +public: + /** Initialize the function + * + * @param[in] input Input tensor. Data types supported: F16/F32/S32. + * @param[out] output Output tensor. Data types supported: same as @p input. + */ + void configure(const ITensor *input, ITensor *output); + /** Static function to check if given info will lead to a valid configuration of @ref NELogLayer + * + * @param[in] input First tensor input info. Data types supported: F16/F32/S32. + * @param[in] output Output tensor info. Data types supported: Same as @p input. + * + * @return a status + */ + static Status validate(const ITensorInfo *input, const ITensorInfo *output); +}; } // namespace arm_compute #endif /* __ARM_COMPUTE_NEELEMENTWISEUNARYLAYER_H__ */ -- cgit v1.2.1