Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
0edbd7a5
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,发现更多精彩内容 >>
未验证
提交
0edbd7a5
编写于
12月 20, 2022
作者:
N
Nyakku Shigure
提交者:
GitHub
12月 20, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CodeStyle][py2] cleanup some useless comments related to py2 (#49135)
上级
a6a4895a
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
10 addition
and
23 deletion
+10
-23
.pre-commit-config.yaml
.pre-commit-config.yaml
+1
-1
python/paddle/distributed/fleet/utils/http_server.py
python/paddle/distributed/fleet/utils/http_server.py
+0
-2
python/paddle/fluid/dataloader/dataloader_iter.py
python/paddle/fluid/dataloader/dataloader_iter.py
+0
-1
python/paddle/fluid/dataloader/worker.py
python/paddle/fluid/dataloader/worker.py
+0
-1
python/paddle/fluid/dygraph/checkpoint.py
python/paddle/fluid/dygraph/checkpoint.py
+0
-1
python/paddle/fluid/framework.py
python/paddle/fluid/framework.py
+6
-9
python/paddle/fluid/incubate/fleet/utils/http_server.py
python/paddle/fluid/incubate/fleet/utils/http_server.py
+0
-1
python/paddle/fluid/multiprocess_utils.py
python/paddle/fluid/multiprocess_utils.py
+0
-1
python/paddle/fluid/reader.py
python/paddle/fluid/reader.py
+0
-1
tools/sampcd_processor.py
tools/sampcd_processor.py
+1
-1
tools/test_print_signatures.py
tools/test_print_signatures.py
+2
-4
未找到文件。
.pre-commit-config.yaml
浏览文件 @
0edbd7a5
...
...
@@ -5,7 +5,7 @@ exclude: |
paddle/fluid/framework/fleet/heter_ps/cudf/.+|
paddle/fluid/distributed/ps/thirdparty/round_robin.h|
python/paddle/utils/gast/.+|
.+_p
y
2\.py|
.+_p
b
2\.py|
python/paddle/fluid/tests/unittests/npu/.+|
python/paddle/fluid/tests/unittests/mlu/.+
)$
...
...
python/paddle/distributed/fleet/utils/http_server.py
浏览文件 @
0edbd7a5
...
...
@@ -16,8 +16,6 @@
import
http.server
as
SimpleHTTPServer
import
logging
import
threading
# NOTE: HTTPServer has a different name in python2 and python3
from
http.server
import
HTTPServer
__all__
=
[]
...
...
python/paddle/fluid/dataloader/dataloader_iter.py
浏览文件 @
0edbd7a5
...
...
@@ -28,7 +28,6 @@ from paddle.fluid.framework import (
set_flags
,
)
# NOTE: queue has a different name in python2 and python3
import
queue
import
paddle
...
...
python/paddle/fluid/dataloader/worker.py
浏览文件 @
0edbd7a5
...
...
@@ -28,7 +28,6 @@ from ..multiprocess_utils import (
from
..framework
import
_non_static_mode
,
_in_eager_without_dygraph_check
from
.flat
import
_flatten_batch
# NOTE: queue has a different name in python2 and python3
import
queue
__all__
=
[
'get_worker_info'
]
...
...
python/paddle/fluid/dygraph/checkpoint.py
浏览文件 @
0edbd7a5
...
...
@@ -248,7 +248,6 @@ def load_dygraph(model_path, **configs):
)
# 2. load layer parameters & buffers
# NOTE: using fluid.dygraph.guard() here will cause import error in py2
with
guard
():
persistable_var_dict
=
_construct_params_and_buffers
(
model_prefix
,
...
...
python/paddle/fluid/framework.py
浏览文件 @
0edbd7a5
...
...
@@ -1290,7 +1290,7 @@ def _varbase_creator(
shape
=
None
,
dtype
=
None
,
persistable
=
None
,
**
kwargs
**
kwargs
,
):
if
dtype
is
not
None
:
if
not
isinstance
(
dtype
,
core
.
VarDesc
.
VarType
):
...
...
@@ -1412,7 +1412,7 @@ class Variable(metaclass=VariableMetaClass):
is_data
=
False
,
need_check_feed
=
False
,
belong_to_optimizer
=
False
,
**
kwargs
**
kwargs
,
):
self
.
block
=
block
if
name
is
None
:
...
...
@@ -2953,11 +2953,8 @@ class Operator:
in_arg_names
.
append
(
arg
.
name
)
else
:
raise
TypeError
(
"The type of '%s' in operator %s should be "
"one of [basestring(), str, Varibale] in python2, "
"or one of [str, bytes, Variable] in python3."
"but received : %s"
%
(
in_proto
.
name
,
type
,
arg
)
f
"The type of '%
{
in_proto
.
name
}
' in operator
{
type
}
should be "
f
"one of [str, bytes, Variable]. but received :
{
arg
}
"
)
self
.
desc
.
set_input
(
in_proto
.
name
,
in_arg_names
)
else
:
...
...
@@ -6887,7 +6884,7 @@ class Parameter(Variable, metaclass=ParameterMetaClass):
shape
,
dtype
,
type
=
core
.
VarDesc
.
VarType
.
LOD_TENSOR
,
**
kwargs
**
kwargs
,
):
if
shape
is
None
:
raise
ValueError
(
"The shape of Parameter should not be None"
)
...
...
@@ -6908,7 +6905,7 @@ class Parameter(Variable, metaclass=ParameterMetaClass):
shape
=
shape
,
dtype
=
dtype
,
type
=
type
,
**
kwargs
**
kwargs
,
)
self
.
trainable
=
kwargs
.
get
(
'trainable'
,
True
)
...
...
python/paddle/fluid/incubate/fleet/utils/http_server.py
浏览文件 @
0edbd7a5
...
...
@@ -15,7 +15,6 @@
import
logging
# NOTE: HTTPServer has a different name in python2 and python3
from
http.server
import
HTTPServer
import
http.server
as
SimpleHTTPServer
import
time
...
...
python/paddle/fluid/multiprocess_utils.py
浏览文件 @
0edbd7a5
...
...
@@ -18,7 +18,6 @@ import atexit
from
.
import
core
# NOTE: queue has a different name in python2 and python3
import
queue
# multi-process worker check indices queue interval, avoid
...
...
python/paddle/fluid/reader.py
浏览文件 @
0edbd7a5
...
...
@@ -64,7 +64,6 @@ import os
import
multiprocessing
import
signal
# NOTE: queue has a different name in python2 and python3
import
queue
# NOTE: [ avoid hanging & failed quickly ] These value is used in getting data from another process
...
...
tools/sampcd_processor.py
浏览文件 @
0edbd7a5
...
...
@@ -16,7 +16,7 @@ please make sure to run in the tools path
usage: python sample_test.py {cpu or gpu}
{cpu or gpu}: running in cpu version or gpu version
for example, you can run cpu version
python2
testing like this:
for example, you can run cpu version testing like this:
python sampcd_processor.py cpu
...
...
tools/test_print_signatures.py
浏览文件 @
0edbd7a5
...
...
@@ -67,9 +67,7 @@ class Test_is_primitive(unittest.TestCase):
self
.
assertTrue
(
is_primitive
(
2
))
self
.
assertTrue
(
is_primitive
(
2.1
))
self
.
assertTrue
(
is_primitive
(
"2.1.1"
))
self
.
assertFalse
(
is_primitive
(
"hello paddle"
.
encode
(
'UTF-8'
))
)
# True for python2
self
.
assertFalse
(
is_primitive
(
"hello paddle"
.
encode
(
'UTF-8'
)))
self
.
assertFalse
(
is_primitive
(
1j
))
self
.
assertTrue
(
is_primitive
(
True
))
...
...
@@ -80,7 +78,7 @@ class Test_is_primitive(unittest.TestCase):
self
.
assertTrue
(
is_primitive
([
1
,
2
]))
self
.
assertTrue
(
is_primitive
((
1.1
,
2.2
)))
self
.
assertTrue
(
is_primitive
(
set
([
1
,
2.3
])))
self
.
assertFalse
(
is_primitive
(
range
(
3
)))
# True for python2
self
.
assertFalse
(
is_primitive
(
range
(
3
)))
self
.
assertFalse
(
is_primitive
({}))
self
.
assertFalse
(
is_primitive
([
1
,
1j
]))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录