Versioned name: Tanh-1

Category: Activation

Short description: Tanh element-wise activation function.

OpenVINO description: This OP is as same as OpenVINO OP

Attributes: has no attributes


  • 1: input - input tensor. Required.

    • Type: T


  • 1: output - the output tensor of Tanh function applied to the input tensor. Required.

    • Type: T


  • T: f32, f16, bf16.

  • Note: Inputs and outputs have the same data type denoted by T. For example, if input is f32 tensor, then all other tensors have f32 data type.

Detailed description

For each element from the input tensor calculates corresponding element in the output tensor with the following formula:

\[tanh ( x ) = \frac{2}{1+e^{-2x}} - 1 = 2sigmoid(2x) - 1\]