Source code

Revision control

Copy as Markdown

Other Tools

{
"tests": [
{
"name": "matmul float32 2D and 2D tensors",
"inputs": {
"a": {
"shape": [3, 4],
"data": [
10.43066143431215,
24.46751944495327,
55.88757596028084,
3.241082746029833,
87.58891110272717,
22.401545251921174,
79.85144951531564,
99.64449452911536,
24.740541547653283,
65.96242676599853,
38.1360764688486,
87.11140260507597
],
"type": "float32"
},
"b": {
"shape": [4, 5],
"data": [
88.17004408170853,
78.40126706348094,
14.819002753540623,
3.692303791736573,
45.9064286713635,
43.08391896733015,
47.19946845924572,
60.925216107016425,
8.162760351602216,
20.33326305093228,
20.438397895943282,
27.01940859922867,
15.601424432184263,
87.46969388883927,
65.79554455585657,
69.31696864490797,
31.984439910782992,
12.291812891860388,
13.304834654547172,
85.26705387930089
],
"type": "float32"
}
},
"expected": {
"name": "output",
"shape": [3, 5],
"data": [
3340.7431640625,
3586.344482421875,
2557.025634765625,
5169.8271484375,
4929.85009765625,
17226.955078125,
13269.03515625,
5133.4072265625,
8816.5986328125,
18226.65234375,
11841.033203125,
8869.705078125,
6051.1396484375,
5124.5390625,
12413.8984375
],
"type": "float32"
}
},
{
"name": "matmul float32 3D and 3D tensors",
"inputs": {
"a": {
"shape": [2, 3, 4],
"data": [
56.46701250066562,
99.86045478237251,
71.05493372292567,
32.45438455331333,
17.310747999630017,
2.586275053048559,
92.31499166302054,
96.9758519231732,
26.4721315276526,
77.67031776320978,
29.278788710989147,
82.12142428847062,
89.89308471484885,
82.49795321217854,
64.36866008901963,
23.75928513568486,
6.67026681065197,
81.55583129445503,
16.142963270263433,
57.45134849716054,
26.82641739603182,
85.0296980735713,
36.198863464757956,
89.60960360138286
],
"type": "float32"
},
"b": {
"shape": [2, 4, 5],
"data": [
70.38780515954635,
25.489176068987597,
28.25419591483602,
84.51486608529449,
58.87341530615436,
46.252837428713555,
24.897335441310766,
44.09449366886899,
51.865646783698985,
1.123237180407144,
4.187554708673558,
71.24650172124491,
16.0345266486708,
23.677297120787454,
61.277276711169094,
65.15946418752658,
58.392497125216906,
70.12740970610143,
9.119727538574839,
24.17997835305117,
84.42636665997716,
78.55551451746716,
38.482969428827076,
80.65414903244603,
57.15212267967695,
46.10971199065528,
28.41227860070996,
90.9256677352717,
94.66067935241847,
61.772877196686295,
60.324859158187635,
70.97433442190315,
10.631051143172332,
55.616284948780525,
35.0523090419651,
22.128390497020668,
38.19757703840079,
78.17564687251797,
62.57684276680773,
88.35256743439288
],
"type": "float32"
}
},
"expected": {
"name": "output",
"shape": [2, 3, 5],
"data": [
11005.6748046875,
10883.064453125,
9414.0009765625,
11929.9931640625,
8575.3720703125,
8043.556640625,
12745.41015625,
8884.0341796875,
4667.3173828125,
9023.7333984375,
10929.3818359375,
9489.8232421875,
10401.216796875,
7707.87744140625,
5425.5654296875,
15802.0888671875,
14881.6220703125,
13502.23828125,
20126.2890625,
14589.1806640625,
6568.7900390625,
6181.41162109375,
12335.123046875,
12751.05078125,
11060.98046875,
10352.16015625,
10515.310546875,
16153.86328125,
17833.36328125,
15971.80859375
],
"type": "float32"
}
},
{
"name": "matmul float32 4D and 4D tensors",
"inputs": {
"a": {
"shape": [2, 1, 3, 4],
"data": [
56.46701250066562,
99.86045478237251,
71.05493372292567,
32.45438455331333,
17.310747999630017,
2.586275053048559,
92.31499166302054,
96.9758519231732,
26.4721315276526,
77.67031776320978,
29.278788710989147,
82.12142428847062,
89.89308471484885,
82.49795321217854,
64.36866008901963,
23.75928513568486,
6.67026681065197,
81.55583129445503,
16.142963270263433,
57.45134849716054,
26.82641739603182,
85.0296980735713,
36.198863464757956,
89.60960360138286
],
"type": "float32"
},
"b": {
"shape": [2, 1, 4, 5],
"data": [
70.38780515954635,
25.489176068987597,
28.25419591483602,
84.51486608529449,
58.87341530615436,
46.252837428713555,
24.897335441310766,
44.09449366886899,
51.865646783698985,
1.123237180407144,
4.187554708673558,
71.24650172124491,
16.0345266486708,
23.677297120787454,
61.277276711169094,
65.15946418752658,
58.392497125216906,
70.12740970610143,
9.119727538574839,
24.17997835305117,
84.42636665997716,
78.55551451746716,
38.482969428827076,
80.65414903244603,
57.15212267967695,
46.10971199065528,
28.41227860070996,
90.9256677352717,
94.66067935241847,
61.772877196686295,
60.324859158187635,
70.97433442190315,
10.631051143172332,
55.616284948780525,
35.0523090419651,
22.128390497020668,
38.19757703840079,
78.17564687251797,
62.57684276680773,
88.35256743439288
],
"type": "float32"
}
},
"expected": {
"name": "output",
"shape": [2, 1, 3, 5],
"data": [
11005.6748046875,
10883.064453125,
9414.0009765625,
11929.9931640625,
8575.3720703125,
8043.556640625,
12745.41015625,
8884.0341796875,
4667.3173828125,
9023.7333984375,
10929.3818359375,
9489.8232421875,
10401.216796875,
7707.87744140625,
5425.5654296875,
15802.0888671875,
14881.6220703125,
13502.23828125,
20126.2890625,
14589.1806640625,
6568.7900390625,
6181.41162109375,
12335.123046875,
12751.05078125,
11060.98046875,
10352.16015625,
10515.310546875,
16153.86328125,
17833.36328125,
15971.80859375
],
"type": "float32"
}
},
{
"name": "matmul float32 3D and 3D (broadcast) tensors",
"inputs": {
"a": {
"shape": [2, 3, 4],
"data": [
56.46701250066562,
99.86045478237251,
71.05493372292567,
32.45438455331333,
17.310747999630017,
2.586275053048559,
92.31499166302054,
96.9758519231732,
26.4721315276526,
77.67031776320978,
29.278788710989147,
82.12142428847062,
89.89308471484885,
82.49795321217854,
64.36866008901963,
23.75928513568486,
6.67026681065197,
81.55583129445503,
16.142963270263433,
57.45134849716054,
26.82641739603182,
85.0296980735713,
36.198863464757956,
89.60960360138286
],
"type": "float32"
},
"b": {
"shape": [1, 4, 1],
"data": [
27.829805134194842,
83.14548502311283,
34.4128942110155,
83.20379675185079
],
"type": "float32"
}
},
"expected": {
"name": "output",
"shape": [2, 3, 1],
"data": [
15019.9462890625,
11942.376953125,
15035.0322265625,
13553.013671875,
12302.328125,
16517.9765625
],
"type": "float32"
}
},
{
"name": "matmul float32 3D and 2D tensors",
"inputs": {
"a": {
"shape": [2, 3, 4],
"data": [
56.46701250066562,
99.86045478237251,
71.05493372292567,
32.45438455331333,
17.310747999630017,
2.586275053048559,
92.31499166302054,
96.9758519231732,
26.4721315276526,
77.67031776320978,
29.278788710989147,
82.12142428847062,
89.89308471484885,
82.49795321217854,
64.36866008901963,
23.75928513568486,
6.67026681065197,
81.55583129445503,
16.142963270263433,
57.45134849716054,
26.82641739603182,
85.0296980735713,
36.198863464757956,
89.60960360138286
],
"type": "float32"
},
"b": {
"shape": [4, 1],
"data": [
27.829805134194842,
83.14548502311283,
34.4128942110155,
83.20379675185079
],
"type": "float32"
}
},
"expected": {
"name": "output",
"shape": [2, 3, 1],
"data": [
15019.9462890625,
11942.376953125,
15035.0322265625,
13553.013671875,
12302.328125,
16517.9765625
],
"type": "float32"
}
},
{
"name": "matmul float32 4D and 4D (broadcast) tensors",
"inputs": {
"a": {
"shape": [2, 2, 3, 4],
"data": [
33.759571073537195,
97.24552988493511,
83.70851840974835,
64.53984433339888,
29.579379819004714,
17.1992392523348,
67.94749248305698,
97.45838011362066,
54.44928258357935,
29.552200144620187,
51.99970332220345,
36.031014589568585,
9.701058359869318,
27.048420991685028,
6.020919350370768,
22.94090320010824,
53.12438840861784,
15.292234456978937,
48.21302721807221,
87.40800039569459,
51.344420382168174,
21.15575571555004,
27.58948746939598,
58.41238372971891,
5.963276160098108,
84.74937985741033,
55.457381638128126,
50.858698377713,
23.76357555039641,
62.330927022798434,
35.77495779930495,
17.340241762611043,
29.16901397355762,
23.19136101699426,
27.060928414739994,
1.2828527630654118,
8.720425533325615,
48.4528113654477,
99.01303756634434,
65.86412386674365,
92.69683028841827,
85.43540981621389,
37.49127872314042,
51.39713319355885,
53.19015180051876,
38.33119168879018,
75.20586450347592,
3.853793976963038
],
"type": "float32"
},
"b": {
"shape": [1, 1, 4, 5],
"data": [
88.17004408170853,
78.40126706348094,
14.819002753540623,
3.692303791736573,
45.9064286713635,
43.08391896733015,
47.19946845924572,
60.925216107016425,
8.162760351602216,
20.33326305093228,
20.438397895943282,
27.01940859922867,
15.601424432184263,
87.46969388883927,
65.79554455585657,
69.31696864490797,
31.984439910782992,
12.291812891860388,
13.304834654547172,
85.26705387930089
],
"type": "float32"
}
},
"expected": {
"name": "output",
"shape": [2, 2, 3, 5],
"data": [
13350.8759765625,
11562.755859375,
8524.271484375,
9099.0927734375,
14537.8701171875,
11493.283203125,
8083.90869140625,
3744.22216796875,
7489.62353515625,
14488.2314453125,
9634.3720703125,
8221.173828125,
3861.51416015625,
5470.0556640625,
9594.072265625,
3733.946533203125,
2933.679931640625,
2167.611083984375,
1088.48193359375,
3347.576416015625,
12387.083984375,
8985.1884765625,
3545.52783203125,
5701.10595703125,
13374.9169921875,
10051.3671875,
7637.7470703125,
3198.221435546875,
3552.6796875,
9583.1220703125,
8835.94921875,
7592.7666015625,
6742.10400390625,
6241.31396484375,
9982.404296875,
6713.85205078125,
6326.3173828125,
4920.9609375,
3956.46875,
6190.67626953125,
4213.013671875,
4153.708984375,
2283.152099609375,
2681.085693359375,
3700.47509765625,
9445.5869140625,
7752.5400390625,
5435.56005859375,
9964.6591796875,
13516.18359375,
16182.931640625,
13956.9560546875,
7795.52685546875,
5002.8349609375,
12841.802734375,
8145.45654296875,
8134.66650390625,
4344.25,
7138.79052734375,
8497.98046875
],
"type": "float32"
}
},
{
"name": "matmul float32 4D and 3D tensors",
"inputs": {
"a": {
"shape": [2, 2, 3, 4],
"data": [
33.759571073537195,
97.24552988493511,
83.70851840974835,
64.53984433339888,
29.579379819004714,
17.1992392523348,
67.94749248305698,
97.45838011362066,
54.44928258357935,
29.552200144620187,
51.99970332220345,
36.031014589568585,
9.701058359869318,
27.048420991685028,
6.020919350370768,
22.94090320010824,
53.12438840861784,
15.292234456978937,
48.21302721807221,
87.40800039569459,
51.344420382168174,
21.15575571555004,
27.58948746939598,
58.41238372971891,
5.963276160098108,
84.74937985741033,
55.457381638128126,
50.858698377713,
23.76357555039641,
62.330927022798434,
35.77495779930495,
17.340241762611043,
29.16901397355762,
23.19136101699426,
27.060928414739994,
1.2828527630654118,
8.720425533325615,
48.4528113654477,
99.01303756634434,
65.86412386674365,
92.69683028841827,
85.43540981621389,
37.49127872314042,
51.39713319355885,
53.19015180051876,
38.33119168879018,
75.20586450347592,
3.853793976963038
],
"type": "float32"
},
"b": {
"shape": [2, 4, 5],
"data": [
70.38780515954635,
25.489176068987597,
28.25419591483602,
84.51486608529449,
58.87341530615436,
46.252837428713555,
24.897335441310766,
44.09449366886899,
51.865646783698985,
1.123237180407144,
4.187554708673558,
71.24650172124491,
16.0345266486708,
23.677297120787454,
61.277276711169094,
65.15946418752658,
58.392497125216906,
70.12740970610143,
9.119727538574839,
24.17997835305117,
84.42636665997716,
78.55551451746716,
38.482969428827076,
80.65414903244603,
57.15212267967695,
46.10971199065528,
28.41227860070996,
90.9256677352717,
94.66067935241847,
61.772877196686295,
60.324859158187635,
70.97433442190315,
10.631051143172332,
55.616284948780525,
35.0523090419651,
22.128390497020668,
38.19757703840079,
78.17564687251797,
62.57684276680773,
88.35256743439288
],
"type": "float32"
}
},
"expected": {
"name": "output",
"shape": [2, 2, 3, 5],
"data": [
11430.05859375,
13014.2392578125,
11110.080078125,
10467.46484375,
8786.7724609375,
9512.4111328125,
11714.0283203125,
9518.1435546875,
5889.55419921875,
8280.9365234375,
7764.95166015625,
7932.3759765625,
6202.0625,
7694.32373046875,
7296.4384765625,
2937.076416015625,
2834.196533203125,
4690.14990234375,
5113.283203125,
4463.22998046875,
10032.8623046875,
11368.3623046875,
10780.572265625,
13883.421875,
13393.5166015625,
8267.212890625,
8823.828125,
8759.2177734375,
11333.4462890625,
10369.25390625,
7885.7978515625,
9182.943359375,
8361.2900390625,
6676.46533203125,
5074.3115234375,
5835.33837890625,
5718.96875,
5209.5322265625,
6246.40185546875,
4080.533935546875,
3322.71826171875,
3323.802490234375,
2370.630615234375,
4320.47900390625,
3432.568115234375,
10400.7939453125,
11604.9267578125,
10942.7744140625,
14918.220703125,
12781.3603515625,
15164.451171875,
14333.4267578125,
15752.0966796875,
20865.154296875,
16430.63671875,
10880.1533203125,
10752.34765625,
6632.99462890625,
12342.2919921875,
8384.3896484375
],
"type": "float32"
}
},
{
"name": "matmul float32 5D and 5D tensors",
"inputs": {
"a": {
"shape": [2, 2, 1, 3, 4],
"data": [
33.759571073537195,
97.24552988493511,
83.70851840974835,
64.53984433339888,
29.579379819004714,
17.1992392523348,
67.94749248305698,
97.45838011362066,
54.44928258357935,
29.552200144620187,
51.99970332220345,
36.031014589568585,
9.701058359869318,
27.048420991685028,
6.020919350370768,
22.94090320010824,
53.12438840861784,
15.292234456978937,
48.21302721807221,
87.40800039569459,
51.344420382168174,
21.15575571555004,
27.58948746939598,
58.41238372971891,
5.963276160098108,
84.74937985741033,
55.457381638128126,
50.858698377713,
23.76357555039641,
62.330927022798434,
35.77495779930495,
17.340241762611043,
29.16901397355762,
23.19136101699426,
27.060928414739994,
1.2828527630654118,
8.720425533325615,
48.4528113654477,
99.01303756634434,
65.86412386674365,
92.69683028841827,
85.43540981621389,
37.49127872314042,
51.39713319355885,
53.19015180051876,
38.33119168879018,
75.20586450347592,
3.853793976963038
],
"type": "float32"
},
"b": {
"shape": [1, 1, 1, 4, 5],
"data": [
88.17004408170853,
78.40126706348094,
14.819002753540623,
3.692303791736573,
45.9064286713635,
43.08391896733015,
47.19946845924572,
60.925216107016425,
8.162760351602216,
20.33326305093228,
20.438397895943282,
27.01940859922867,
15.601424432184263,
87.46969388883927,
65.79554455585657,
69.31696864490797,
31.984439910782992,
12.291812891860388,
13.304834654547172,
85.26705387930089
],
"type": "float32"
}
},
"expected": {
"name": "output",
"shape": [2, 2, 1, 3, 5],
"data": [
13350.8759765625,
11562.755859375,
8524.271484375,
9099.0927734375,
14537.8701171875,
11493.283203125,
8083.90869140625,
3744.22216796875,
7489.62353515625,
14488.2314453125,
9634.3720703125,
8221.173828125,
3861.51416015625,
5470.0556640625,
9594.072265625,
3733.946533203125,
2933.679931640625,
2167.611083984375,
1088.48193359375,
3347.576416015625,
12387.083984375,
8985.1884765625,
3545.52783203125,
5701.10595703125,
13374.9169921875,
10051.3671875,
7637.7470703125,
3198.221435546875,
3552.6796875,
9583.1220703125,
8835.94921875,
7592.7666015625,
6742.10400390625,
6241.31396484375,
9982.404296875,
6713.85205078125,
6326.3173828125,
4920.9609375,
3956.46875,
6190.67626953125,
4213.013671875,
4153.708984375,
2283.152099609375,
2681.085693359375,
3700.47509765625,
9445.5869140625,
7752.5400390625,
5435.56005859375,
9964.6591796875,
13516.18359375,
16182.931640625,
13956.9560546875,
7795.52685546875,
5002.8349609375,
12841.802734375,
8145.45654296875,
8134.66650390625,
4344.25,
7138.79052734375,
8497.98046875
],
"type": "float32"
}
},
{
"name": "matmul float32 5D and 2D tensors",
"inputs": {
"a": {
"shape": [2, 2, 1, 3, 4],
"data": [
33.759571073537195,
97.24552988493511,
83.70851840974835,
64.53984433339888,
29.579379819004714,
17.1992392523348,
67.94749248305698,
97.45838011362066,
54.44928258357935,
29.552200144620187,
51.99970332220345,
36.031014589568585,
9.701058359869318,
27.048420991685028,
6.020919350370768,
22.94090320010824,
53.12438840861784,
15.292234456978937,
48.21302721807221,
87.40800039569459,
51.344420382168174,
21.15575571555004,
27.58948746939598,
58.41238372971891,
5.963276160098108,
84.74937985741033,
55.457381638128126,
50.858698377713,
23.76357555039641,
62.330927022798434,
35.77495779930495,
17.340241762611043,
29.16901397355762,
23.19136101699426,
27.060928414739994,
1.2828527630654118,
8.720425533325615,
48.4528113654477,
99.01303756634434,
65.86412386674365,
92.69683028841827,
85.43540981621389,
37.49127872314042,
51.39713319355885,
53.19015180051876,
38.33119168879018,
75.20586450347592,
3.853793976963038
],
"type": "float32"
},
"b": {
"shape": [4, 5],
"data": [
88.17004408170853,
78.40126706348094,
14.819002753540623,
3.692303791736573,
45.9064286713635,
43.08391896733015,
47.19946845924572,
60.925216107016425,
8.162760351602216,
20.33326305093228,
20.438397895943282,
27.01940859922867,
15.601424432184263,
87.46969388883927,
65.79554455585657,
69.31696864490797,
31.984439910782992,
12.291812891860388,
13.304834654547172,
85.26705387930089
],
"type": "float32"
}
},
"expected": {
"name": "output",
"shape": [2, 2, 1, 3, 5],
"data": [
13350.8759765625,
11562.755859375,
8524.271484375,
9099.0927734375,
14537.8701171875,
11493.283203125,
8083.90869140625,
3744.22216796875,
7489.62353515625,
14488.2314453125,
9634.3720703125,
8221.173828125,
3861.51416015625,
5470.0556640625,
9594.072265625,
3733.946533203125,
2933.679931640625,
2167.611083984375,
1088.48193359375,
3347.576416015625,
12387.083984375,
8985.1884765625,
3545.52783203125,
5701.10595703125,
13374.9169921875,
10051.3671875,
7637.7470703125,
3198.221435546875,
3552.6796875,
9583.1220703125,
8835.94921875,
7592.7666015625,
6742.10400390625,
6241.31396484375,
9982.404296875,
6713.85205078125,
6326.3173828125,
4920.9609375,
3956.46875,
6190.67626953125,
4213.013671875,
4153.708984375,
2283.152099609375,
2681.085693359375,
3700.47509765625,
9445.5869140625,
7752.5400390625,
5435.56005859375,
9964.6591796875,
13516.18359375,
16182.931640625,
13956.9560546875,
7795.52685546875,
5002.8349609375,
12841.802734375,
8145.45654296875,
8134.66650390625,
4344.25,
7138.79052734375,
8497.98046875
],
"type": "float32"
}
}
]
}