Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MegEngine 天元
MegEngine
提交
7bf1c38c
MegEngine
项目概览
MegEngine 天元
/
MegEngine
1 年多 前同步成功
通知
403
Star
4705
Fork
582
代码
文件
提交
分支
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看板
提交
7bf1c38c
编写于
7月 19, 2022
作者:
M
Megvii Engine Team
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(mgb/imperative): fix imperative code gen
GitOrigin-RevId: da9e8a280acff1295fb455676cb2063dcb493e53
上级
c49d3070
变更
5
展开全部
隐藏空白更改
内联
并排
Showing
5 changed file
with
112 addition
and
13 deletion
+112
-13
imperative/tablegen/generated/hash.txt
imperative/tablegen/generated/hash.txt
+5
-5
imperative/tablegen/generated/opdef.cpp.inl
imperative/tablegen/generated/opdef.cpp.inl
+27
-0
imperative/tablegen/generated/opdef.cpy.inl
imperative/tablegen/generated/opdef.cpy.inl
+53
-8
imperative/tablegen/generated/opdef.h.inl
imperative/tablegen/generated/opdef.h.inl
+9
-0
imperative/tablegen/generated/opdef.py.inl
imperative/tablegen/generated/opdef.py.inl
+18
-0
未找到文件。
imperative/tablegen/generated/hash.txt
浏览文件 @
7bf1c38c
0df57b38e71a4d1882ed6c24f3a26b57
../../dnn/scripts/opr_param_defs.py
905bdf78e5413b06873be64b4ba55db9
../../dnn/scripts/opr_param_defs.py
759bfbf27fd3f0dd6b6edf06377e1d6b ../../src/core/include/megbrain/ir/ops.td
c613316001b5f0294ede198f5563f041
generated/opdef.h.inl
a1f7f13c909f9d4c173277f4ed28fb61
generated/opdef.cpp.inl
cf48f9ca352fabaeb6c846c11c6b1662
generated/opdef.py.inl
12365b938f564e5b3639d309f7c83414
generated/opdef.cpy.inl
2a5851d0e2470d4d045811e7a20b1a3f
generated/opdef.h.inl
55b862badeed19aed8e84c5d6f468ff2
generated/opdef.cpp.inl
f3f4c7f0ee1b39392df8a679f6d22596
generated/opdef.py.inl
6b11ca844a7855fdc5eebffaf563a89c
generated/opdef.cpy.inl
71e1462bf4d882e2615c3c632cb671cc generated/enum_macro.h
imperative/tablegen/generated/opdef.cpp.inl
浏览文件 @
7bf1c38c
...
...
@@ -3067,6 +3067,15 @@ std::vector<std::pair<const char*, std::string>> Elemwise_props_impl(const OpDef
case Elemwise::Mode::COND_LT_MOV:
props_.emplace_back("mode", "COND_LT_MOV");
break;
case Elemwise::Mode::NEQ:
props_.emplace_back("mode", "NEQ");
break;
case Elemwise::Mode::ISNAN:
props_.emplace_back("mode", "ISNAN");
break;
case Elemwise::Mode::ISINF:
props_.emplace_back("mode", "ISINF");
break;
default:
props_.emplace_back("mode", "INVALID");
break;
...
...
@@ -3285,6 +3294,24 @@ std::vector<std::pair<const char*, std::string>> ElemwiseMultiType_props_impl(co
case ElemwiseMultiType::Mode::QCOND_LT_MOV:
props_.emplace_back("mode", "QCOND_LT_MOV");
break;
case ElemwiseMultiType::Mode::EQ:
props_.emplace_back("mode", "EQ");
break;
case ElemwiseMultiType::Mode::NEQ:
props_.emplace_back("mode", "NEQ");
break;
case ElemwiseMultiType::Mode::LT:
props_.emplace_back("mode", "LT");
break;
case ElemwiseMultiType::Mode::LEQ:
props_.emplace_back("mode", "LEQ");
break;
case ElemwiseMultiType::Mode::ISNAN:
props_.emplace_back("mode", "ISNAN");
break;
case ElemwiseMultiType::Mode::ISINF:
props_.emplace_back("mode", "ISINF");
break;
default:
props_.emplace_back("mode", "INVALID");
break;
...
...
imperative/tablegen/generated/opdef.cpy.inl
浏览文件 @
7bf1c38c
此差异已折叠。
点击以展开。
imperative/tablegen/generated/opdef.h.inl
浏览文件 @
7bf1c38c
...
...
@@ -780,6 +780,9 @@ case Elemwise::Mode::SILU_GRAD: return "SILU_GRAD";
case Elemwise::Mode::GELU: return "GELU";
case Elemwise::Mode::GELU_GRAD: return "GELU_GRAD";
case Elemwise::Mode::COND_LT_MOV: return "COND_LT_MOV";
case Elemwise::Mode::NEQ: return "NEQ";
case Elemwise::Mode::ISNAN: return "ISNAN";
case Elemwise::Mode::ISINF: return "ISINF";
default:
return "Elemwise::Mode::Unknown";
}
...
...
@@ -863,6 +866,12 @@ case ElemwiseMultiType::Mode::FUSE_MUL_ADD3_INT16xF32xF32xF32: return "FUSE_MUL_
case ElemwiseMultiType::Mode::MUL_INT16xF32xF32: return "MUL_INT16xF32xF32";
case ElemwiseMultiType::Mode::FUSE_MUL_ADD3_UINT8xF32xF32xF32: return "FUSE_MUL_ADD3_UINT8xF32xF32xF32";
case ElemwiseMultiType::Mode::QCOND_LT_MOV: return "QCOND_LT_MOV";
case ElemwiseMultiType::Mode::EQ: return "EQ";
case ElemwiseMultiType::Mode::NEQ: return "NEQ";
case ElemwiseMultiType::Mode::LT: return "LT";
case ElemwiseMultiType::Mode::LEQ: return "LEQ";
case ElemwiseMultiType::Mode::ISNAN: return "ISNAN";
case ElemwiseMultiType::Mode::ISINF: return "ISINF";
default:
return "ElemwiseMultiType::Mode::Unknown";
}
...
...
imperative/tablegen/generated/opdef.py.inl
浏览文件 @
7bf1c38c
...
...
@@ -893,6 +893,9 @@ py::enum_<Elemwise::Mode>(ElemwiseInst, "Mode")
.value("GELU", Elemwise::Mode::GELU)
.value("GELU_GRAD", Elemwise::Mode::GELU_GRAD)
.value("COND_LT_MOV", Elemwise::Mode::COND_LT_MOV)
.value("NEQ", Elemwise::Mode::NEQ)
.value("ISNAN", Elemwise::Mode::ISNAN)
.value("ISINF", Elemwise::Mode::ISINF)
.def(py::init([](const std::string& in) {
auto&& str = normalize_enum(in);
if (str == "RELU") return Elemwise::Mode::RELU;
...
...
@@ -956,6 +959,9 @@ py::enum_<Elemwise::Mode>(ElemwiseInst, "Mode")
if (str == "GELU") return Elemwise::Mode::GELU;
if (str == "GELU_GRAD") return Elemwise::Mode::GELU_GRAD;
if (str == "COND_LT_MOV") return Elemwise::Mode::COND_LT_MOV;
if (str == "NEQ") return Elemwise::Mode::NEQ;
if (str == "ISNAN") return Elemwise::Mode::ISNAN;
if (str == "ISINF") return Elemwise::Mode::ISINF;
throw py::cast_error("invalid enum value " + in);
}));
py::implicitly_convertible<std::string, Elemwise::Mode>();
...
...
@@ -1025,6 +1031,12 @@ py::enum_<ElemwiseMultiType::Mode>(ElemwiseMultiTypeInst, "Mode")
.value("MUL_INT16xF32xF32", ElemwiseMultiType::Mode::MUL_INT16xF32xF32)
.value("FUSE_MUL_ADD3_UINT8xF32xF32xF32", ElemwiseMultiType::Mode::FUSE_MUL_ADD3_UINT8xF32xF32xF32)
.value("QCOND_LT_MOV", ElemwiseMultiType::Mode::QCOND_LT_MOV)
.value("EQ", ElemwiseMultiType::Mode::EQ)
.value("NEQ", ElemwiseMultiType::Mode::NEQ)
.value("LT", ElemwiseMultiType::Mode::LT)
.value("LEQ", ElemwiseMultiType::Mode::LEQ)
.value("ISNAN", ElemwiseMultiType::Mode::ISNAN)
.value("ISINF", ElemwiseMultiType::Mode::ISINF)
.def(py::init([](const std::string& in) {
auto&& str = normalize_enum(in);
if (str == "FUSE_MUL_ADD3_INT16x32x32x32") return ElemwiseMultiType::Mode::FUSE_MUL_ADD3_INT16x32x32x32;
...
...
@@ -1085,6 +1097,12 @@ py::enum_<ElemwiseMultiType::Mode>(ElemwiseMultiTypeInst, "Mode")
if (str == "MUL_INT16xF32xF32") return ElemwiseMultiType::Mode::MUL_INT16xF32xF32;
if (str == "FUSE_MUL_ADD3_UINT8xF32xF32xF32") return ElemwiseMultiType::Mode::FUSE_MUL_ADD3_UINT8xF32xF32xF32;
if (str == "QCOND_LT_MOV") return ElemwiseMultiType::Mode::QCOND_LT_MOV;
if (str == "EQ") return ElemwiseMultiType::Mode::EQ;
if (str == "NEQ") return ElemwiseMultiType::Mode::NEQ;
if (str == "LT") return ElemwiseMultiType::Mode::LT;
if (str == "LEQ") return ElemwiseMultiType::Mode::LEQ;
if (str == "ISNAN") return ElemwiseMultiType::Mode::ISNAN;
if (str == "ISINF") return ElemwiseMultiType::Mode::ISINF;
throw py::cast_error("invalid enum value " + in);
}));
py::implicitly_convertible<std::string, ElemwiseMultiType::Mode>();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录