Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
8c888eea
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2297
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,发现更多精彩内容 >>
未验证
提交
8c888eea
编写于
3月 28, 2023
作者:
I
Infinity_lee
提交者:
GitHub
3月 28, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CodeStyle][UP024] Replace aliased errors with OSError (#52024)
上级
b166581a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
8 addition
and
8 deletion
+8
-8
python/paddle/distributed/fleet/meta_parallel/sharding/group_sharded_utils.py
...buted/fleet/meta_parallel/sharding/group_sharded_utils.py
+1
-1
python/paddle/jit/dy2static/convert_call_func.py
python/paddle/jit/dy2static/convert_call_func.py
+4
-4
tools/CrossStackProfiler/CspFileReader.py
tools/CrossStackProfiler/CspFileReader.py
+3
-3
未找到文件。
python/paddle/distributed/fleet/meta_parallel/sharding/group_sharded_utils.py
浏览文件 @
8c888eea
...
...
@@ -318,7 +318,7 @@ def cvt_to_device(x, dev_id, blocking=True):
elif
paddle
.
is_compiled_with_xpu
():
place
=
paddle
.
XPUPlace
(
dev_id
)
else
:
raise
Environment
Error
(
raise
OS
Error
(
"Only supported compiled paddle with gpu/rocm, npu and xpu , but current verison is compiled with cpu."
)
return
x
.
_copy_to
(
place
,
blocking
)
python/paddle/jit/dy2static/convert_call_func.py
浏览文件 @
8c888eea
...
...
@@ -288,7 +288,7 @@ def convert_call(func):
# If func is not in __globals__, it does not need to be transformed
# because it has been transformed before.
converted_call
=
None
except
(
IOError
,
OSError
)
:
except
OSError
:
# NOTE:
# If func has been decorated, its source code can not be get
# so that it can not be transformed to static function.
...
...
@@ -297,7 +297,7 @@ def convert_call(func):
try
:
converted_call
=
convert_to_static
(
func
)
func_self
=
getattr
(
func
,
'__self__'
,
None
)
except
(
IOError
,
OSError
)
:
except
OSError
:
# NOTE: func may have been decorated.
converted_call
=
None
...
...
@@ -313,7 +313,7 @@ def convert_call(func):
# So descriptor mechanism is used to bound `self` instance on function to
# keep it as bound method.
func
.
forward
=
forward_func
.
__get__
(
func
)
except
(
IOError
,
OSError
,
TypeError
):
except
(
OSError
,
TypeError
):
# NOTE: func.forward may have been decorated.
func_self
=
None
if
func_self
else
func_self
converted_call
=
func
...
...
@@ -322,7 +322,7 @@ def convert_call(func):
call_func
=
func
.
__class__
.
__call__
converted_call
=
convert_to_static
(
call_func
)
func_self
=
func
except
(
IOError
,
OSError
,
TypeError
):
except
(
OSError
,
TypeError
):
# NOTE:
# If `func` is a class which is being initialized, for example `convert_call(Foo)()`,
# it doesn't need to be transformed
...
...
tools/CrossStackProfiler/CspFileReader.py
浏览文件 @
8c888eea
...
...
@@ -139,7 +139,7 @@ class FileReader:
self
.
_checkArgsKey
(
"dataPath"
,
str
)
if
not
os
.
path
.
exists
(
self
.
_dataPath
):
raise
IO
Error
(
raise
OS
Error
(
"input data path [%s] not existed!"
%
(
self
.
_dataPath
)
)
...
...
@@ -220,7 +220,7 @@ class FileReader:
)
if
not
os
.
path
.
isfile
(
fileName
):
raise
IO
Error
(
"[%s] is not a valid file!"
%
(
fileName
))
raise
OS
Error
(
"[%s] is not a valid file!"
%
(
fileName
))
try
:
prefix_str
=
fileName
.
split
(
sed
)[
-
1
]
...
...
@@ -298,7 +298,7 @@ class FileReader:
def
getDict
(
self
,
name
,
groupId
,
gpuId
,
tmpPath
=
"./tmp"
):
fileName
=
self
.
getFileName
(
name
,
groupId
,
gpuId
,
tmpPath
)
if
not
os
.
path
.
isfile
(
fileName
):
raise
IO
Error
(
"[%s] is not existed!"
%
fileName
)
raise
OS
Error
(
"[%s] is not existed!"
%
fileName
)
data
=
{}
with
open
(
fileName
,
"r"
)
as
rf
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录