Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MegEngine 天元
MegEngine
提交
c90fa087
MegEngine
项目概览
MegEngine 天元
/
MegEngine
大约 1 年 前同步成功
通知
396
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c90fa087
编写于
7月 17, 2021
作者:
X
Xinda Huang
提交者:
huangxinda
7月 19, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test(mge): delete test_external.py
上级
b2944559
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
0 addition
and
54 deletion
+0
-54
imperative/python/test/unit/module/test_external.py
imperative/python/test/unit/module/test_external.py
+0
-54
未找到文件。
imperative/python/test/unit/module/test_external.py
已删除
100644 → 0
浏览文件 @
b2944559
# -*- coding: utf-8 -*-
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
import
io
import
os
import
platform
import
numpy
as
np
import
pytest
import
megengine
as
mge
import
megengine.utils.comp_graph_tools
as
cgtools
from
megengine
import
Tensor
from
megengine.distributed.helper
import
get_device_count_by_fork
from
megengine.jit
import
trace
from
megengine.module
import
Module
from
megengine.module.external
import
TensorrtRuntimeSubgraph
class
MyModule
(
Module
):
def
__init__
(
self
,
data
):
from
megengine.module.external
import
CambriconSubgraph
super
().
__init__
()
self
.
cambricon
=
CambriconSubgraph
(
data
,
"subnet0"
,
True
)
def
forward
(
self
,
inputs
):
out
=
self
.
cambricon
(
inputs
)
return
out
@
pytest
.
mark
.
skip
(
reason
=
"cambricon unimplemented"
)
def
test_cambricon_module
():
model
=
"CambriconRuntimeOprTest.MutableBatchSize.mlu"
model
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
model
)
with
open
(
model
,
"rb"
)
as
f
:
data
=
f
.
read
()
m
=
MyModule
(
data
)
inp
=
Tensor
(
np
.
random
.
normal
((
1
,
64
,
32
,
32
)).
astype
(
np
.
float16
),
device
=
"cambricon0"
)
def
inference
(
inps
):
pred
=
m
(
inps
)
return
pred
pred
=
inference
([
inp
])
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录