Source code

Revision control

Copy as Markdown

Other Tools

{
"tests": [
{
"name": "gather float32 1D tensor and uint32 0D scalar indices default options",
"inputs": {
"input": {
"shape": [24],
"data": [
-66.05901336669922,
-68.9197006225586,
-77.02045440673828,
-26.158037185668945,
89.0337142944336,
-45.89653396606445,
43.84803771972656,
48.81806945800781,
51.79948425292969,
41.94132614135742,
-1.1303654909133911,
-50.42131042480469,
90.2870101928711,
55.620765686035156,
44.92119598388672,
56.828636169433594,
10.829925537109375,
-19.693084716796875,
-37.696800231933594,
43.11057662963867,
0.9129875898361206,
-7.699817180633545,
25.76774024963379,
73.60064697265625
],
"type": "float32"
},
"indices": {
"shape": [],
"data": [
4
],
"type": "uint32"
}
},
"expected": {
"name": "output",
"shape": [],
"data": [
89.0337142944336
],
"type": "float32"
}
},
{
"name": "gather float32 1D tensor and int64 0D scalar indices default options",
"inputs": {
"input": {
"shape": [24],
"data": [
-66.05901336669922,
-68.9197006225586,
-77.02045440673828,
-26.158037185668945,
89.0337142944336,
-45.89653396606445,
43.84803771972656,
48.81806945800781,
51.79948425292969,
41.94132614135742,
-1.1303654909133911,
-50.42131042480469,
90.2870101928711,
55.620765686035156,
44.92119598388672,
56.828636169433594,
10.829925537109375,
-19.693084716796875,
-37.696800231933594,
43.11057662963867,
0.9129875898361206,
-7.699817180633545,
25.76774024963379,
73.60064697265625
],
"type": "float32"
},
"indices": {
"shape": [],
"data": [
0
],
"type": "int64"
}
},
"expected": {
"name": "output",
"shape": [],
"data": [
-66.05901336669922
],
"type": "float32"
}
},
{
"name": "gather float32 1D tensor and int64 1D indices default options",
"inputs": {
"input": {
"shape": [24],
"data": [
-66.05901336669922,
-68.9197006225586,
-77.02045440673828,
-26.158037185668945,
89.0337142944336,
-45.89653396606445,
43.84803771972656,
48.81806945800781,
51.79948425292969,
41.94132614135742,
-1.1303654909133911,
-50.42131042480469,
90.2870101928711,
55.620765686035156,
44.92119598388672,
56.828636169433594,
10.829925537109375,
-19.693084716796875,
-37.696800231933594,
43.11057662963867,
0.9129875898361206,
-7.699817180633545,
25.76774024963379,
73.60064697265625
],
"type": "float32"
},
"indices": {
"shape": [8],
"data": [
16,
20,
6,
11,
17,
19,
13,
17
],
"type": "int64"
}
},
"expected": {
"name": "output",
"shape": [8],
"data": [
10.829925537109375,
0.9129875898361206,
43.84803771972656,
-50.42131042480469,
-19.693084716796875,
43.11057662963867,
55.620765686035156,
-19.693084716796875
],
"type": "float32"
}
},
{
"name": "gather float32 1D tensor and int64 2D indices default options",
"inputs": {
"input": {
"shape": [24],
"data": [
-66.05901336669922,
-68.9197006225586,
-77.02045440673828,
-26.158037185668945,
89.0337142944336,
-45.89653396606445,
43.84803771972656,
48.81806945800781,
51.79948425292969,
41.94132614135742,
-1.1303654909133911,
-50.42131042480469,
90.2870101928711,
55.620765686035156,
44.92119598388672,
56.828636169433594,
10.829925537109375,
-19.693084716796875,
-37.696800231933594,
43.11057662963867,
0.9129875898361206,
-7.699817180633545,
25.76774024963379,
73.60064697265625
],
"type": "float32"
},
"indices": {
"shape": [2, 2],
"data": [
14,
9,
21,
17
],
"type": "int64"
}
},
"expected": {
"name": "output",
"shape": [2, 2],
"data": [
44.92119598388672,
41.94132614135742,
-7.699817180633545,
-19.693084716796875
],
"type": "float32"
}
},
{
"name": "gather float32 1D tensor and int64 3D indices default options",
"inputs": {
"input": {
"shape": [24],
"data": [
-66.05901336669922,
-68.9197006225586,
-77.02045440673828,
-26.158037185668945,
89.0337142944336,
-45.89653396606445,
43.84803771972656,
48.81806945800781,
51.79948425292969,
41.94132614135742,
-1.1303654909133911,
-50.42131042480469,
90.2870101928711,
55.620765686035156,
44.92119598388672,
56.828636169433594,
10.829925537109375,
-19.693084716796875,
-37.696800231933594,
43.11057662963867,
0.9129875898361206,
-7.699817180633545,
25.76774024963379,
73.60064697265625
],
"type": "float32"
},
"indices": {
"shape": [2, 3, 3],
"data": [
17,
19,
14,
16,
13,
0,
5,
15,
18,
18,
6,
20,
7,
22,
5,
1,
4,
19
],
"type": "int64"
}
},
"expected": {
"name": "output",
"shape": [2, 3, 3],
"data": [
-19.693084716796875,
43.11057662963867,
44.92119598388672,
10.829925537109375,
55.620765686035156,
-66.05901336669922,
-45.89653396606445,
56.828636169433594,
-37.696800231933594,
-37.696800231933594,
43.84803771972656,
0.9129875898361206,
48.81806945800781,
25.76774024963379,
-45.89653396606445,
-68.9197006225586,
89.0337142944336,
43.11057662963867
],
"type": "float32"
}
},
{
"name": "gather float32 1D tensor and int64 4D indices default options",
"inputs": {
"input": {
"shape": [24],
"data": [
-66.05901336669922,
-68.9197006225586,
-77.02045440673828,
-26.158037185668945,
89.0337142944336,
-45.89653396606445,
43.84803771972656,
48.81806945800781,
51.79948425292969,
41.94132614135742,
-1.1303654909133911,
-50.42131042480469,
90.2870101928711,
55.620765686035156,
44.92119598388672,
56.828636169433594,
10.829925537109375,
-19.693084716796875,
-37.696800231933594,
43.11057662963867,
0.9129875898361206,
-7.699817180633545,
25.76774024963379,
73.60064697265625
],
"type": "float32"
},
"indices": {
"shape": [1, 2, 2, 3],
"data": [
18,
18,
22,
11,
8,
15,
12,
11,
7,
13,
7,
7
],
"type": "int64"
}
},
"expected": {
"name": "output",
"shape": [1, 2, 2, 3],
"data": [
-37.696800231933594,
-37.696800231933594,
25.76774024963379,
-50.42131042480469,
51.79948425292969,
56.828636169433594,
90.2870101928711,
-50.42131042480469,
48.81806945800781,
55.620765686035156,
48.81806945800781,
48.81806945800781
],
"type": "float32"
}
},
{
"name": "gather float32 2D tensor and 0D scalar indices default options",
"inputs": {
"input": {
"shape": [12, 2],
"data": [
-66.05901336669922,
-68.9197006225586,
-77.02045440673828,
-26.158037185668945,
89.0337142944336,
-45.89653396606445,
43.84803771972656,
48.81806945800781,
51.79948425292969,
41.94132614135742,
-1.1303654909133911,
-50.42131042480469,
90.2870101928711,
55.620765686035156,
44.92119598388672,
56.828636169433594,
10.829925537109375,
-19.693084716796875,
-37.696800231933594,
43.11057662963867,
0.9129875898361206,
-7.699817180633545,
25.76774024963379,
73.60064697265625
],
"type": "float32"
},
"indices": {
"shape": [],
"data": [
11
],
"type": "int64"
}
},
"expected": {
"name": "output",
"shape": [2],
"data": [
25.76774024963379,
73.60064697265625
],
"type": "float32"
}
},
{
"name": "gather float32 2D tensor and 1D indices default options",
"inputs": {
"input": {
"shape": [12, 2],
"data": [
-66.05901336669922,
-68.9197006225586,
-77.02045440673828,
-26.158037185668945,
89.0337142944336,
-45.89653396606445,
43.84803771972656,
48.81806945800781,
51.79948425292969,
41.94132614135742,
-1.1303654909133911,
-50.42131042480469,
90.2870101928711,
55.620765686035156,
44.92119598388672,
56.828636169433594,
10.829925537109375,
-19.693084716796875,
-37.696800231933594,
43.11057662963867,
0.9129875898361206,
-7.699817180633545,
25.76774024963379,
73.60064697265625
],
"type": "float32"
},
"indices": {
"shape": [8],
"data": [
1,
10,
9,
0,
3,
5,
3,
8
],
"type": "int64"
}
},
"expected": {
"name": "output",
"shape": [8, 2],
"data": [
-77.02045440673828,
-26.158037185668945,
0.9129875898361206,
-7.699817180633545,
-37.696800231933594,
43.11057662963867,
-66.05901336669922,
-68.9197006225586,
43.84803771972656,
48.81806945800781,
-1.1303654909133911,
-50.42131042480469,
43.84803771972656,
48.81806945800781,
10.829925537109375,
-19.693084716796875
],
"type": "float32"
}
},
{
"name": "gather float32 2D tensor and 2D indices default options",
"inputs": {
"input": {
"shape": [12, 2],
"data": [
-66.05901336669922,
-68.9197006225586,
-77.02045440673828,
-26.158037185668945,
89.0337142944336,
-45.89653396606445,
43.84803771972656,
48.81806945800781,
51.79948425292969,
41.94132614135742,
-1.1303654909133911,
-50.42131042480469,
90.2870101928711,
55.620765686035156,
44.92119598388672,
56.828636169433594,
10.829925537109375,
-19.693084716796875,
-37.696800231933594,
43.11057662963867,
0.9129875898361206,
-7.699817180633545,
25.76774024963379,
73.60064697265625
],
"type": "float32"
},
"indices": {
"shape": [2, 2],
"data": [
4,
8,
9,
10
],
"type": "int64"
}
},
"expected": {
"name": "output",
"shape": [2, 2, 2],
"data": [
51.79948425292969,
41.94132614135742,
10.829925537109375,
-19.693084716796875,
-37.696800231933594,
43.11057662963867,
0.9129875898361206,
-7.699817180633545
],
"type": "float32"
}
},
{
"name": "gather float32 2D tensor and 3D indices default options",
"inputs": {
"input": {
"shape": [12, 2],
"data": [
-66.05901336669922,
-68.9197006225586,
-77.02045440673828,
-26.158037185668945,
89.0337142944336,
-45.89653396606445,
43.84803771972656,
48.81806945800781,
51.79948425292969,
41.94132614135742,
-1.1303654909133911,
-50.42131042480469,
90.2870101928711,
55.620765686035156,
44.92119598388672,
56.828636169433594,
10.829925537109375,
-19.693084716796875,
-37.696800231933594,
43.11057662963867,
0.9129875898361206,
-7.699817180633545,
25.76774024963379,
73.60064697265625
],
"type": "float32"
},
"indices": {
"shape": [2, 3, 3],
"data": [
8,
2,
2,
3,
4,
1,
2,
2,
7,
11,
4,
11,
6,
6,
7,
3,
11,
10
],
"type": "int64"
}
},
"expected": {
"name": "output",
"shape": [2, 3, 3, 2],
"data": [
10.829925537109375,
-19.693084716796875,
89.0337142944336,
-45.89653396606445,
89.0337142944336,
-45.89653396606445,
43.84803771972656,
48.81806945800781,
51.79948425292969,
41.94132614135742,
-77.02045440673828,
-26.158037185668945,
89.0337142944336,
-45.89653396606445,
89.0337142944336,
-45.89653396606445,
44.92119598388672,
56.828636169433594,
25.76774024963379,
73.60064697265625,
51.79948425292969,
41.94132614135742,
25.76774024963379,
73.60064697265625,
90.2870101928711,
55.620765686035156,
90.2870101928711,
55.620765686035156,
44.92119598388672,
56.828636169433594,
43.84803771972656,
48.81806945800781,
25.76774024963379,
73.60064697265625,
0.9129875898361206,
-7.699817180633545
],
"type": "float32"
}
},
{
"name": "gather float32 2D tensor and 4D indices default options",
"inputs": {
"input": {
"shape": [12, 2],
"data": [
-66.05901336669922,
-68.9197006225586,
-77.02045440673828,
-26.158037185668945,
89.0337142944336,
-45.89653396606445,
43.84803771972656,
48.81806945800781,
51.79948425292969,
41.94132614135742,
-1.1303654909133911,
-50.42131042480469,
90.2870101928711,
55.620765686035156,
44.92119598388672,
56.828636169433594,
10.829925537109375,
-19.693084716796875,
-37.696800231933594,
43.11057662963867,
0.9129875898361206,
-7.699817180633545,
25.76774024963379,
73.60064697265625
],
"type": "float32"
},
"indices": {
"shape": [1, 2, 2, 3],
"data": [
6,
9,
7,
3,
4,
7,
4,
3,
7,
7,
6,
0
],
"type": "int64"
}
},
"expected": {
"name": "output",
"shape": [1, 2, 2, 3, 2],
"data": [
90.2870101928711,
55.620765686035156,
-37.696800231933594,
43.11057662963867,
44.92119598388672,
56.828636169433594,
43.84803771972656,
48.81806945800781,
51.79948425292969,
41.94132614135742,
44.92119598388672,
56.828636169433594,
51.79948425292969,
41.94132614135742,
43.84803771972656,
48.81806945800781,
44.92119598388672,
56.828636169433594,
44.92119598388672,
56.828636169433594,
90.2870101928711,
55.620765686035156,
-66.05901336669922,
-68.9197006225586
],
"type": "float32"
}
},
{
"name": "gather float32 3D tensor and 2D indices default options",
"inputs": {
"input": {
"shape": [3, 4, 2],
"data": [
-66.05901336669922,
-68.9197006225586,
-77.02045440673828,
-26.158037185668945,
89.0337142944336,
-45.89653396606445,
43.84803771972656,
48.81806945800781,
51.79948425292969,
41.94132614135742,
-1.1303654909133911,
-50.42131042480469,
90.2870101928711,
55.620765686035156,
44.92119598388672,
56.828636169433594,
10.829925537109375,
-19.693084716796875,
-37.696800231933594,
43.11057662963867,
0.9129875898361206,
-7.699817180633545,
25.76774024963379,
73.60064697265625
],
"type": "float32"
},
"indices": {
"shape": [2, 2],
"data": [
2,
1,
1,
1
],
"type": "int64"
}
},
"expected": {
"name": "output",
"shape": [2, 2, 4, 2],
"data": [
10.829925537109375,
-19.693084716796875,
-37.696800231933594,
43.11057662963867,
0.9129875898361206,
-7.699817180633545,
25.76774024963379,
73.60064697265625,
51.79948425292969,
41.94132614135742,
-1.1303654909133911,
-50.42131042480469,
90.2870101928711,
55.620765686035156,
44.92119598388672,
56.828636169433594,
51.79948425292969,
41.94132614135742,
-1.1303654909133911,
-50.42131042480469,
90.2870101928711,
55.620765686035156,
44.92119598388672,
56.828636169433594,
51.79948425292969,
41.94132614135742,
-1.1303654909133911,
-50.42131042480469,
90.2870101928711,
55.620765686035156,
44.92119598388672,
56.828636169433594
],
"type": "float32"
}
},
{
"name": "gather float32 4D tensor and 2D indices default options",
"inputs": {
"input": {
"shape": [8, 1, 1, 3],
"data": [
-66.05901336669922,
-68.9197006225586,
-77.02045440673828,
-26.158037185668945,
89.0337142944336,
-45.89653396606445,
43.84803771972656,
48.81806945800781,
51.79948425292969,
41.94132614135742,
-1.1303654909133911,
-50.42131042480469,
90.2870101928711,
55.620765686035156,
44.92119598388672,
56.828636169433594,
10.829925537109375,
-19.693084716796875,
-37.696800231933594,
43.11057662963867,
0.9129875898361206,
-7.699817180633545,
25.76774024963379,
73.60064697265625
],
"type": "float32"
},
"indices": {
"shape": [2, 2],
"data": [
0,
0,
7,
4
],
"type": "int64"
}
},
"expected": {
"name": "output",
"shape": [2, 2, 1, 1, 3],
"data": [
-66.05901336669922,
-68.9197006225586,
-77.02045440673828,
-66.05901336669922,
-68.9197006225586,
-77.02045440673828,
-7.699817180633545,
25.76774024963379,
73.60064697265625,
90.2870101928711,
55.620765686035156,
44.92119598388672
],
"type": "float32"
}
},
{
"name": "gather float32 5D tensor and 1D indices default options",
"inputs": {
"input": {
"shape": [4, 2, 1, 1, 3],
"data": [
-66.05901336669922,
-68.9197006225586,
-77.02045440673828,
-26.158037185668945,
89.0337142944336,
-45.89653396606445,
43.84803771972656,
48.81806945800781,
51.79948425292969,
41.94132614135742,
-1.1303654909133911,
-50.42131042480469,
90.2870101928711,
55.620765686035156,
44.92119598388672,
56.828636169433594,
10.829925537109375,
-19.693084716796875,
-37.696800231933594,
43.11057662963867,
0.9129875898361206,
-7.699817180633545,
25.76774024963379,
73.60064697265625
],
"type": "float32"
},
"indices": {
"shape": [3],
"data": [
3,
2,
2
],
"type": "int64"
}
},
"expected": {
"name": "output",
"shape": [3, 2, 1, 1, 3],
"data": [
-37.696800231933594,
43.11057662963867,
0.9129875898361206,
-7.699817180633545,
25.76774024963379,
73.60064697265625,
90.2870101928711,
55.620765686035156,
44.92119598388672,
56.828636169433594,
10.829925537109375,
-19.693084716796875,
90.2870101928711,
55.620765686035156,
44.92119598388672,
56.828636169433594,
10.829925537109375,
-19.693084716796875
],
"type": "float32"
}
},
{
"name": "gather float32 3D tensor and 1D indices options.axis=1",
"inputs": {
"input": {
"shape": [3, 4, 2],
"data": [
-66.05901336669922,
-68.9197006225586,
-77.02045440673828,
-26.158037185668945,
89.0337142944336,
-45.89653396606445,
43.84803771972656,
48.81806945800781,
51.79948425292969,
41.94132614135742,
-1.1303654909133911,
-50.42131042480469,
90.2870101928711,
55.620765686035156,
44.92119598388672,
56.828636169433594,
10.829925537109375,
-19.693084716796875,
-37.696800231933594,
43.11057662963867,
0.9129875898361206,
-7.699817180633545,
25.76774024963379,
73.60064697265625
],
"type": "float32"
},
"indices": {
"shape": [3],
"data": [
1,
1,
2
],
"type": "int64"
}
},
"options": {
"axis": 1
},
"expected": {
"name": "output",
"shape": [3, 3, 2],
"data": [
-77.02045440673828,
-26.158037185668945,
-77.02045440673828,
-26.158037185668945,
89.0337142944336,
-45.89653396606445,
-1.1303654909133911,
-50.42131042480469,
-1.1303654909133911,
-50.42131042480469,
90.2870101928711,
55.620765686035156,
-37.696800231933594,
43.11057662963867,
-37.696800231933594,
43.11057662963867,
0.9129875898361206,
-7.699817180633545
],
"type": "float32"
}
},
{
"name": "gather float32 3D tensor and 2D indices options.axis=2",
"inputs": {
"input": {
"shape": [3, 4, 2],
"data": [
-66.05901336669922,
-68.9197006225586,
-77.02045440673828,
-26.158037185668945,
89.0337142944336,
-45.89653396606445,
43.84803771972656,
48.81806945800781,
51.79948425292969,
41.94132614135742,
-1.1303654909133911,
-50.42131042480469,
90.2870101928711,
55.620765686035156,
44.92119598388672,
56.828636169433594,
10.829925537109375,
-19.693084716796875,
-37.696800231933594,
43.11057662963867,
0.9129875898361206,
-7.699817180633545,
25.76774024963379,
73.60064697265625
],
"type": "float32"
},
"indices": {
"shape": [2, 2],
"data": [
0,
0,
0,
1
],
"type": "int64"
}
},
"options": {
"axis": 2
},
"expected": {
"name": "output",
"shape": [3, 4, 2, 2],
"data": [
-66.05901336669922,
-66.05901336669922,
-66.05901336669922,
-68.9197006225586,
-77.02045440673828,
-77.02045440673828,
-77.02045440673828,
-26.158037185668945,
89.0337142944336,
89.0337142944336,
89.0337142944336,
-45.89653396606445,
43.84803771972656,
43.84803771972656,
43.84803771972656,
48.81806945800781,
51.79948425292969,
51.79948425292969,
51.79948425292969,
41.94132614135742,
-1.1303654909133911,
-1.1303654909133911,
-1.1303654909133911,
-50.42131042480469,
90.2870101928711,
90.2870101928711,
90.2870101928711,
55.620765686035156,
44.92119598388672,
44.92119598388672,
44.92119598388672,
56.828636169433594,
10.829925537109375,
10.829925537109375,
10.829925537109375,
-19.693084716796875,
-37.696800231933594,
-37.696800231933594,
-37.696800231933594,
43.11057662963867,
0.9129875898361206,
0.9129875898361206,
0.9129875898361206,
-7.699817180633545,
25.76774024963379,
25.76774024963379,
25.76774024963379,
73.60064697265625
],
"type": "float32"
}
},
{
"name": "gather float32 4D tensor and 2D indices explict options.axis=0",
"inputs": {
"input": {
"shape": [8, 1, 1, 3],
"data": [
-66.05901336669922,
-68.9197006225586,
-77.02045440673828,
-26.158037185668945,
89.0337142944336,
-45.89653396606445,
43.84803771972656,
48.81806945800781,
51.79948425292969,
41.94132614135742,
-1.1303654909133911,
-50.42131042480469,
90.2870101928711,
55.620765686035156,
44.92119598388672,
56.828636169433594,
10.829925537109375,
-19.693084716796875,
-37.696800231933594,
43.11057662963867,
0.9129875898361206,
-7.699817180633545,
25.76774024963379,
73.60064697265625
],
"type": "float32"
},
"indices": {
"shape": [2, 2],
"data": [
0,
0,
7,
4
],
"type": "int64"
}
},
"options": {
"axis": 0
},
"expected": {
"name": "output",
"shape": [2, 2, 1, 1, 3],
"data": [
-66.05901336669922,
-68.9197006225586,
-77.02045440673828,
-66.05901336669922,
-68.9197006225586,
-77.02045440673828,
-7.699817180633545,
25.76774024963379,
73.60064697265625,
90.2870101928711,
55.620765686035156,
44.92119598388672
],
"type": "float32"
}
},
{
"name": "gather float32 5D tensor and 0D scalar indices options.axis=4",
"inputs": {
"input": {
"shape": [4, 2, 1, 1, 3],
"data": [
-66.05901336669922,
-68.9197006225586,
-77.02045440673828,
-26.158037185668945,
89.0337142944336,
-45.89653396606445,
43.84803771972656,
48.81806945800781,
51.79948425292969,
41.94132614135742,
-1.1303654909133911,
-50.42131042480469,
90.2870101928711,
55.620765686035156,
44.92119598388672,
56.828636169433594,
10.829925537109375,
-19.693084716796875,
-37.696800231933594,
43.11057662963867,
0.9129875898361206,
-7.699817180633545,
25.76774024963379,
73.60064697265625
],
"type": "float32"
},
"indices": {
"shape": [],
"data": [
1
],
"type": "int64"
}
},
"options": {
"axis": 4
},
"expected": {
"name": "output",
"shape": [4, 2, 1, 1],
"data": [
-68.9197006225586,
89.0337142944336,
48.81806945800781,
-1.1303654909133911,
55.620765686035156,
10.829925537109375,
43.11057662963867,
25.76774024963379
],
"type": "float32"
}
}
]
}