Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
ea545dc5
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看板
提交
ea545dc5
编写于
7月 25, 2020
作者:
M
mindspore-ci-bot
提交者:
Gitee
7月 25, 2020
浏览文件
操作
浏览文件
下载
差异文件
!3403 fix bug of ConvertData in data_converter.cc
Merge pull request !3403 from fary86/fix_bug_of_ConvertData
上级
8f10a847
af22653b
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
11 addition
and
34 deletion
+11
-34
mindspore/ccsrc/pipeline/jit/init.cc
mindspore/ccsrc/pipeline/jit/init.cc
+1
-3
mindspore/ccsrc/pipeline/jit/parse/data_converter.cc
mindspore/ccsrc/pipeline/jit/parse/data_converter.cc
+5
-5
mindspore/ccsrc/pipeline/jit/pipeline.cc
mindspore/ccsrc/pipeline/jit/pipeline.cc
+1
-1
mindspore/ccsrc/pipeline/jit/pipeline_ge.cc
mindspore/ccsrc/pipeline/jit/pipeline_ge.cc
+1
-1
mindspore/ccsrc/pybind_api/export_flags.cc
mindspore/ccsrc/pybind_api/export_flags.cc
+0
-5
mindspore/ccsrc/pybind_api/export_flags.h
mindspore/ccsrc/pybind_api/export_flags.h
+0
-5
mindspore/ccsrc/utils/convert_utils.cc
mindspore/ccsrc/utils/convert_utils.cc
+1
-2
mindspore/ccsrc/utils/symbolic.h
mindspore/ccsrc/utils/symbolic.h
+0
-2
mindspore/core/ir/dtype/type.h
mindspore/core/ir/dtype/type.h
+0
-2
mindspore/core/ir/dtype_py.cc
mindspore/core/ir/dtype_py.cc
+0
-1
mindspore/core/ir/func_graph_py.cc
mindspore/core/ir/func_graph_py.cc
+1
-1
mindspore/core/ir/meta_func_graph.h
mindspore/core/ir/meta_func_graph.h
+1
-1
mindspore/core/ir/meta_tensor.h
mindspore/core/ir/meta_tensor.h
+0
-1
mindspore/core/ir/tensor.h
mindspore/core/ir/tensor.h
+0
-2
mindspore/core/ir/tensor_py.cc
mindspore/core/ir/tensor_py.cc
+0
-2
未找到文件。
mindspore/ccsrc/pipeline/jit/init.cc
浏览文件 @
ea545dc5
...
...
@@ -81,9 +81,7 @@ PYBIND11_MODULE(_c_expression, m) {
.
def
(
"has_compiled"
,
&
ExecutorPy
::
HasCompiled
,
py
::
arg
(
"phase"
)
=
py
::
str
(
""
),
"get if cell compiled."
)
.
def
(
"run_init_graph"
,
&
ExecutorPy
::
RunInitGraph
,
"Run init Graph."
);
(
void
)
py
::
class_
<
EnvInstance
,
std
::
shared_ptr
<
EnvInstance
>>
(
m
,
"EnvInstance_"
)
.
def_readonly
(
mindspore
::
PYTHON_ENVINSTANCE_FLAG
,
&
mindspore
::
EnvInstance
::
parse_info_
)
.
def
(
py
::
init
());
(
void
)
py
::
class_
<
EnvInstance
,
std
::
shared_ptr
<
EnvInstance
>>
(
m
,
"EnvInstance_"
).
def
(
py
::
init
());
(
void
)
m
.
def
(
"generate_key"
,
&
mindspore
::
pipeline
::
GenerateKey
,
"Generate the function graph key."
);
(
void
)
m
.
def
(
"real_run_op"
,
&
mindspore
::
pynative
::
RunOp
,
"Run op pynatively."
);
...
...
mindspore/ccsrc/pipeline/jit/parse/data_converter.cc
浏览文件 @
ea545dc5
...
...
@@ -361,15 +361,15 @@ bool ConvertData(const py::object &obj, ValuePtr *const data, bool use_signature
ConvertDataClass
(
obj
,
&
converted
);
}
else
if
(
py
::
hasattr
(
obj
,
PYTHON_PRIMITIVE_FLAG
))
{
ret
=
ConvertPrimitive
(
obj
,
&
converted
,
use_signature
);
}
else
if
(
py
::
hasattr
(
obj
,
PYTHON_METAFUNCGRAPH_FLAG
))
{
}
else
if
(
py
::
isinstance
<
MetaFuncGraph
>
(
obj
))
{
ret
=
ConvertMetaFuncGraph
(
obj
,
&
converted
,
use_signature
);
}
else
if
(
py
::
hasattr
(
obj
,
PYTHON_DTYPE_FLAG
))
{
}
else
if
(
py
::
isinstance
<
Type
>
(
obj
))
{
ret
=
ConvertDataType
(
obj
,
&
converted
);
}
else
if
(
py
::
hasattr
(
obj
,
PYTHON_TENSOR_FLAG
))
{
}
else
if
(
py
::
isinstance
<
Tensor
>
(
obj
))
{
ret
=
ConvertTensor
(
obj
,
&
converted
);
}
else
if
(
py
::
hasattr
(
obj
,
PYTHON_META_TENSOR_FLAG
))
{
}
else
if
(
py
::
isinstance
<
MetaTensor
>
(
obj
))
{
ret
=
ConvertMetaTensor
(
obj
,
&
converted
);
}
else
if
(
py
::
hasattr
(
obj
,
PYTHON_ENVINSTANCE_FLAG
))
{
}
else
if
(
py
::
isinstance
<
EnvInstance
>
(
obj
))
{
std
::
shared_ptr
<
EnvInstance
>
env
=
obj
.
cast
<
std
::
shared_ptr
<
EnvInstance
>>
();
converted
=
env
;
}
else
if
(
py
::
hasattr
(
obj
,
PYTHON_CLASS_MEMBER_NAMESPACE
))
{
...
...
mindspore/ccsrc/pipeline/jit/pipeline.cc
浏览文件 @
ea545dc5
...
...
@@ -125,7 +125,7 @@ py::bool_ VerifyInputSignature(const py::list input_signature, const py::tuple i
size_t
count
=
0
;
for
(
auto
arg_obj
:
inputs
)
{
if
(
py
::
hasattr
(
arg_obj
,
PYTHON_TENSOR_FLAG
))
{
if
(
py
::
isinstance
<
Tensor
>
(
arg_obj
))
{
MS_LOG
(
DEBUG
)
<<
"Verify Tensor"
;
std
::
shared_ptr
<
Tensor
>
m_tensor
=
arg_obj
.
cast
<
std
::
shared_ptr
<
Tensor
>>
();
if
(
m_tensor
==
nullptr
)
{
...
...
mindspore/ccsrc/pipeline/jit/pipeline_ge.cc
浏览文件 @
ea545dc5
...
...
@@ -161,7 +161,7 @@ void ConvertObjectToTensors(const py::dict &dict, TensorOrderMap *const tensors)
// convert int to tensor with shape([1])
tensor
=
std
::
make_shared
<
Tensor
>
(
kNumberTypeInt32
,
std
::
vector
<
int
>
({
1
}));
*
(
static_cast
<
float
*>
(
tensor
->
data_c
()))
=
py
::
cast
<
float
>
(
item
.
second
.
attr
(
"default_input"
));
}
else
if
(
py
::
hasattr
(
item
.
second
.
attr
(
"default_input"
),
PYTHON_TENSOR_FLAG
))
{
}
else
if
(
py
::
isinstance
<
Tensor
>
(
item
.
second
.
attr
(
"default_input"
)
))
{
// cast tensor
tensor
=
py
::
cast
<
std
::
shared_ptr
<
Tensor
>>
(
item
.
second
.
attr
(
"default_input"
));
}
...
...
mindspore/ccsrc/pybind_api/export_flags.cc
浏览文件 @
ea545dc5
...
...
@@ -18,11 +18,6 @@
namespace
mindspore
{
const
char
PYTHON_PRIMITIVE_FLAG
[]
=
"__primitive_flag__"
;
const
char
PYTHON_METAFUNCGRAPH_FLAG
[]
=
"__metafuncgraph_flag__"
;
const
char
PYTHON_TENSOR_FLAG
[]
=
"__tensor_flag__"
;
const
char
PYTHON_META_TENSOR_FLAG
[]
=
"__meta_tensor_flag__"
;
const
char
PYTHON_ENVINSTANCE_FLAG
[]
=
"__envinstance_flag__"
;
const
char
PYTHON_DTYPE_FLAG
[]
=
"__dtype_flag__"
;
const
char
PYTHON_CELL_AS_LIST
[]
=
"__cell_as_list__"
;
const
char
PYTHON_DATACLASS_FIELDS
[]
=
"__dataclass_fields__"
;
const
char
PYTHON_CLASS_MEMBER_NAMESPACE
[]
=
"__class_member_namespace__"
;
...
...
mindspore/ccsrc/pybind_api/export_flags.h
浏览文件 @
ea545dc5
...
...
@@ -20,11 +20,6 @@
namespace
mindspore
{
extern
const
char
PYTHON_PRIMITIVE_FLAG
[];
extern
const
char
PYTHON_METAFUNCGRAPH_FLAG
[];
extern
const
char
PYTHON_TENSOR_FLAG
[];
extern
const
char
PYTHON_META_TENSOR_FLAG
[];
extern
const
char
PYTHON_ENVINSTANCE_FLAG
[];
extern
const
char
PYTHON_DTYPE_FLAG
[];
extern
const
char
PYTHON_CELL_AS_LIST
[];
extern
const
char
PYTHON_DATACLASS_FIELDS
[];
extern
const
char
PYTHON_CLASS_MEMBER_NAMESPACE
[];
...
...
mindspore/ccsrc/utils/convert_utils.cc
浏览文件 @
ea545dc5
...
...
@@ -367,8 +367,7 @@ py::object VectorRefToPyData(const VectorRef &value_list) {
}
AbstractBasePtr
PyListDtype2AbstractTensor
(
const
py
::
object
&
shape_obj
,
const
py
::
object
&
type_obj
)
{
if
((
py
::
isinstance
<
py
::
list
>
(
shape_obj
)
||
py
::
isinstance
<
py
::
tuple
>
(
shape_obj
))
&&
py
::
hasattr
(
type_obj
,
PYTHON_DTYPE_FLAG
))
{
if
((
py
::
isinstance
<
py
::
list
>
(
shape_obj
)
||
py
::
isinstance
<
py
::
tuple
>
(
shape_obj
))
&&
py
::
isinstance
<
Type
>
(
type_obj
))
{
auto
ret_vec
=
shape_obj
.
cast
<
std
::
vector
<
int
>>
();
auto
ret_dtype
=
type_obj
.
cast
<
TypePtr
>
();
MS_EXCEPTION_IF_NULL
(
ret_dtype
);
...
...
mindspore/ccsrc/utils/symbolic.h
浏览文件 @
ea545dc5
...
...
@@ -162,8 +162,6 @@ class EnvInstance : public Value {
return
Len
();
}
const
bool
parse_info_
=
true
;
private:
EnvInstanceContentsMap
contents_
;
};
...
...
mindspore/core/ir/dtype/type.h
浏览文件 @
ea545dc5
...
...
@@ -84,8 +84,6 @@ class Type : public Value {
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
Type
&
type
);
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
TypePtr
type
);
const
bool
parse_info_
=
true
;
private:
TypeId
meta_type_
;
bool
is_generic_
;
...
...
mindspore/core/ir/dtype_py.cc
浏览文件 @
ea545dc5
...
...
@@ -35,7 +35,6 @@ REGISTER_PYBIND_DEFINE(
"dump_type"
,
[](
const
TypePtr
&
t
)
{
return
t
->
type_id
();
},
"dump type"
);
(
void
)
m_sub
.
def
(
"str_to_type"
,
&
StringToType
,
"string to typeptr"
);
(
void
)
py
::
class_
<
Type
,
std
::
shared_ptr
<
Type
>>
(
m_sub
,
"Type"
)
.
def_readonly
(
PYTHON_DTYPE_FLAG
,
&
mindspore
::
Type
::
parse_info_
)
.
def
(
"__eq__"
,
[](
const
TypePtr
&
t1
,
const
py
::
object
&
other
)
{
if
(
!
py
::
isinstance
<
Type
>
(
other
))
{
...
...
mindspore/core/ir/func_graph_py.cc
浏览文件 @
ea545dc5
...
...
@@ -24,7 +24,7 @@ namespace mindspore {
REGISTER_PYBIND_DEFINE
(
FuncGraph
,
([](
const
pybind11
::
module
*
m
)
{
// Define python "MetaFuncGraph_" class
(
void
)
py
::
class_
<
MetaFuncGraph
,
std
::
shared_ptr
<
MetaFuncGraph
>>
(
*
m
,
"MetaFuncGraph_"
)
.
def_readonly
(
PYTHON_METAFUNCGRAPH_FLAG
,
&
MetaFuncGraph
::
parse_info_
)
//
.def_readonly(PYTHON_METAFUNCGRAPH_FLAG, &MetaFuncGraph::parse_info_)
.
def
(
py
::
init
<
std
::
string
&>
());
// Define python "FuncGraph" class
(
void
)
py
::
class_
<
FuncGraph
,
FuncGraphPtr
>
(
*
m
,
"FuncGraph"
)
...
...
mindspore/core/ir/meta_func_graph.h
浏览文件 @
ea545dc5
...
...
@@ -72,7 +72,7 @@ class MetaFuncGraph : public FuncGraphBase {
return
false
;
}
}
const
bool
parse_info_
=
true
;
//
const bool parse_info_ = true;
protected:
template
<
typename
Derived
>
...
...
mindspore/core/ir/meta_tensor.h
浏览文件 @
ea545dc5
...
...
@@ -163,7 +163,6 @@ class MetaTensor : public Value {
return
false
;
}
}
const
bool
parse_info_
=
true
;
protected:
// brief Data type of the tensor.
...
...
mindspore/core/ir/tensor.h
浏览文件 @
ea545dc5
...
...
@@ -224,8 +224,6 @@ class Tensor : public MetaTensor {
std
::
string
id
()
const
{
return
id_
;
}
const
bool
parse_info_
=
true
;
private:
bool
init_flag_
{
false
};
TensorDataPtr
data_
{
nullptr
};
...
...
mindspore/core/ir/tensor_py.cc
浏览文件 @
ea545dc5
...
...
@@ -214,7 +214,6 @@ REGISTER_PYBIND_DEFINE(Tensor, ([](const py::module *m) {
// Define python MetaTensor class.
(
void
)
py
::
class_
<
MetaTensor
,
std
::
shared_ptr
<
MetaTensor
>>
(
*
m
,
"MetaTensor"
)
.
def
(
py
::
init
<
TypePtr
,
const
std
::
vector
<
int
>>
(),
py
::
arg
(
"dtype"
),
py
::
arg
(
"shape"
))
.
def_readonly
(
PYTHON_META_TENSOR_FLAG
,
&
MetaTensor
::
parse_info_
)
.
def_property_readonly
(
"dtype"
,
&
MetaTensor
::
Dtype
,
"Get the MetaTensor's dtype."
)
.
def_property_readonly
(
"shape"
,
&
MetaTensor
::
shape
,
"Get the MetaTensor's shape."
)
.
def
(
py
::
pickle
(
...
...
@@ -268,7 +267,6 @@ REGISTER_PYBIND_DEFINE(Tensor, ([](const py::module *m) {
return
TensorPy
::
MakeTensor
(
py
::
array
(
input
),
type_ptr
);
}),
py
::
arg
(
"input"
),
py
::
arg
(
"dtype"
)
=
nullptr
)
.
def_readonly
(
PYTHON_TENSOR_FLAG
,
&
Tensor
::
parse_info_
)
.
def_property
(
"init_flag"
,
&
Tensor
::
is_init
,
&
Tensor
::
set_init_flag
)
.
def_property_readonly
(
"dtype"
,
&
Tensor
::
Dtype
,
R"mydelimiter(
Get the tensor's data type.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录