Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
c75b091b
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2292
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
c75b091b
编写于
8月 15, 2022
作者:
W
wanghuancoder
提交者:
GitHub
8月 15, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[Eager] fix sync batch norm to inplace (#45028)
* fix sync batch norm to inplace
上级
05f7d0c5
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
3 addition
and
2 deletion
+3
-2
paddle/phi/api/yaml/legacy_api.yaml
paddle/phi/api/yaml/legacy_api.yaml
+2
-1
python/paddle/nn/layer/norm.py
python/paddle/nn/layer/norm.py
+1
-1
未找到文件。
paddle/phi/api/yaml/legacy_api.yaml
浏览文件 @
c75b091b
...
...
@@ -2560,7 +2560,7 @@
backward
:
swish_grad
# sync_batch_norm
-
api
:
sync_batch_norm
-
api
:
sync_batch_norm
_
args
:
(Tensor x, Tensor scale, Tensor bias, Tensor mean, Tensor variance, float momentum, float epsilon, str data_layout, bool is_test, bool use_global_stats, bool trainable_statistics, bool fuse_with_relu)
output
:
Tensor(out), Tensor(mean_out), Tensor(variance_out), Tensor(saved_mean), Tensor(saved_variance), Tensor(reserve_space)
infer_meta
:
...
...
@@ -2569,6 +2569,7 @@
func
:
sync_batch_norm
data_type
:
x
backward
:
sync_batch_norm_grad
inplace
:
(mean -> mean_out), (variance -> variance_out)
# take_along_axis
-
api
:
take_along_axis
...
...
python/paddle/nn/layer/norm.py
浏览文件 @
c75b091b
...
...
@@ -1110,7 +1110,7 @@ class SyncBatchNorm(_BatchNormBase):
### train mode: use mini-batch stats, eval mode: use global stats
### use_global_stats only support False in sync_batch_norm
if
in_dygraph_mode
():
sync_batch_norm_out
,
_
,
_
,
_
,
_
,
_
=
_C_ops
.
final_state_sync_batch_norm
(
sync_batch_norm_out
,
_
,
_
,
_
,
_
,
_
=
_C_ops
.
final_state_sync_batch_norm
_
(
x
,
self
.
weight
,
self
.
bias
,
self
.
_mean
,
self
.
_variance
,
self
.
_momentum
,
self
.
_epsilon
,
self
.
_data_format
,
not
self
.
training
,
False
,
False
,
False
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录