Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
e1e11b84
M
mindspore
项目概览
magicwindyyd
/
mindspore
与 Fork 源项目一致
Fork自
MindSpore / mindspore
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindspore
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e1e11b84
编写于
4月 22, 2020
作者:
B
buxue
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix codedex
上级
4e85ca68
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
21 addition
and
13 deletion
+21
-13
mindspore/ccsrc/pipeline/pipeline.cc
mindspore/ccsrc/pipeline/pipeline.cc
+1
-1
mindspore/ccsrc/pipeline/pipeline_ge.cc
mindspore/ccsrc/pipeline/pipeline_ge.cc
+1
-1
mindspore/ccsrc/utils/contract.h
mindspore/ccsrc/utils/contract.h
+2
-0
mindspore/ccsrc/utils/profile.cc
mindspore/ccsrc/utils/profile.cc
+17
-11
未找到文件。
mindspore/ccsrc/pipeline/pipeline.cc
浏览文件 @
e1e11b84
...
...
@@ -584,7 +584,7 @@ void ExecutorPy::ProcessVmArg(const py::tuple &args, const std::string &phase, V
if
(
ms_context
->
backend_policy
()
==
kMsConvert
&&
py
::
isinstance
<
py
::
array
>
(
arg
))
{
MS_LOG
(
EXCEPTION
)
<<
"Args["
<<
i
<<
"] is numpy array, not tensor"
;
}
(
*
arg_list
).
push_back
(
arg
);
arg_list
->
push_back
(
arg
);
}
ResourcePtr
res
=
GetResource
(
phase
);
...
...
mindspore/ccsrc/pipeline/pipeline_ge.cc
浏览文件 @
e1e11b84
...
...
@@ -462,7 +462,7 @@ void ProcessGeArg(const std::map<std::string, ExecutorInfoPtr> &info, const py::
MS_LOG
(
EXCEPTION
)
<<
"Args convert error"
;
}
if
(
converted
->
isa
<
tensor
::
Tensor
>
())
{
(
*
inputs
).
push_back
(
converted
->
cast
<
tensor
::
TensorPtr
>
());
inputs
->
push_back
(
converted
->
cast
<
tensor
::
TensorPtr
>
());
}
else
{
MS_LOG
(
EXCEPTION
)
<<
"Args "
<<
converted
->
ToString
()
<<
" is not tensor"
;
}
...
...
mindspore/ccsrc/utils/contract.h
浏览文件 @
e1e11b84
...
...
@@ -28,6 +28,7 @@ class ContractError : public std::logic_error {
public:
explicit
ContractError
(
const
std
::
string
&
msg
)
:
std
::
logic_error
(
msg
)
{}
explicit
ContractError
(
const
char
*
msg
)
:
std
::
logic_error
(
msg
)
{}
~
ContractError
()
override
=
default
;
};
struct
Signatory
{
...
...
@@ -60,6 +61,7 @@ class Ensures : public EnsuresAccess<T, R> {
}
template
<
class
O
,
typename
=
std
::
enable_if_t
<
std
::
is_convertible_v
<
O
,
T
>
>>
Ensures
(
const
Ensures
<
O
,
R
>
&
other
)
:
value_
(
other
.
get
())
{}
~
Ensures
()
=
default
;
T
get
()
const
{
return
value_
;
}
T
&
get
()
{
return
value_
;
}
...
...
mindspore/ccsrc/utils/profile.cc
浏览文件 @
e1e11b84
...
...
@@ -38,26 +38,32 @@ void PrintProfile(std::ostringstream &oss, const TimeInfo &time_info, int indent
void
PrintTimeInfoMap
(
std
::
ostringstream
&
oss
,
const
TimeInfoMap
&
dict
,
int
indent
=
0
,
std
::
map
<
std
::
string
,
double
>
*
sums
=
nullptr
,
const
std
::
string
&
prefix
=
""
)
{
for
(
auto
iter
=
dict
.
begin
();
iter
!=
dict
.
end
();
++
iter
)
{
if
(
iter
->
second
==
nullptr
)
{
size_t
count
=
0
;
for
(
const
auto
&
iter
:
dict
)
{
count
++
;
if
(
iter
.
second
==
nullptr
)
{
continue
;
}
// indent by multiples of 4 spaces.
auto
name
=
iter
->
first
.
substr
(
TIME_INFO_PREFIX_NUM_LEN
);
if
(
iter
.
first
.
size
()
<
TIME_INFO_PREFIX_NUM_LEN
)
{
MS_LOG
(
EXCEPTION
)
<<
"In TimeInfoMap, the "
<<
count
<<
"th string key is "
<<
iter
.
first
<<
", but the length is less than "
<<
TIME_INFO_PREFIX_NUM_LEN
;
}
auto
name
=
iter
.
first
.
substr
(
TIME_INFO_PREFIX_NUM_LEN
);
oss
<<
std
::
setw
(
indent
*
4
)
<<
""
<<
"["
<<
name
<<
"]: "
<<
iter
->
second
->
time_
;
if
(
iter
->
second
->
dict_
!=
nullptr
)
{
oss
<<
", ["
<<
iter
->
second
->
dict_
->
size
()
<<
"]"
;
<<
"["
<<
name
<<
"]: "
<<
iter
.
second
->
time_
;
if
(
iter
.
second
->
dict_
!=
nullptr
)
{
oss
<<
", ["
<<
iter
.
second
->
dict_
->
size
()
<<
"]"
;
}
oss
<<
"
\n
"
;
std
::
string
newPrefix
=
prefix
;
if
(
iter
->
first
.
find
(
"Cycle "
)
==
std
::
string
::
npos
)
{
newPrefix
=
prefix
.
empty
()
?
iter
->
first
:
prefix
+
"."
+
iter
->
first
;
if
(
iter
.
first
.
find
(
"Cycle "
)
==
std
::
string
::
npos
)
{
newPrefix
=
prefix
.
empty
()
?
iter
.
first
:
prefix
+
"."
+
iter
.
first
;
}
PrintProfile
(
oss
,
*
iter
->
second
,
indent
+
1
,
sums
,
newPrefix
);
if
(
iter
->
second
->
dict_
==
nullptr
)
{
(
*
sums
)[
newPrefix
]
+=
iter
->
second
->
time_
;
PrintProfile
(
oss
,
*
iter
.
second
,
indent
+
1
,
sums
,
newPrefix
);
if
(
iter
.
second
->
dict_
==
nullptr
)
{
(
*
sums
)[
newPrefix
]
+=
iter
.
second
->
time_
;
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录