未验证 提交 18525d36 编写于 作者: W WangXi 提交者: GitHub

fix Tanh remainder en doc (#28455)

上级 e14ed71c
...@@ -252,12 +252,10 @@ class Tanh(layers.Layer): ...@@ -252,12 +252,10 @@ class Tanh(layers.Layer):
import paddle import paddle
import numpy as np import numpy as np
paddle.disable_static()
x = paddle.to_tensor(np.array([-0.4, -0.2, 0.1, 0.3])) x = paddle.to_tensor(np.array([-0.4, -0.2, 0.1, 0.3]))
m = paddle.nn.Tanh() m = paddle.nn.Tanh()
out = m(x) out = m(x)
print(out.numpy()) print(out)
# [-0.37994896 -0.19737532 0.09966799 0.29131261] # [-0.37994896 -0.19737532 0.09966799 0.29131261]
""" """
......
...@@ -387,11 +387,11 @@ def remainder(x, y, name=None): ...@@ -387,11 +387,11 @@ def remainder(x, y, name=None):
out = x \% y out = x \% y
**Note**: **Note**:
``paddle.remainder`` supports broadcasting. If you want know more about broadcasting, please refer to :ref:`user_guide_broadcasting` . ``paddle.mod`` supports broadcasting. If you want know more about broadcasting, please refer to :ref:`user_guide_broadcasting` .
Args: Args:
x (Tensor): the input tensor, it's data type should be int32, int64. x (Tensor): the input tensor, it's data type should be float32, float64, int32, int64.
y (Tensor): the input tensor, it's data type should be int32, int64. y (Tensor): the input tensor, it's data type should be float32, float64, int32, int64.
name (str, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`. name (str, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`.
Returns: Returns:
...@@ -403,12 +403,10 @@ def remainder(x, y, name=None): ...@@ -403,12 +403,10 @@ def remainder(x, y, name=None):
import paddle import paddle
paddle.disable_static()
x = paddle.to_tensor([2, 3, 8, 7]) x = paddle.to_tensor([2, 3, 8, 7])
y = paddle.to_tensor([1, 5, 3, 3]) y = paddle.to_tensor([1, 5, 3, 3])
z = paddle.remainder(x, y) z = paddle.mod(x, y)
print(z.numpy()) # [0, 3, 2, 1] print(z) # [0, 3, 2, 1]
""" """
op_type = 'elementwise_mod' op_type = 'elementwise_mod'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册