Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
117e951b
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
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看板
未验证
提交
117e951b
编写于
5月 18, 2023
作者:
C
co63oc
提交者:
GitHub
5月 18, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix typos (#53912)
上级
e916e80c
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
11 addition
and
11 deletion
+11
-11
paddle/fluid/eager/to_static/run_program_op_node.h
paddle/fluid/eager/to_static/run_program_op_node.h
+5
-5
paddle/fluid/framework/scope.h
paddle/fluid/framework/scope.h
+2
-2
paddle/fluid/pybind/pybind.cc
paddle/fluid/pybind/pybind.cc
+1
-1
python/paddle/jit/dy2static/partial_program.py
python/paddle/jit/dy2static/partial_program.py
+1
-1
python/paddle/nn/functional/distance.py
python/paddle/nn/functional/distance.py
+1
-1
python/paddle/nn/functional/norm.py
python/paddle/nn/functional/norm.py
+1
-1
未找到文件。
paddle/fluid/eager/to_static/run_program_op_node.h
浏览文件 @
117e951b
...
...
@@ -443,11 +443,11 @@ inline void RunProgramAPI(
VLOG
(
4
)
<<
"don't require any grad, set this scope can reused"
;
VLOG
(
4
)
<<
"is_test: "
<<
is_test
<<
", require_any_grad: "
<<
require_any_grad
;
global_inner_scope
->
SetCanReu
es
d
(
true
);
global_inner_scope
->
SetCanReu
se
d
(
true
);
details
::
GcScope
(
global_inner_scope
);
}
else
{
VLOG
(
4
)
<<
"not test, set this scope can not reused"
;
global_inner_scope
->
SetCanReu
es
d
(
false
);
global_inner_scope
->
SetCanReu
se
d
(
false
);
}
}
...
...
@@ -582,7 +582,7 @@ inline void RunProgramGradAPI(
*
backward_global_block
,
global_inner_scope
);
VLOG
(
4
)
<<
"after backward gc all vars"
;
global_inner_scope
->
SetCanReu
es
d
(
true
);
global_inner_scope
->
SetCanReu
se
d
(
true
);
details
::
GcScope
(
global_inner_scope
);
}
}
...
...
@@ -599,9 +599,9 @@ class GradNodeRunProgram : public egr::GradNodeBase {
// Normally out_scope_vec.size() == 1. for safty, we add for-loop here.
for
(
size_t
i
=
0
;
i
<
out_scope_vec
->
size
();
++
i
)
{
paddle
::
framework
::
Scope
*
global_inner_scope
=
out_scope_vec
->
at
(
i
);
global_inner_scope
->
SetCanReu
es
d
(
true
);
global_inner_scope
->
SetCanReu
se
d
(
true
);
details
::
GcScope
(
global_inner_scope
);
VLOG
(
4
)
<<
"global_inner_scope SetCanReu
es
d"
;
VLOG
(
4
)
<<
"global_inner_scope SetCanReu
se
d"
;
}
}
}
...
...
paddle/fluid/framework/scope.h
浏览文件 @
117e951b
...
...
@@ -122,9 +122,9 @@ class Scope {
std
::
string
Rename
(
const
std
::
string
&
origin_name
)
const
;
// only for dygraph_to_static
bool
CanReu
es
d
()
const
{
return
can_reused_
;
}
bool
CanReu
se
d
()
const
{
return
can_reused_
;
}
void
SetCanReu
es
d
(
bool
can_reused
)
{
can_reused_
=
can_reused
;
}
void
SetCanReu
se
d
(
bool
can_reused
)
{
can_reused_
=
can_reused
;
}
protected:
struct
KeyHasher
{
...
...
paddle/fluid/pybind/pybind.cc
浏览文件 @
117e951b
...
...
@@ -1210,7 +1210,7 @@ All parameter, weight, gradient are variables in Paddle.
Delete all sub-scopes of the current scope.
)DOC"
)
.
def
(
"_kids"
,
&
Scope
::
kids
)
.
def_property
(
"_can_reu
esd"
,
&
Scope
::
CanReuesd
,
&
Scope
::
SetCanReues
d
);
.
def_property
(
"_can_reu
sed"
,
&
Scope
::
CanReused
,
&
Scope
::
SetCanReuse
d
);
m
.
def
(
"Scope"
,
...
...
python/paddle/jit/dy2static/partial_program.py
浏览文件 @
117e951b
...
...
@@ -259,7 +259,7 @@ class PartialProgramLayer:
return
scope
else
:
for
scope
in
self
.
_scope_cache
[
program_id
]:
if
scope
.
_can_reu
es
d
:
if
scope
.
_can_reu
se
d
:
return
scope
scope
=
core
.
Scope
()
self
.
_scope_cache
[
program_id
].
append
(
scope
)
...
...
python/paddle/nn/functional/distance.py
浏览文件 @
117e951b
...
...
@@ -70,7 +70,7 @@ def pairwise_distance(x, y, p=2.0, epsilon=1e-6, keepdim=False, name=None):
"""
if
in_dygraph_mode
():
sub
=
_C_ops
.
subtract
(
x
,
y
)
# p_norm op has not u
es
d epsilon, so change it to the following.
# p_norm op has not u
se
d epsilon, so change it to the following.
if
epsilon
!=
0.0
:
epsilon
=
paddle
.
fluid
.
dygraph
.
base
.
to_variable
(
[
epsilon
],
dtype
=
sub
.
dtype
...
...
python/paddle/nn/functional/norm.py
浏览文件 @
117e951b
...
...
@@ -127,7 +127,7 @@ def batch_norm(
"""
Applies Batch Normalization as described in the paper Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift .
nn.functional.batch_norm is u
es
d for nn.BatchNorm1D, nn.BatchNorm2D, nn.BatchNorm3D. Please use above API for BatchNorm.
nn.functional.batch_norm is u
se
d for nn.BatchNorm1D, nn.BatchNorm2D, nn.BatchNorm3D. Please use above API for BatchNorm.
Parameters:
x(Tesnor): input value. It's data type should be float32, float64.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录