Skip to content

Commit

Permalink
fix tanh remainder en doc, test=document_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wangxicoding committed Nov 5, 2020
1 parent dc6b232 commit ace53eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
4 changes: 1 addition & 3 deletions python/paddle/nn/layer/activation.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,10 @@ class Tanh(layers.Layer):
import paddle
import numpy as np
paddle.disable_static()
x = paddle.to_tensor(np.array([-0.4, -0.2, 0.1, 0.3]))
m = paddle.nn.Tanh()
out = m(x)
print(out.numpy())
print(out)
# [-0.37994896 -0.19737532 0.09966799 0.29131261]
"""

Expand Down
9 changes: 3 additions & 6 deletions python/paddle/tensor/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,8 @@ def remainder(x, y, name=None):
``paddle.remainder`` supports broadcasting. If you want know more about broadcasting, please refer to :ref:`user_guide_broadcasting` .
Args:
x (Tensor): the input tensor, it's data type should be int32, int64.
y (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 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`.
Returns:
Expand All @@ -403,13 +403,10 @@ def remainder(x, y, name=None):
import paddle
paddle.disable_static()
x = paddle.to_tensor([2, 3, 8, 7])
y = paddle.to_tensor([1, 5, 3, 3])
z = paddle.remainder(x, y)
print(z.numpy()) # [0, 3, 2, 1]
print(z) # [0, 3, 2, 1]
"""
op_type = 'elementwise_mod'
axis = -1
Expand Down

0 comments on commit ace53eb

Please sign in to comment.