Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
0edbd7a5
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
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: |
...
@@ -5,7 +5,7 @@ exclude: |
paddle/fluid/framework/fleet/heter_ps/cudf/.+|
paddle/fluid/framework/fleet/heter_ps/cudf/.+|
paddle/fluid/distributed/ps/thirdparty/round_robin.h|
paddle/fluid/distributed/ps/thirdparty/round_robin.h|
python/paddle/utils/gast/.+|
python/paddle/utils/gast/.+|
.+_p
y
2\.py|
.+_p
b
2\.py|
python/paddle/fluid/tests/unittests/npu/.+|
python/paddle/fluid/tests/unittests/npu/.+|
python/paddle/fluid/tests/unittests/mlu/.+
python/paddle/fluid/tests/unittests/mlu/.+
)$
)$
...
...
python/paddle/distributed/fleet/utils/http_server.py
浏览文件 @
0edbd7a5
...
@@ -16,8 +16,6 @@
...
@@ -16,8 +16,6 @@
import
http.server
as
SimpleHTTPServer
import
http.server
as
SimpleHTTPServer
import
logging
import
logging
import
threading
import
threading
# NOTE: HTTPServer has a different name in python2 and python3
from
http.server
import
HTTPServer
from
http.server
import
HTTPServer
__all__
=
[]
__all__
=
[]
...
...
python/paddle/fluid/dataloader/dataloader_iter.py
浏览文件 @
0edbd7a5
...
@@ -28,7 +28,6 @@ from paddle.fluid.framework import (
...
@@ -28,7 +28,6 @@ from paddle.fluid.framework import (
set_flags
,
set_flags
,
)
)
# NOTE: queue has a different name in python2 and python3
import
queue
import
queue
import
paddle
import
paddle
...
...
python/paddle/fluid/dataloader/worker.py
浏览文件 @
0edbd7a5
...
@@ -28,7 +28,6 @@ from ..multiprocess_utils import (
...
@@ -28,7 +28,6 @@ from ..multiprocess_utils import (
from
..framework
import
_non_static_mode
,
_in_eager_without_dygraph_check
from
..framework
import
_non_static_mode
,
_in_eager_without_dygraph_check
from
.flat
import
_flatten_batch
from
.flat
import
_flatten_batch
# NOTE: queue has a different name in python2 and python3
import
queue
import
queue
__all__
=
[
'get_worker_info'
]
__all__
=
[
'get_worker_info'
]
...
...
python/paddle/fluid/dygraph/checkpoint.py
浏览文件 @
0edbd7a5
...
@@ -248,7 +248,6 @@ def load_dygraph(model_path, **configs):
...
@@ -248,7 +248,6 @@ def load_dygraph(model_path, **configs):
)
)
# 2. load layer parameters & buffers
# 2. load layer parameters & buffers
# NOTE: using fluid.dygraph.guard() here will cause import error in py2
with
guard
():
with
guard
():
persistable_var_dict
=
_construct_params_and_buffers
(
persistable_var_dict
=
_construct_params_and_buffers
(
model_prefix
,
model_prefix
,
...
...
python/paddle/fluid/framework.py
浏览文件 @
0edbd7a5
...
@@ -1290,7 +1290,7 @@ def _varbase_creator(
...
@@ -1290,7 +1290,7 @@ def _varbase_creator(
shape
=
None
,
shape
=
None
,
dtype
=
None
,
dtype
=
None
,
persistable
=
None
,
persistable
=
None
,
**
kwargs
**
kwargs
,
):
):
if
dtype
is
not
None
:
if
dtype
is
not
None
:
if
not
isinstance
(
dtype
,
core
.
VarDesc
.
VarType
):
if
not
isinstance
(
dtype
,
core
.
VarDesc
.
VarType
):
...
@@ -1412,7 +1412,7 @@ class Variable(metaclass=VariableMetaClass):
...
@@ -1412,7 +1412,7 @@ class Variable(metaclass=VariableMetaClass):
is_data
=
False
,
is_data
=
False
,
need_check_feed
=
False
,
need_check_feed
=
False
,
belong_to_optimizer
=
False
,
belong_to_optimizer
=
False
,
**
kwargs
**
kwargs
,
):
):
self
.
block
=
block
self
.
block
=
block
if
name
is
None
:
if
name
is
None
:
...
@@ -2953,11 +2953,8 @@ class Operator:
...
@@ -2953,11 +2953,8 @@ class Operator:
in_arg_names
.
append
(
arg
.
name
)
in_arg_names
.
append
(
arg
.
name
)
else
:
else
:
raise
TypeError
(
raise
TypeError
(
"The type of '%s' in operator %s should be "
f
"The type of '%
{
in_proto
.
name
}
' in operator
{
type
}
should be "
"one of [basestring(), str, Varibale] in python2, "
f
"one of [str, bytes, Variable]. but received :
{
arg
}
"
"or one of [str, bytes, Variable] in python3."
"but received : %s"
%
(
in_proto
.
name
,
type
,
arg
)
)
)
self
.
desc
.
set_input
(
in_proto
.
name
,
in_arg_names
)
self
.
desc
.
set_input
(
in_proto
.
name
,
in_arg_names
)
else
:
else
:
...
@@ -6887,7 +6884,7 @@ class Parameter(Variable, metaclass=ParameterMetaClass):
...
@@ -6887,7 +6884,7 @@ class Parameter(Variable, metaclass=ParameterMetaClass):
shape
,
shape
,
dtype
,
dtype
,
type
=
core
.
VarDesc
.
VarType
.
LOD_TENSOR
,
type
=
core
.
VarDesc
.
VarType
.
LOD_TENSOR
,
**
kwargs
**
kwargs
,
):
):
if
shape
is
None
:
if
shape
is
None
:
raise
ValueError
(
"The shape of Parameter should not be None"
)
raise
ValueError
(
"The shape of Parameter should not be None"
)
...
@@ -6908,7 +6905,7 @@ class Parameter(Variable, metaclass=ParameterMetaClass):
...
@@ -6908,7 +6905,7 @@ class Parameter(Variable, metaclass=ParameterMetaClass):
shape
=
shape
,
shape
=
shape
,
dtype
=
dtype
,
dtype
=
dtype
,
type
=
type
,
type
=
type
,
**
kwargs
**
kwargs
,
)
)
self
.
trainable
=
kwargs
.
get
(
'trainable'
,
True
)
self
.
trainable
=
kwargs
.
get
(
'trainable'
,
True
)
...
...
python/paddle/fluid/incubate/fleet/utils/http_server.py
浏览文件 @
0edbd7a5
...
@@ -15,7 +15,6 @@
...
@@ -15,7 +15,6 @@
import
logging
import
logging
# NOTE: HTTPServer has a different name in python2 and python3
from
http.server
import
HTTPServer
from
http.server
import
HTTPServer
import
http.server
as
SimpleHTTPServer
import
http.server
as
SimpleHTTPServer
import
time
import
time
...
...
python/paddle/fluid/multiprocess_utils.py
浏览文件 @
0edbd7a5
...
@@ -18,7 +18,6 @@ import atexit
...
@@ -18,7 +18,6 @@ import atexit
from
.
import
core
from
.
import
core
# NOTE: queue has a different name in python2 and python3
import
queue
import
queue
# multi-process worker check indices queue interval, avoid
# multi-process worker check indices queue interval, avoid
...
...
python/paddle/fluid/reader.py
浏览文件 @
0edbd7a5
...
@@ -64,7 +64,6 @@ import os
...
@@ -64,7 +64,6 @@ import os
import
multiprocessing
import
multiprocessing
import
signal
import
signal
# NOTE: queue has a different name in python2 and python3
import
queue
import
queue
# NOTE: [ avoid hanging & failed quickly ] These value is used in getting data from another process
# 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
...
@@ -16,7 +16,7 @@ please make sure to run in the tools path
usage: python sample_test.py {cpu or gpu}
usage: python sample_test.py {cpu or gpu}
{cpu or gpu}: running in cpu version or gpu version
{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
python sampcd_processor.py cpu
...
...
tools/test_print_signatures.py
浏览文件 @
0edbd7a5
...
@@ -67,9 +67,7 @@ class Test_is_primitive(unittest.TestCase):
...
@@ -67,9 +67,7 @@ class Test_is_primitive(unittest.TestCase):
self
.
assertTrue
(
is_primitive
(
2
))
self
.
assertTrue
(
is_primitive
(
2
))
self
.
assertTrue
(
is_primitive
(
2.1
))
self
.
assertTrue
(
is_primitive
(
2.1
))
self
.
assertTrue
(
is_primitive
(
"2.1.1"
))
self
.
assertTrue
(
is_primitive
(
"2.1.1"
))
self
.
assertFalse
(
self
.
assertFalse
(
is_primitive
(
"hello paddle"
.
encode
(
'UTF-8'
)))
is_primitive
(
"hello paddle"
.
encode
(
'UTF-8'
))
)
# True for python2
self
.
assertFalse
(
is_primitive
(
1j
))
self
.
assertFalse
(
is_primitive
(
1j
))
self
.
assertTrue
(
is_primitive
(
True
))
self
.
assertTrue
(
is_primitive
(
True
))
...
@@ -80,7 +78,7 @@ class Test_is_primitive(unittest.TestCase):
...
@@ -80,7 +78,7 @@ class Test_is_primitive(unittest.TestCase):
self
.
assertTrue
(
is_primitive
([
1
,
2
]))
self
.
assertTrue
(
is_primitive
([
1
,
2
]))
self
.
assertTrue
(
is_primitive
((
1.1
,
2.2
)))
self
.
assertTrue
(
is_primitive
((
1.1
,
2.2
)))
self
.
assertTrue
(
is_primitive
(
set
([
1
,
2.3
])))
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
({}))
self
.
assertFalse
(
is_primitive
([
1
,
1j
]))
self
.
assertFalse
(
is_primitive
([
1
,
1j
]))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录