@@ -4243,21 +4243,16 @@ partial dictionary MLOpSupportLimits {
4243
4243
{shape: [4, 3] },
4244
4244
new Float32Array([0, 1, 2, 10, 11, 12, 20, 21, 22, 30, 31, 32] ));
4245
4245
4246
- const indices1 =
4247
- builder.constant({dataType: 'uint32' , shape: [2] }, new Uint32Array([3, 1] ));
4248
-
4249
- const indices2 = builder.constant(
4250
- {dataType: 'uint32' , shape: [3] }, new Uint32Array([2, 1, 1] ));
4251
-
4252
- const indices3 = builder.constant(
4253
- {dataType: 'uint32' , shape: [2, 2] }, new Uint32Array([0, 1, 1, 2] ));
4254
-
4255
4246
// axis = 0 (default)
4256
4247
// indices of shape [2] :
4257
4248
// [3,1]
4258
4249
// output of shape [2,3] :
4259
4250
// [[30, 31, 32] ,
4260
4251
// [10, 11, 12] ]
4252
+
4253
+ const indices1 =
4254
+ builder.constant({dataType: 'uint32' , shape: [2] }, new Uint32Array([3, 1] ));
4255
+
4261
4256
const output1 = builder.gather(input, indices1);
4262
4257
4263
4258
// axis = 1
@@ -4268,6 +4263,10 @@ partial dictionary MLOpSupportLimits {
4268
4263
// [12, 11, 11] ,
4269
4264
// [22, 21, 21] ,
4270
4265
// [32, 31, 31] ]
4266
+
4267
+ const indices2 = builder.constant(
4268
+ {dataType: 'uint32' , shape: [3] }, new Uint32Array([2, 1, 1] ));
4269
+
4271
4270
const output2 = builder.gather(input, indices2, {axis: 1});
4272
4271
4273
4272
// axis = 1
@@ -4279,6 +4278,10 @@ partial dictionary MLOpSupportLimits {
4279
4278
// [[10, 11] , [11, 12] ],
4280
4279
// [[20, 21] , [21, 22] ],
4281
4280
// [[30, 31] , [31, 32] ]]
4281
+
4282
+ const indices3 = builder.constant(
4283
+ {dataType: 'uint32' , shape: [2, 2] }, new Uint32Array([0, 1, 1, 2] ));
4284
+
4282
4285
const output3 = builder.gather(input, indices3, {axis: 1});
4283
4286
</pre>
4284
4287
</details>
@@ -4406,7 +4409,7 @@ partial dictionary MLOpSupportLimits {
4406
4409
// [0] ,
4407
4410
// [2] ],
4408
4411
// axis = 1
4409
- // output of shape [4,3 ] :
4412
+ // output of shape [4,1 ] :
4410
4413
// [[ 2] ,
4411
4414
// [11] ,
4412
4415
// [20] ,
@@ -4430,7 +4433,7 @@ partial dictionary MLOpSupportLimits {
4430
4433
// indices of shape [1,2,2] :
4431
4434
// [[[0, 2] ,
4432
4435
// [1, 3] ]],
4433
- // axis = 2
4436
+ // axis = 0
4434
4437
// output of shape [1,2,2] :
4435
4438
// [[[ 0, 201] ,
4436
4439
// [110, 311] ]]
@@ -4600,7 +4603,27 @@ partial dictionary MLOpSupportLimits {
4600
4603
{dataType: 'uint32' , shape: [3, 1] },
4601
4604
new Uint32Array([1, 0, 1] ));
4602
4605
4603
- const output3 = builder.gatherNd(input2, indices4);
4606
+ const output4 = builder.gatherNd(input2, indices4);
4607
+
4608
+ // input of shape [2,2,2] :
4609
+ // [[[0, 1] ,
4610
+ // [2, 3] ],
4611
+ // [[4, 5] ,
4612
+ // [6, 7] ]]
4613
+ // indices of shape [5,3] :
4614
+ // [[0,0,1] ,
4615
+ // [0,1,0] ,
4616
+ // [1,0,0] ,
4617
+ // [1,1,0] ,
4618
+ // [1,1,1] ]
4619
+ // output of shape [5] :
4620
+ // [1,2,4,6,7]
4621
+
4622
+ const indices5 = builder.constant(
4623
+ {dataType: 'uint32' , shape: [5, 3] },
4624
+ new Uint32Array([0,0,1, 0,1,0, 1,0,0, 1,1,0, 1,1,1] ));
4625
+
4626
+ const output5 = builder.gatherNd(input2, indices5);
4604
4627
</pre>
4605
4628
</details>
4606
4629
</div>
0 commit comments