Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MegEngine 天元
MegEngine
提交
171c683d
MegEngine
项目概览
MegEngine 天元
/
MegEngine
接近 2 年 前同步成功
通知
414
Star
4708
Fork
583
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
MegEngine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
171c683d
编写于
6月 20, 2022
作者:
M
Megvii Engine Team
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
docs(api/lite): add struct python api desc
GitOrigin-RevId: 82f873b498497eafbf40eed6aa78ef036650cd89
上级
3cd54dd6
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
48 addition
and
18 deletion
+48
-18
lite/pylite/megenginelite/struct.py
lite/pylite/megenginelite/struct.py
+48
-18
未找到文件。
lite/pylite/megenginelite/struct.py
浏览文件 @
171c683d
...
@@ -6,10 +6,21 @@ from enum import Enum, IntEnum
...
@@ -6,10 +6,21 @@ from enum import Enum, IntEnum
class
LiteBackend
(
IntEnum
):
class
LiteBackend
(
IntEnum
):
"""
The backend type enum, default only
"""
LITE_DEFAULT
=
0
LITE_DEFAULT
=
0
class
LiteDeviceType
(
IntEnum
):
class
LiteDeviceType
(
IntEnum
):
"""
The backend device type enum
Note:
compute and storage will base on the device
"""
LITE_CPU
=
0
LITE_CPU
=
0
LITE_CUDA
=
1
LITE_CUDA
=
1
LITE_ATLAS
=
3
LITE_ATLAS
=
3
...
@@ -19,6 +30,13 @@ class LiteDeviceType(IntEnum):
...
@@ -19,6 +30,13 @@ class LiteDeviceType(IntEnum):
class
LiteDataType
(
IntEnum
):
class
LiteDataType
(
IntEnum
):
"""
The tensor data type enum
Note:
half for float16, int for int32
"""
LITE_FLOAT
=
0
LITE_FLOAT
=
0
LITE_HALF
=
1
LITE_HALF
=
1
LITE_INT
=
2
LITE_INT
=
2
...
@@ -29,6 +47,12 @@ class LiteDataType(IntEnum):
...
@@ -29,6 +47,12 @@ class LiteDataType(IntEnum):
class
LiteTensorPhase
(
IntEnum
):
class
LiteTensorPhase
(
IntEnum
):
"""
The tensor type enum
Note:
LITE_IO for both LITE_INPUT and LITE_OUTPUT
"""
LITE_IO
=
0
LITE_IO
=
0
LITE_INPUT
=
1
LITE_INPUT
=
1
LITE_OUTPUT
=
2
LITE_OUTPUT
=
2
...
@@ -36,7 +60,7 @@ class LiteTensorPhase(IntEnum):
...
@@ -36,7 +60,7 @@ class LiteTensorPhase(IntEnum):
class
LiteIOType
(
IntEnum
):
class
LiteIOType
(
IntEnum
):
"""
"""
the input and output type
, include SHAPE and VALUE
The input and output type enum
, include SHAPE and VALUE
sometimes user only need the shape of the output tensor
sometimes user only need the shape of the output tensor
"""
"""
...
@@ -46,26 +70,26 @@ class LiteIOType(IntEnum):
...
@@ -46,26 +70,26 @@ class LiteIOType(IntEnum):
class
LiteAlgoSelectStrategy
(
IntEnum
):
class
LiteAlgoSelectStrategy
(
IntEnum
):
"""
"""
operation algorithm seletion strategy type
, some operations have
Operation algorithm seletion strategy type enum
, some operations have
multi algorithms, different algorithm has different attribute, according to
multi algorithms, different algorithm has different attribute, according to
the strategy, the best algorithm will be selected.
the strategy, the best algorithm will be selected.
Note:
These strategies can be combined
Note:
These strategies can be combined
LITE_ALGO_HEURISTIC | LITE_ALGO_PROFILE means: if profile cache not valid,
LITE_ALGO_HEURISTIC | LITE_ALGO_PROFILE means: if profile cache not valid,
use heuristic instead
use heuristic instead
LITE_ALGO_HEURISTIC | LITE_ALGO_REPRODUCIBLE means: heuristic choice the
LITE_ALGO_HEURISTIC | LITE_ALGO_REPRODUCIBLE means: heuristic choice the
reproducible algo
reproducible algo
LITE_ALGO_PROFILE | LITE_ALGO_REPRODUCIBLE means: profile the best
LITE_ALGO_PROFILE | LITE_ALGO_REPRODUCIBLE means: profile the best
algorithm from the reproducible algorithms set
algorithm from the reproducible algorithms set
LITE_ALGO_PROFILE | LITE_ALGO_OPTIMIZED means: profile the best
LITE_ALGO_PROFILE | LITE_ALGO_OPTIMIZED means: profile the best
algorithm form the optimzed algorithms, thus profile will process fast
algorithm form the optimzed algorithms, thus profile will process fast
LITE_ALGO_PROFILE | LITE_ALGO_OPTIMIZED | LITE_ALGO_REPRODUCIBLE means:
LITE_ALGO_PROFILE | LITE_ALGO_OPTIMIZED | LITE_ALGO_REPRODUCIBLE means:
profile the best algorithm form the optimzed and reproducible algorithms
profile the best algorithm form the optimzed and reproducible algorithms
"""
"""
LITE_ALGO_HEURISTIC
=
1
LITE_ALGO_HEURISTIC
=
1
...
@@ -76,10 +100,16 @@ class LiteAlgoSelectStrategy(IntEnum):
...
@@ -76,10 +100,16 @@ class LiteAlgoSelectStrategy(IntEnum):
class
LiteLogLevel
(
IntEnum
):
class
LiteLogLevel
(
IntEnum
):
"""
"""
DEBUG: The most verbose level, printing debugging info
Log level enum
INFO: The default level
WARN: Printing warnings
Note:
ERROR: The least verbose level, printing errors only
DEBUG: The most verbose level, printing debugging info
INFO: The default level
WARN: Printing warnings
ERROR: The least verbose level, printing errors only
"""
"""
DEBUG
=
0
DEBUG
=
0
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录