tanh¶
- nvtripy.tanh(input: Tensor) Tensor[source]¶
Computes the elementwise hyperbolic tangent of the elements of the input tensor.
- INPUT REQUIREMENTS:
- OUTPUT GUARANTEES:
return[0].dtype==input.dtype
Example
1input = tp.arange(3, dtype=tp.float32) 2output = tp.tanh(input)
Local Variables¶>>> input tensor([0, 1, 2], dtype=float32, loc=gpu:0, shape=(3,)) >>> output tensor([0, 0.761594, 0.964028], dtype=float32, loc=gpu:0, shape=(3,))