Skip to content

Commit c324ea9

Browse files
authored
Merge pull request #1106 from Abdurrahheem:ash/dev_einsum_ellips
Test case for Einsum ellipse functionality #1106 This PR contains test case for Einsum Ellipses addition patch [#24322](opencv/opencv#24322)
1 parent 4e90ddf commit c324ea9

File tree

5 files changed

+26
-0
lines changed

5 files changed

+26
-0
lines changed
Binary file not shown.
Binary file not shown.
Binary file not shown.

testdata/dnn/onnx/generate_onnx_models.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,6 +1457,15 @@ def forward(self, x):
14571457

14581458
save_data_and_model_multy_inputs("einsum_2d", einsum, mat1, mat2, export_params=True)
14591459

1460+
# 2d test case with ellipses
1461+
mat1 = torch.randn(4, 5)
1462+
mat2 = torch.randn(5, 8)
1463+
equation = "...ij, ...jk -> ...ik"
1464+
einsum = Einsum(equation)
1465+
output = einsum(mat1, mat2)
1466+
1467+
save_data_and_model_multy_inputs("einsum_2d_ellipses", einsum, mat1, mat2, export_params=True)
1468+
14601469
# 3d test case
14611470
mat1 = torch.ones(2, 4, 5)
14621471
mat2 = torch.ones(2, 5, 8)

testdata/dnn/onnx/models/einsum_2d_ellipses.onnx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
pytorch2.0.0:�
2+
D
3+
one
4+
two2/Einsum"Einsum*$
5+
equation"...ij, ...jk -> ...ik� torch_jitZ
6+
one
7+

8+

9+
Z
10+
two
11+

12+

13+
b-
14+
2(
15+
&"
16+
Einsum2_dim_0
17+
Einsum2_dim_1B

0 commit comments

Comments
 (0)