Skip to content

Commit d498110

Browse files
authored
Merge pull request #1018 from WanliZhong:improve_matmul
Add test for MatMul with broadcast
2 parents eb32f6c + e169ddf commit d498110

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed
608 Bytes
Binary file not shown.
704 Bytes
Binary file not shown.

testdata/dnn/onnx/generate_onnx_models.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,6 +1204,10 @@ def generate_matmul_init(name, inputA, inputB):
12041204
inputB = np.random.randn(6, 2, 4, 5).astype(np.float32)
12051205
generate_matmul_init("matmul_4d_init", inputA, inputB)
12061206

1207+
inputA = np.random.randn(2, 3, 4, 5).astype(np.float32)
1208+
inputB = np.random.randn(3, 5, 6).astype(np.float32)
1209+
generate_matmul_init("matmul_init_bcast", inputA, inputB)
1210+
12071211
def generate_matmul_init_2(name, inputA, inputB):
12081212
outputY = inputA @ inputB
12091213
shapeA = inputA.shape
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
matmul_init_bcast:�
2+

3+
A
4+
Boutput"MatMulmatmul_init_bcast*�"xٺ�>*������>ǩ?3�1��9�r�޾���?�,?֞�>8E�<
5+
?�,��`=��"��*-?u�?ELU�d��>q鋿�᾿���>u�*>l�"?r�@h�q?��i�d��?�o���T�BBZ
6+
A
7+

8+

9+

10+

11+
Z
12+
B
13+

14+

15+
b
16+
output
17+

18+

19+

20+

21+
B

0 commit comments

Comments
 (0)