From d8098ee7d5683f09a11cbb2e72edff41e5d9768f Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Mon, 29 Jun 2015 11:14:42 -0700 Subject: [PATCH] Added support for tanh function to the tensor code --- unsupported/Eigen/CXX11/src/Tensor/TensorBase.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h b/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h index c7cfbfce0..944dbf03f 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h @@ -108,6 +108,12 @@ class TensorBase return unaryExpr(internal::scalar_inverse_op()); } + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE const TensorCwiseUnaryOp, const Derived> + tanh() const { + return unaryExpr(internal::scalar_tanh_op()); + } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorCwiseUnaryOp, const Derived> exp() const {