Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MindSpore
akg
提交
64cc6350
A
akg
项目概览
MindSpore
/
akg
通知
51
Star
7
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
akg
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
64cc6350
编写于
6月 22, 2020
作者:
W
wangzhuo325
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
matmul code refactor
上级
19e5b2ac
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
7 addition
and
8 deletion
+7
-8
python/akg/ops/nn/matmul.py
python/akg/ops/nn/matmul.py
+2
-3
tests/common/test_op/matmul4d_ad.py
tests/common/test_op/matmul4d_ad.py
+1
-1
tests/common/test_run/matmul_run.py
tests/common/test_run/matmul_run.py
+3
-3
tests/fuzz/tune/autotuning/kernel_compiler.py
tests/fuzz/tune/autotuning/kernel_compiler.py
+1
-1
未找到文件。
tests/common/test_op
/matmul.py
→
python/akg/ops/nn
/matmul.py
浏览文件 @
64cc6350
...
...
@@ -33,7 +33,7 @@ matmul_set_dim_map = {
}
def
matmul_set_dim
(
A
,
B
,
b
,
out_dtype
,
left_format
,
right_format
,
output_format
,
adj_x
,
adj_y
,
has_bias
,
attrs
):
def
matmul_set_dim
(
A
,
B
,
b
,
out_dtype
,
left_format
,
right_format
,
output_format
,
adj_x
,
adj_y
,
attrs
):
shape_A
=
A
.
shape
shape_B
=
B
.
shape
bias
=
0
if
b
is
None
else
1
...
...
@@ -259,7 +259,7 @@ def matmul4D_compute(x, y, bias_value, out_dtype, left_format, right_format, out
@
ct_util
.
reg_set_dim_func
(
matmul_set_dim
)
def
matmul
(
x
,
y
,
b
,
out_dtype
,
left_format
=
"zZ"
,
right_format
=
"nZ"
,
out_format
=
"zN"
,
transpose_x
=
False
,
transpose_y
=
False
,
has_bias
=
False
,
attrs
=
None
):
def
matmul
(
x
,
y
,
b
,
out_dtype
,
left_format
=
"zZ"
,
right_format
=
"nZ"
,
out_format
=
"zN"
,
transpose_x
=
False
,
transpose_y
=
False
,
attrs
=
None
):
"""
Computes matrix multiplication x * y + b.
...
...
@@ -273,7 +273,6 @@ def matmul(x, y, b, out_dtype, left_format="zZ", right_format="nZ", out_format="
out_format: str. Data format of output tensor. Supported data format list ["zZ", "nZ", "zN"].
transpose_x: Boolean. Specifies whether x is transposed or not.
transpose_y: Boolean. Specifies whether y is transposed or not.
has_bias: Boolean. Specifies whether bias tensor exists or not.
attrs: Dict. Used in matmul computation.
Note:
...
...
tests/common/test_op/matmul4d_ad.py
浏览文件 @
64cc6350
...
...
@@ -15,7 +15,7 @@
"""operator dsl function: matmul4d_ad"""
import
akg.tvm
import
akg
from
test_op
import
matmul
from
akg.ops.nn
import
matmul
from
akg.utils
import
custom_tiling
as
ct_util
...
...
tests/common/test_run/matmul_run.py
浏览文件 @
64cc6350
...
...
@@ -19,7 +19,7 @@ from gen_random import random_gaussian
import
numpy
as
np
import
akg.backend
as
cce
from
akg.utils
import
kernel_exec
as
utils
from
test_op
import
matmul
from
akg.ops.nn
import
matmul
from
base
import
get_rtol_atol
from
tensorio
import
compare_tensor
...
...
@@ -353,9 +353,9 @@ def matmul_compile(shape_x, shape_y, bias, left_format, right_format, output_for
has_bias
=
False
if
bias
==
1
:
has_bias
=
True
op_attrs
=
[
out_dtype
,
left_format
,
right_format
,
output_format
,
adj_x
,
adj_y
,
has_bias
,
attrs
]
op_attrs
=
[
out_dtype
,
left_format
,
right_format
,
output_format
,
adj_x
,
adj_y
,
attrs
]
if
has_bias
==
False
:
input_shapes
=
[
shape_xx
,
shape_yy
]
input_types
=
[
dtype
,
dtype
]
op_attrs
=
[
None
,
out_dtype
,
left_format
,
right_format
,
output_format
,
adj_x
,
adj_y
,
has_bias
,
attrs
]
op_attrs
=
[
None
,
out_dtype
,
left_format
,
right_format
,
output_format
,
adj_x
,
adj_y
,
attrs
]
return
utils
.
op_build_test
(
matmul
.
matmul
,
input_shapes
,
input_types
,
op_attrs
,
kernel_name
,
attrs
)
tests/fuzz/tune/autotuning/kernel_compiler.py
浏览文件 @
64cc6350
...
...
@@ -21,7 +21,7 @@ from akg.utils import custom_tiling as ct_util
from
akg.ops.nn
import
conv_bn1
from
akg.ops.nn
import
conv
,
conv_backprop_input
,
conv_backprop_filter
,
batchmatmul
from
akg.backend
import
build_module
from
test_op
import
matmul
from
akg.ops.nn
import
matmul
from
test_run
import
batchmatmul_run
,
matmul_run
from
.type_definitions
import
ConvDesc
,
ConvBackpropDesc
,
MatmulCubeDesc
,
ConvConfig
,
ConvBackpropInputConfig
,
ConvBackpropFilterConfig
,
MatmulCubeConfig
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录