@@ -2314,6 +2314,47 @@ def dot(
23142314""" ,
23152315)
23162316
2317+ add_doc_and_signature (
2318+ "tanh" ,
2319+ r"""
2320+
2321+ Tanh Activation Operator.
2322+
2323+ .. math::
2324+ out = \frac{e^{x} - e^{-x}}{e^{x} + e^{-x}}
2325+
2326+ .. note::
2327+ Alias Support:
2328+ 1. The parameter name ``input`` can be used as an alias for ``x``.
2329+
2330+ Args:
2331+ x (Tensor): Input of Tanh operator, an N-D Tensor, with data type bfloat16, float32, float64,
2332+ float16, uint8, int8, int16, int32, int64. Alias: ``input``.
2333+ name (str|None, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`.
2334+ out (Tensor|None, optional): The output tensor. Default: None.
2335+
2336+ Returns:
2337+ Output of Tanh operator, a Tensor with same data type and shape as input
2338+ (integer types are autocasted into float32).
2339+
2340+ Examples:
2341+ .. code-block:: python
2342+
2343+ >>> import paddle
2344+
2345+ >>> x = paddle.to_tensor([-0.4, -0.2, 0.1, 0.3])
2346+ >>> out = paddle.tanh(x)
2347+ >>> out
2348+ Tensor(shape=[4], dtype=float32, place=Place(cpu), stop_gradient=True,
2349+ [-0.37994900, -0.19737528, 0.09966799, 0.29131261])
2350+ """ ,
2351+ """
2352+ def tanh(
2353+ x: Tensor, *, out: Tensor | None = None, name: str | None = None,
2354+ ) -> Tensor
2355+ """ ,
2356+ )
2357+
23172358add_doc_and_signature (
23182359 "exp" ,
23192360 """
@@ -2331,7 +2372,7 @@ def dot(
23312372 x (Tensor): Input of Exp operator, an N-D Tensor, with data type int32, int64, bfloat16, float16, float32, float64, complex64 or complex128.
23322373 Alias: ``input``.
23332374 name (str|None, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`.
2334- out (Tensor|None, optional): The output tensor.
2375+ out (Tensor|None, optional): The output tensor. Default: None.
23352376
23362377 Returns:
23372378 Tensor. Output of Exp operator, a Tensor with shape same as input.
@@ -2371,7 +2412,7 @@ def exp(
23712412 x (Tensor): Input of Expm1 operator, an N-D Tensor, with data type int32, int64, bfloat16, float16, float32, float64, complex64 or complex128.
23722413 Alias: ``input``.
23732414 name (str|None, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`.
2374- out (Tensor|None, optional): The output tensor.
2415+ out (Tensor|None, optional): The output tensor. Default: None.
23752416
23762417 Returns:
23772418 Tensor. Output of Expm1 operator, a Tensor with shape same as input.
@@ -2494,10 +2535,16 @@ def diagonal(
24942535 out.shape = [4]
24952536 out.data = [1., -1., 3., 1.]
24962537
2538+ .. note::
2539+ Alias Support:
2540+ 1. The parameter name ``input`` can be used as an alias for ``x``.
2541+
24972542 Args:
24982543 x (Tensor): Input of Round operator, an N-D Tensor, with data type bfloat16, int32, int64, float32, float64, float16, complex64 or complex128.
2544+ Alias: ``input``.
24992545 decimals(int): Rounded decimal place (default: 0).
25002546 name (str|None, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`.
2547+ out (Tensor|None, optional): The output tensor. Default: None.
25012548
25022549 Returns:
25032550 Tensor. Output of Round operator, a Tensor with shape same as input.
@@ -2529,12 +2576,15 @@ def round(
25292576
25302577 out = |x|
25312578
2579+ .. note::
2580+ Alias Support:
2581+ 1. The parameter name ``input`` can be used as an alias for ``x``.
2582+
25322583 Args:
25332584 x (Tensor): The input Tensor with data type int32, int64, float16, float32, float64, complex64 and complex128.
2585+ Alias: ``input``.
25342586 name (str|None, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`.
2535-
2536- Keyword args:
2537- out (Tensor|None, optional): The output tensor.
2587+ out (Tensor|None, optional): The output tensor. Default: None.
25382588
25392589 Returns:
25402590 Tensor.A Tensor with the same data type and shape as :math:`x`.
0 commit comments