Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
18525d36
P
Paddle
项目概览
机器未来
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
18525d36
编写于
11月 09, 2020
作者:
W
WangXi
提交者:
GitHub
11月 09, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix Tanh remainder en doc (#28455)
上级
e14ed71c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
6 addition
and
10 deletion
+6
-10
python/paddle/nn/layer/activation.py
python/paddle/nn/layer/activation.py
+1
-3
python/paddle/tensor/math.py
python/paddle/tensor/math.py
+5
-7
未找到文件。
python/paddle/nn/layer/activation.py
浏览文件 @
18525d36
...
...
@@ -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]
"""
...
...
python/paddle/tensor/math.py
浏览文件 @
18525d36
...
...
@@ -387,11 +387,11 @@ def remainder(x, y, name=None):
out = x \% y
**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:
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:
...
...
@@ -403,12 +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]
z = paddle.
mod
(x, y)
print(z) # [0, 3, 2, 1]
"""
op_type
=
'elementwise_mod'
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录