Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
4a759198
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看板
提交
4a759198
编写于
7月 10, 2020
作者:
H
He Wei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Isolate python dependence from some ir source files
上级
7cdd5581
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
184 addition
and
141 deletion
+184
-141
mindspore/ccsrc/ir/dtype_extends.cc
mindspore/ccsrc/ir/dtype_extends.cc
+0
-130
mindspore/ccsrc/ir/dtype_py.cc
mindspore/ccsrc/ir/dtype_py.cc
+155
-0
mindspore/ccsrc/ir/func_graph.cc
mindspore/ccsrc/ir/func_graph.cc
+0
-1
mindspore/ccsrc/ir/meta_func_graph.h
mindspore/ccsrc/ir/meta_func_graph.h
+0
-4
mindspore/ccsrc/ir/value_extends.cc
mindspore/ccsrc/ir/value_extends.cc
+0
-6
mindspore/ccsrc/ir/value_py.cc
mindspore/ccsrc/ir/value_py.cc
+29
-0
未找到文件。
mindspore/ccsrc/ir/dtype_extends.cc
浏览文件 @
4a759198
...
...
@@ -20,8 +20,6 @@
#include <algorithm>
#include "utils/log_adapter.h"
#include "pipeline/static_analysis/abstract_value.h"
#include "pybind_api/api_register.h"
#include "pybind_api/export_flags.h"
namespace
mindspore
{
TypePtr
TypeAnything
::
DeepCopy
()
const
{
return
kAnyType
;
}
...
...
@@ -425,134 +423,6 @@ bool IsSubType(TypePtr const &t1, TypePtr const &t2) {
}
}
REGISTER_PYBIND_DEFINE
(
typing
,
([](
py
::
module
*
const
m
)
{
auto
m_sub
=
m
->
def_submodule
(
"typing"
,
"submodule for dtype"
);
py
::
enum_
<
TypeId
>
(
m_sub
,
"TypeId"
);
(
void
)
m_sub
.
def
(
"is_subclass"
,
&
IsIdentidityOrSubclass
,
"is equal or subclass"
);
(
void
)
m_sub
.
def
(
"load_type"
,
&
TypeIdToType
,
"load type"
);
(
void
)
m_sub
.
def
(
"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
TypePtr
&
t2
)
{
if
(
t1
!=
nullptr
&&
t2
!=
nullptr
)
{
return
*
t1
==
*
t2
;
}
return
false
;
})
.
def
(
"__hash__"
,
&
Type
::
hash
)
.
def
(
"__str__"
,
&
Type
::
ToString
)
.
def
(
"__repr__"
,
&
Type
::
ReprString
)
.
def
(
"__deepcopy__"
,
[](
const
TypePtr
&
t
,
py
::
dict
)
{
if
(
t
==
nullptr
)
{
return
static_cast
<
TypePtr
>
(
nullptr
);
}
return
t
->
DeepCopy
();
});
(
void
)
py
::
class_
<
Number
,
Type
,
std
::
shared_ptr
<
Number
>>
(
m_sub
,
"Number"
).
def
(
py
::
init
());
(
void
)
py
::
class_
<
Bool
,
Type
,
std
::
shared_ptr
<
Bool
>>
(
m_sub
,
"Bool"
)
.
def
(
py
::
init
())
.
def
(
py
::
pickle
(
[](
const
Bool
&
)
{
// __getstate__
return
py
::
make_tuple
();
},
[](
const
py
::
tuple
&
)
{
// __setstate__
return
std
::
make_shared
<
Bool
>
();
}));
(
void
)
py
::
class_
<
Int
,
Type
,
std
::
shared_ptr
<
Int
>>
(
m_sub
,
"Int"
)
.
def
(
py
::
init
())
.
def
(
py
::
init
<
int
>
(),
py
::
arg
(
"nbits"
))
.
def
(
py
::
pickle
(
[](
const
Int
&
t
)
{
// __getstate__
/* Return a tuple that fully encodes the state of the object */
return
py
::
make_tuple
(
py
::
int_
(
t
.
nbits
()));
},
[](
const
py
::
tuple
&
t
)
{
// __setstate__
if
(
t
.
size
()
!=
1
)
{
throw
std
::
runtime_error
(
"Invalid state!"
);
}
/* Create a new C++ instance */
Int
data
(
t
[
0
].
cast
<
py
::
int_
>
());
return
data
;
}));
(
void
)
py
::
class_
<
UInt
,
Type
,
std
::
shared_ptr
<
UInt
>>
(
m_sub
,
"UInt"
)
.
def
(
py
::
init
())
.
def
(
py
::
init
<
int
>
(),
py
::
arg
(
"nbits"
))
.
def
(
py
::
pickle
(
[](
const
UInt
&
t
)
{
// __getstate__
/* Return a tuple that fully encodes the state of the object */
return
py
::
make_tuple
(
py
::
int_
(
t
.
nbits
()));
},
[](
const
py
::
tuple
&
t
)
{
// __setstate__
if
(
t
.
size
()
!=
1
)
{
throw
std
::
runtime_error
(
"Invalid state!"
);
}
/* Create a new C++ instance */
UInt
data
(
t
[
0
].
cast
<
py
::
int_
>
());
return
data
;
}));
(
void
)
py
::
class_
<
Float
,
Type
,
std
::
shared_ptr
<
Float
>>
(
m_sub
,
"Float"
)
.
def
(
py
::
init
())
.
def
(
py
::
init
<
int
>
(),
py
::
arg
(
"nbits"
))
.
def
(
py
::
pickle
(
[](
const
Float
&
t
)
{
// __getstate__
/* Return a tuple that fully encodes the state of the object */
return
py
::
make_tuple
(
py
::
int_
(
t
.
nbits
()));
},
[](
const
py
::
tuple
&
t
)
{
// __setstate__
if
(
t
.
size
()
!=
1
)
{
throw
std
::
runtime_error
(
"Invalid state!"
);
}
/* Create a new C++ instance */
Float
data
(
t
[
0
].
cast
<
py
::
int_
>
());
return
data
;
}));
(
void
)
py
::
class_
<
List
,
Type
,
std
::
shared_ptr
<
List
>>
(
m_sub
,
"List"
)
.
def
(
py
::
init
())
.
def
(
py
::
init
<
std
::
vector
<
TypePtr
>>
(),
py
::
arg
(
"elements"
));
(
void
)
py
::
class_
<
Tuple
,
Type
,
std
::
shared_ptr
<
Tuple
>>
(
m_sub
,
"Tuple"
)
.
def
(
py
::
init
())
.
def
(
py
::
init
<
std
::
vector
<
TypePtr
>>
(),
py
::
arg
(
"elements"
));
(
void
)
py
::
class_
<
TensorType
,
Type
,
std
::
shared_ptr
<
TensorType
>>
(
m_sub
,
"TensorType"
)
.
def
(
py
::
init
())
.
def
(
py
::
init
<
TypePtr
>
(),
py
::
arg
(
"element"
))
.
def
(
"element_type"
,
&
TensorType
::
element
)
.
def
(
py
::
pickle
(
[](
const
TensorType
&
t
)
{
// __getstate__
/* Return a tuple that fully encodes the state of the object */
return
py
::
make_tuple
(
py
::
int_
(
static_cast
<
int
>
(
t
.
element
()
->
type_id
())));
},
[](
const
py
::
tuple
&
t
)
{
// __setstate__
if
(
t
.
size
()
!=
1
)
{
throw
std
::
runtime_error
(
"Invalid state!"
);
}
/* Create a new C++ instance */
TensorType
data
(
TypeIdToType
(
TypeId
(
static_cast
<
int
>
(
t
[
0
].
cast
<
py
::
int_
>
()))));
return
data
;
}));
(
void
)
py
::
class_
<
IndexedSlicesType
,
Type
,
std
::
shared_ptr
<
IndexedSlicesType
>>
(
m_sub
,
"IndexedSlicesType"
)
.
def
(
py
::
init
());
(
void
)
py
::
class_
<
UndeterminedType
,
Type
,
std
::
shared_ptr
<
UndeterminedType
>>
(
m_sub
,
"UndeterminedType"
)
.
def
(
py
::
init
());
(
void
)
py
::
class_
<
Function
,
Type
,
std
::
shared_ptr
<
Function
>>
(
m_sub
,
"Function"
)
.
def
(
py
::
init
())
.
def
(
py
::
init
<
std
::
vector
<
TypePtr
>
,
TypePtr
>
(),
py
::
arg
(
"args"
),
py
::
arg
(
"retval"
));
(
void
)
py
::
class_
<
Class
,
Type
,
std
::
shared_ptr
<
Class
>>
(
m_sub
,
"Class"
).
def
(
py
::
init
());
(
void
)
py
::
class_
<
SymbolicKeyType
,
Type
,
std
::
shared_ptr
<
SymbolicKeyType
>>
(
m_sub
,
"SymbolicKeyType"
).
def
(
py
::
init
());
(
void
)
py
::
class_
<
EnvType
,
Type
,
std
::
shared_ptr
<
EnvType
>>
(
m_sub
,
"EnvType"
).
def
(
py
::
init
());
(
void
)
py
::
class_
<
TypeNone
,
Type
,
std
::
shared_ptr
<
TypeNone
>>
(
m_sub
,
"TypeNone"
).
def
(
py
::
init
());
(
void
)
py
::
class_
<
TypeType
,
Type
,
std
::
shared_ptr
<
TypeType
>>
(
m_sub
,
"TypeType"
).
def
(
py
::
init
());
(
void
)
py
::
class_
<
String
,
Type
,
std
::
shared_ptr
<
String
>>
(
m_sub
,
"String"
).
def
(
py
::
init
());
(
void
)
py
::
class_
<
RefKeyType
,
Type
,
std
::
shared_ptr
<
RefKeyType
>>
(
m_sub
,
"RefKeyType"
).
def
(
py
::
init
());
(
void
)
py
::
class_
<
RefType
,
Type
,
std
::
shared_ptr
<
RefType
>>
(
m_sub
,
"RefType"
).
def
(
py
::
init
());
(
void
)
py
::
class_
<
TypeAnything
,
Type
,
std
::
shared_ptr
<
TypeAnything
>>
(
m_sub
,
"TypeAnything"
).
def
(
py
::
init
());
(
void
)
py
::
class_
<
Slice
,
Type
,
std
::
shared_ptr
<
Slice
>>
(
m_sub
,
"Slice"
).
def
(
py
::
init
());
(
void
)
py
::
class_
<
TypeEllipsis
,
Type
,
std
::
shared_ptr
<
TypeEllipsis
>>
(
m_sub
,
"TypeEllipsis"
).
def
(
py
::
init
());
}));
const
TypePtr
kTypeExternal
=
std
::
make_shared
<
External
>
();
const
TypePtr
kTypeEnv
=
std
::
make_shared
<
EnvType
>
();
const
TypePtr
kTypeType
=
std
::
make_shared
<
TypeType
>
();
...
...
mindspore/ccsrc/ir/dtype_py.cc
0 → 100644
浏览文件 @
4a759198
/**
* Copyright 2020 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "ir/dtype.h"
#include <string>
#include <cstdlib>
#include <algorithm>
#include "utils/log_adapter.h"
#include "pipeline/static_analysis/abstract_value.h"
#include "pybind_api/api_register.h"
#include "pybind_api/export_flags.h"
namespace
mindspore
{
// Define python wrapper to handle data types.
REGISTER_PYBIND_DEFINE
(
typing
,
([](
py
::
module
*
const
m
)
{
auto
m_sub
=
m
->
def_submodule
(
"typing"
,
"submodule for dtype"
);
py
::
enum_
<
TypeId
>
(
m_sub
,
"TypeId"
);
(
void
)
m_sub
.
def
(
"is_subclass"
,
&
IsIdentidityOrSubclass
,
"is equal or subclass"
);
(
void
)
m_sub
.
def
(
"load_type"
,
&
TypeIdToType
,
"load type"
);
(
void
)
m_sub
.
def
(
"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
TypePtr
&
t2
)
{
if
(
t1
!=
nullptr
&&
t2
!=
nullptr
)
{
return
*
t1
==
*
t2
;
}
return
false
;
})
.
def
(
"__hash__"
,
&
Type
::
hash
)
.
def
(
"__str__"
,
&
Type
::
ToString
)
.
def
(
"__repr__"
,
&
Type
::
ReprString
)
.
def
(
"__deepcopy__"
,
[](
const
TypePtr
&
t
,
py
::
dict
)
{
if
(
t
==
nullptr
)
{
return
static_cast
<
TypePtr
>
(
nullptr
);
}
return
t
->
DeepCopy
();
});
(
void
)
py
::
class_
<
Number
,
Type
,
std
::
shared_ptr
<
Number
>>
(
m_sub
,
"Number"
).
def
(
py
::
init
());
(
void
)
py
::
class_
<
Bool
,
Type
,
std
::
shared_ptr
<
Bool
>>
(
m_sub
,
"Bool"
)
.
def
(
py
::
init
())
.
def
(
py
::
pickle
(
[](
const
Bool
&
)
{
// __getstate__
return
py
::
make_tuple
();
},
[](
const
py
::
tuple
&
)
{
// __setstate__
return
std
::
make_shared
<
Bool
>
();
}));
(
void
)
py
::
class_
<
Int
,
Type
,
std
::
shared_ptr
<
Int
>>
(
m_sub
,
"Int"
)
.
def
(
py
::
init
())
.
def
(
py
::
init
<
int
>
(),
py
::
arg
(
"nbits"
))
.
def
(
py
::
pickle
(
[](
const
Int
&
t
)
{
// __getstate__
/* Return a tuple that fully encodes the state of the object */
return
py
::
make_tuple
(
py
::
int_
(
t
.
nbits
()));
},
[](
const
py
::
tuple
&
t
)
{
// __setstate__
if
(
t
.
size
()
!=
1
)
{
throw
std
::
runtime_error
(
"Invalid state!"
);
}
/* Create a new C++ instance */
Int
data
(
t
[
0
].
cast
<
py
::
int_
>
());
return
data
;
}));
(
void
)
py
::
class_
<
UInt
,
Type
,
std
::
shared_ptr
<
UInt
>>
(
m_sub
,
"UInt"
)
.
def
(
py
::
init
())
.
def
(
py
::
init
<
int
>
(),
py
::
arg
(
"nbits"
))
.
def
(
py
::
pickle
(
[](
const
UInt
&
t
)
{
// __getstate__
/* Return a tuple that fully encodes the state of the object */
return
py
::
make_tuple
(
py
::
int_
(
t
.
nbits
()));
},
[](
const
py
::
tuple
&
t
)
{
// __setstate__
if
(
t
.
size
()
!=
1
)
{
throw
std
::
runtime_error
(
"Invalid state!"
);
}
/* Create a new C++ instance */
UInt
data
(
t
[
0
].
cast
<
py
::
int_
>
());
return
data
;
}));
(
void
)
py
::
class_
<
Float
,
Type
,
std
::
shared_ptr
<
Float
>>
(
m_sub
,
"Float"
)
.
def
(
py
::
init
())
.
def
(
py
::
init
<
int
>
(),
py
::
arg
(
"nbits"
))
.
def
(
py
::
pickle
(
[](
const
Float
&
t
)
{
// __getstate__
/* Return a tuple that fully encodes the state of the object */
return
py
::
make_tuple
(
py
::
int_
(
t
.
nbits
()));
},
[](
const
py
::
tuple
&
t
)
{
// __setstate__
if
(
t
.
size
()
!=
1
)
{
throw
std
::
runtime_error
(
"Invalid state!"
);
}
/* Create a new C++ instance */
Float
data
(
t
[
0
].
cast
<
py
::
int_
>
());
return
data
;
}));
(
void
)
py
::
class_
<
List
,
Type
,
std
::
shared_ptr
<
List
>>
(
m_sub
,
"List"
)
.
def
(
py
::
init
())
.
def
(
py
::
init
<
std
::
vector
<
TypePtr
>>
(),
py
::
arg
(
"elements"
));
(
void
)
py
::
class_
<
Tuple
,
Type
,
std
::
shared_ptr
<
Tuple
>>
(
m_sub
,
"Tuple"
)
.
def
(
py
::
init
())
.
def
(
py
::
init
<
std
::
vector
<
TypePtr
>>
(),
py
::
arg
(
"elements"
));
(
void
)
py
::
class_
<
TensorType
,
Type
,
std
::
shared_ptr
<
TensorType
>>
(
m_sub
,
"TensorType"
)
.
def
(
py
::
init
())
.
def
(
py
::
init
<
TypePtr
>
(),
py
::
arg
(
"element"
))
.
def
(
"element_type"
,
&
TensorType
::
element
)
.
def
(
py
::
pickle
(
[](
const
TensorType
&
t
)
{
// __getstate__
/* Return a tuple that fully encodes the state of the object */
return
py
::
make_tuple
(
py
::
int_
(
static_cast
<
int
>
(
t
.
element
()
->
type_id
())));
},
[](
const
py
::
tuple
&
t
)
{
// __setstate__
if
(
t
.
size
()
!=
1
)
{
throw
std
::
runtime_error
(
"Invalid state!"
);
}
/* Create a new C++ instance */
TensorType
data
(
TypeIdToType
(
TypeId
(
static_cast
<
int
>
(
t
[
0
].
cast
<
py
::
int_
>
()))));
return
data
;
}));
(
void
)
py
::
class_
<
IndexedSlicesType
,
Type
,
std
::
shared_ptr
<
IndexedSlicesType
>>
(
m_sub
,
"IndexedSlicesType"
)
.
def
(
py
::
init
());
(
void
)
py
::
class_
<
UndeterminedType
,
Type
,
std
::
shared_ptr
<
UndeterminedType
>>
(
m_sub
,
"UndeterminedType"
)
.
def
(
py
::
init
());
(
void
)
py
::
class_
<
Function
,
Type
,
std
::
shared_ptr
<
Function
>>
(
m_sub
,
"Function"
)
.
def
(
py
::
init
())
.
def
(
py
::
init
<
std
::
vector
<
TypePtr
>
,
TypePtr
>
(),
py
::
arg
(
"args"
),
py
::
arg
(
"retval"
));
(
void
)
py
::
class_
<
Class
,
Type
,
std
::
shared_ptr
<
Class
>>
(
m_sub
,
"Class"
).
def
(
py
::
init
());
(
void
)
py
::
class_
<
SymbolicKeyType
,
Type
,
std
::
shared_ptr
<
SymbolicKeyType
>>
(
m_sub
,
"SymbolicKeyType"
).
def
(
py
::
init
());
(
void
)
py
::
class_
<
EnvType
,
Type
,
std
::
shared_ptr
<
EnvType
>>
(
m_sub
,
"EnvType"
).
def
(
py
::
init
());
(
void
)
py
::
class_
<
TypeNone
,
Type
,
std
::
shared_ptr
<
TypeNone
>>
(
m_sub
,
"TypeNone"
).
def
(
py
::
init
());
(
void
)
py
::
class_
<
TypeType
,
Type
,
std
::
shared_ptr
<
TypeType
>>
(
m_sub
,
"TypeType"
).
def
(
py
::
init
());
(
void
)
py
::
class_
<
String
,
Type
,
std
::
shared_ptr
<
String
>>
(
m_sub
,
"String"
).
def
(
py
::
init
());
(
void
)
py
::
class_
<
RefKeyType
,
Type
,
std
::
shared_ptr
<
RefKeyType
>>
(
m_sub
,
"RefKeyType"
).
def
(
py
::
init
());
(
void
)
py
::
class_
<
RefType
,
Type
,
std
::
shared_ptr
<
RefType
>>
(
m_sub
,
"RefType"
).
def
(
py
::
init
());
(
void
)
py
::
class_
<
TypeAnything
,
Type
,
std
::
shared_ptr
<
TypeAnything
>>
(
m_sub
,
"TypeAnything"
).
def
(
py
::
init
());
(
void
)
py
::
class_
<
Slice
,
Type
,
std
::
shared_ptr
<
Slice
>>
(
m_sub
,
"Slice"
).
def
(
py
::
init
());
(
void
)
py
::
class_
<
TypeEllipsis
,
Type
,
std
::
shared_ptr
<
TypeEllipsis
>>
(
m_sub
,
"TypeEllipsis"
).
def
(
py
::
init
());
}));
}
// namespace mindspore
mindspore/ccsrc/ir/func_graph.cc
浏览文件 @
4a759198
...
...
@@ -25,7 +25,6 @@
#include "debug/trace.h"
#include "ir/manager.h"
#include "operator/ops.h"
#include "pybind_api/export_flags.h"
#include "utils/ordered_set.h"
#include "utils/convert_utils_base.h"
...
...
mindspore/ccsrc/ir/meta_func_graph.h
浏览文件 @
4a759198
...
...
@@ -26,16 +26,12 @@
#include <vector>
#include <algorithm>
#include "pybind11/pybind11.h"
#include "ir/dtype.h"
#include "ir/anf.h"
#include "ir/func_graph.h"
#include "ir/signature.h"
#include "pipeline/static_analysis/abstract_value.h"
namespace
py
=
pybind11
;
namespace
mindspore
{
// namespace to support intermediate representation definition
// Graph generator.
...
...
mindspore/ccsrc/ir/value_extends.cc
浏览文件 @
4a759198
...
...
@@ -20,7 +20,6 @@
#include <cmath>
#include <cfloat>
#include "pybind_api/api_register.h"
#include "pipeline/static_analysis/abstract_value.h"
namespace
mindspore
{
...
...
@@ -83,9 +82,4 @@ abstract::AbstractBasePtr ValueDictionary::ToAbstract() {
[](
const
std
::
pair
<
std
::
string
,
ValuePtr
>
&
item
)
{
return
std
::
make_pair
(
item
.
first
,
item
.
second
->
ToAbstract
());
});
return
std
::
make_shared
<
abstract
::
AbstractDictionary
>
(
kv
);
}
REGISTER_PYBIND_DEFINE
(
RefKey
,
([](
const
py
::
module
*
m
)
{
(
void
)
py
::
class_
<
RefKey
,
std
::
shared_ptr
<
RefKey
>>
(
*
m
,
"RefKey"
).
def
(
py
::
init
<
std
::
string
>
(),
py
::
arg
(
"tag"
));
}));
}
// namespace mindspore
mindspore/ccsrc/ir/value_py.cc
0 → 100644
浏览文件 @
4a759198
/**
* Copyright 2020 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "ir/value.h"
#include <string>
#include "pybind_api/api_register.h"
#include "pipeline/static_analysis/abstract_value.h"
namespace
mindspore
{
// Define python 'RefKey' class.
REGISTER_PYBIND_DEFINE
(
RefKey
,
([](
const
py
::
module
*
m
)
{
(
void
)
py
::
class_
<
RefKey
,
std
::
shared_ptr
<
RefKey
>>
(
*
m
,
"RefKey"
).
def
(
py
::
init
<
std
::
string
>
(),
py
::
arg
(
"tag"
));
}));
}
// namespace mindspore
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录