Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
b2afc8df
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
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看板
未验证
提交
b2afc8df
编写于
6月 11, 2021
作者:
J
Jiangxinz
提交者:
GitHub
6月 11, 2021
1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix some Bugs of Undefined Variable (#33488)
* fix Undefined variables * fix Undefined variables
上级
ab41a9ee
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
13 addition
and
8 deletion
+13
-8
python/paddle/distributed/utils.py
python/paddle/distributed/utils.py
+2
-1
python/paddle/fluid/dataloader/collate.py
python/paddle/fluid/dataloader/collate.py
+0
-1
python/paddle/fluid/optimizer.py
python/paddle/fluid/optimizer.py
+3
-1
python/paddle/fluid/tests/unittests/mkldnn/test_conv2d_transpose_mkldnn_op.py
...tests/unittests/mkldnn/test_conv2d_transpose_mkldnn_op.py
+1
-0
python/paddle/fluid/tests/unittests/test_eager_deletion_delete_vars.py
.../fluid/tests/unittests/test_eager_deletion_delete_vars.py
+1
-1
python/paddle/fluid/tests/unittests/xpu/test_pool2d_op_xpu.py
...on/paddle/fluid/tests/unittests/xpu/test_pool2d_op_xpu.py
+1
-0
python/paddle/optimizer/lr.py
python/paddle/optimizer/lr.py
+1
-1
python/paddle/optimizer/optimizer.py
python/paddle/optimizer/optimizer.py
+2
-2
python/paddle/tests/test_model.py
python/paddle/tests/test_model.py
+1
-1
python/paddle/text/datasets/wmt14.py
python/paddle/text/datasets/wmt14.py
+1
-0
未找到文件。
python/paddle/distributed/utils.py
浏览文件 @
b2afc8df
...
...
@@ -25,6 +25,7 @@ import subprocess
from
contextlib
import
closing
import
socket
from
paddle.fluid
import
core
from
distutils.util
import
strtobool
__all__
=
[
#noqa
'get_host_name_ip'
,
...
...
@@ -384,7 +385,7 @@ def add_arguments(argname, type, default, help, argparser, **kwargs):
add_argument("name", str, "Jonh", "User name.", parser)
args = parser.parse_args()
"""
type
=
distutils
.
util
.
strtobool
if
type
==
bool
else
type
type
=
strtobool
if
type
==
bool
else
type
argparser
.
add_argument
(
"--"
+
argname
,
default
=
default
,
...
...
python/paddle/fluid/dataloader/collate.py
浏览文件 @
b2afc8df
...
...
@@ -78,7 +78,6 @@ def default_collate_fn(batch):
raise
TypeError
(
"batch data con only contains: tensor, numpy.ndarray, "
"dict, list, number, but got {}"
.
format
(
type
(
sample
)))
return
outputs
def
default_convert_fn
(
batch
):
...
...
python/paddle/fluid/optimizer.py
浏览文件 @
b2afc8df
...
...
@@ -14,6 +14,7 @@
from
__future__
import
print_function
import
warnings
import
numpy
as
np
import
six
import
os
...
...
@@ -21,6 +22,7 @@ import logging
from
collections
import
defaultdict
import
paddle
import
paddle.fluid
as
fluid
from
paddle.fluid.distribute_lookup_table
import
find_distributed_lookup_table
from
paddle.fluid.framework
import
Program
,
Variable
,
name_scope
,
default_main_program
,
default_startup_program
,
device_guard
...
...
@@ -1469,7 +1471,7 @@ class DGCMomentumOptimizer(Optimizer):
assert
isinstance
(
num_trainers
,
int
),
"The type of num_trainers should be 'int', but received %s"
%
type
(
value
)
num_trainers
)
assert
num_trainers
>
0
,
"The value of num_trainers should be greater than 0!"
self
.
_num_trainers
=
num_trainers
...
...
python/paddle/fluid/tests/unittests/mkldnn/test_conv2d_transpose_mkldnn_op.py
浏览文件 @
b2afc8df
...
...
@@ -18,6 +18,7 @@ import unittest
import
numpy
as
np
import
paddle.fluid.core
as
core
from
paddle.fluid.tests.unittests.op_test
import
OpTest
from
paddle
import
enable_static
from
paddle.fluid.tests.unittests.test_conv2d_transpose_op
import
conv2dtranspose_forward_naive
,
TestConv2DTransposeOp
...
...
python/paddle/fluid/tests/unittests/test_eager_deletion_delete_vars.py
浏览文件 @
b2afc8df
...
...
@@ -145,7 +145,7 @@ class TestExecutor(unittest.TestCase):
def
pe_main
(
self
):
image
,
label
,
loss
=
simple_fc_net
()
loss
.
persistable
=
False
persitables
,
non_persistables
=
get_persistables_and_non_persistables
(
persi
s
tables
,
non_persistables
=
get_persistables_and_non_persistables
(
fluid
.
default_main_program
(),
[
loss
.
name
])
exe
=
fluid
.
Executor
(
self
.
place
)
...
...
python/paddle/fluid/tests/unittests/xpu/test_pool2d_op_xpu.py
浏览文件 @
b2afc8df
...
...
@@ -25,6 +25,7 @@ from op_test_xpu import XPUOpTest
import
paddle.fluid
as
fluid
from
paddle.fluid
import
Program
,
program_guard
import
paddle
from
test_pool2d_op
import
adaptive_start_index
,
adaptive_end_index
paddle
.
enable_static
()
...
...
python/paddle/optimizer/lr.py
浏览文件 @
b2afc8df
...
...
@@ -1349,7 +1349,7 @@ class ReduceOnPlateau(LRScheduler):
if
isinstance
(
metrics
,
(
Tensor
,
numpy
.
ndarray
)):
assert
len
(
metrics
.
shape
)
==
1
and
metrics
.
shape
[
0
]
==
1
,
"the metrics.shape "
\
"should be (1L,), but the current metrics.shape is {}. Maybe that "
\
"you should call paddle.mean to process it first."
.
format
(
los
s
.
shape
)
"you should call paddle.mean to process it first."
.
format
(
metric
s
.
shape
)
elif
not
isinstance
(
metrics
,
(
int
,
float
,
numpy
.
float32
,
numpy
.
float64
)):
raise
TypeError
(
...
...
python/paddle/optimizer/optimizer.py
浏览文件 @
b2afc8df
...
...
@@ -309,11 +309,11 @@ class Optimizer(object):
assert
model_np
.
shape
==
load_para_np
.
shape
,
\
"Parameter shape not match, Dygraph Parameter [ {} ] need tensor with shape {} but load tensor with shape {}"
.
format
(
item
.
name
,
model_np
.
shape
,
load_para_np
.
shape
)
model_np
.
name
,
model_np
.
shape
,
load_para_np
.
shape
)
assert
model_np
.
dtype
==
load_para_np
.
dtype
,
\
"Parameter dtype not match, Dygraph Parameter [ {} ] need tensor with dtype {} but load tensor with dtype {}"
.
format
(
item
.
name
,
model_np
.
dtype
,
load_para_np
.
dtype
)
model_np
.
name
,
model_np
.
dtype
,
load_para_np
.
dtype
)
tensor
.
set
(
load_para_np
,
framework
.
_current_expected_place
())
...
...
python/paddle/tests/test_model.py
浏览文件 @
b2afc8df
...
...
@@ -126,7 +126,7 @@ class TestModel(unittest.TestCase):
@
classmethod
def
setUpClass
(
cls
):
if
not
fluid
.
is_compiled_with_cuda
():
self
.
skipTest
(
'module not tested when ONLY_CPU compling'
)
cls
.
skipTest
(
'module not tested when ONLY_CPU compling'
)
cls
.
device
=
paddle
.
set_device
(
'gpu'
)
fluid
.
enable_dygraph
(
cls
.
device
)
...
...
python/paddle/text/datasets/wmt14.py
浏览文件 @
b2afc8df
...
...
@@ -14,6 +14,7 @@
from
__future__
import
print_function
import
six
import
tarfile
import
numpy
as
np
import
gzip
...
...
saxon_zh
@saxon_zh
mentioned in commit
18e71bdf
·
6月 16, 2021
mentioned in commit
18e71bdf
mentioned in commit 18e71bdf110348b890f595671c2e85a29148ec0c
开关提交列表
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录