Skip to content

Commit 40e2956

Browse files
miaobinchromium-wpt-export-bot
authored andcommitted
WebNN: Remove argmin/max selectLastIndex parameter
This CL removes the selectLastIndex parameter from argMin and argMax to align with the spec change [1]. The changes include the definition of IDL and mojo, the implementation of DirectML and TfLite backend and the related unit tests and WPT tests. [1] webmachinelearning/webnn#722 Bug: 352314071, 40206287 Change-Id: Ifbb1c5b8c5eef41f87b279c2b1018d2d5d0198ea Cq-Include-Trybots: luci.chromium.try:win11-blink-rel,mac14.arm64-blink-rel,mac14-blink-rel Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5700708 Reviewed-by: Phillis Tang <phillis@chromium.org> Reviewed-by: Elly FJ <ellyjones@chromium.org> Reviewed-by: ningxin hu <ningxin.hu@intel.com> Commit-Queue: Bin Miao <bin.miao@intel.com> Cr-Commit-Position: refs/heads/main@{#1328688}
1 parent c4ba02f commit 40e2956

2 files changed

Lines changed: 14 additions & 404 deletions

File tree

webnn/resources/test_data/arg_max.json

Lines changed: 7 additions & 202 deletions
Original file line numberDiff line numberDiff line change
@@ -471,98 +471,6 @@
471471
"type": "int32"
472472
}
473473
},
474-
{
475-
"name": "argMax float32 4D tensor options.selectLastIndex=true",
476-
"inputs": {
477-
"input": {
478-
"shape": [2, 1, 4, 3],
479-
"data": [
480-
-51.0936194154457,
481-
-6.5397018645619625,
482-
73.81338015899149,
483-
88.46114630531724,
484-
-5.294266751122791,
485-
-79.20668057325759,
486-
-41.70176598864654,
487-
73.81338015899149,
488-
88.46114630531724,
489-
-84.939998758247,
490-
-61.488942502520906,
491-
-98.33874402761955,
492-
-51.0936194154457,
493-
-6.5397018645619625,
494-
73.81338015899149,
495-
88.46114630531724,
496-
-5.294266751122791,
497-
-79.20668057325759,
498-
-41.70176598864654,
499-
73.81338015899149,
500-
88.46114630531724,
501-
-84.939998758247,
502-
-61.488942502520906,
503-
-98.33874402761955
504-
],
505-
"type": "float32"
506-
}
507-
},
508-
"options": {
509-
"selectLastIndex": true
510-
},
511-
"expected": {
512-
"name": "output",
513-
"shape": [],
514-
"data": [
515-
20
516-
],
517-
"type": "int32"
518-
}
519-
},
520-
{
521-
"name": "argMax float32 4D tensor options.selectLastIndex=false",
522-
"inputs": {
523-
"input": {
524-
"shape": [2, 1, 4, 3],
525-
"data": [
526-
-51.0936194154457,
527-
-6.5397018645619625,
528-
73.81338015899149,
529-
88.46114630531724,
530-
-5.294266751122791,
531-
-79.20668057325759,
532-
-41.70176598864654,
533-
73.81338015899149,
534-
88.46114630531724,
535-
-84.939998758247,
536-
-61.488942502520906,
537-
-98.33874402761955,
538-
-51.0936194154457,
539-
-6.5397018645619625,
540-
73.81338015899149,
541-
88.46114630531724,
542-
-5.294266751122791,
543-
-79.20668057325759,
544-
-41.70176598864654,
545-
73.81338015899149,
546-
88.46114630531724,
547-
-84.939998758247,
548-
-61.488942502520906,
549-
-98.33874402761955
550-
],
551-
"type": "float32"
552-
}
553-
},
554-
"options": {
555-
"selectLastIndex": false
556-
},
557-
"expected": {
558-
"name": "output",
559-
"shape": [],
560-
"data": [
561-
3
562-
],
563-
"type": "int32"
564-
}
565-
},
566474
{
567475
"name": "argMax float32 4D tensor options.axes=[0, 2] options.keepDimensions=false",
568476
"inputs": {
@@ -663,7 +571,7 @@
663571
}
664572
},
665573
{
666-
"name": "argMax float32 4D tensor options.axes=[0, 2] options.selectLastIndex=false",
574+
"name": "argMax float32 4D tensor options.axes=[0, 2]",
667575
"inputs": {
668576
"input": {
669577
"shape": [2, 1, 4, 3],
@@ -697,8 +605,7 @@
697605
}
698606
},
699607
"options": {
700-
"axes": [0, 2],
701-
"selectLastIndex": false
608+
"axes": [0, 2]
702609
},
703610
"expected": {
704611
"name": "output",
@@ -712,7 +619,7 @@
712619
}
713620
},
714621
{
715-
"name": "argMax float32 4D tensor options.axes=[0, 2] options.selectLastIndex=true",
622+
"name": "argMax float32 4D tensor options.axes=[3, 0, 1]",
716623
"inputs": {
717624
"input": {
718625
"shape": [2, 1, 4, 3],
@@ -746,57 +653,7 @@
746653
}
747654
},
748655
"options": {
749-
"axes": [0, 2],
750-
"selectLastIndex": true
751-
},
752-
"expected": {
753-
"name": "output",
754-
"shape": [1, 3],
755-
"data": [
756-
5,
757-
6,
758-
6
759-
],
760-
"type": "int32"
761-
}
762-
},
763-
{
764-
"name": "argMax float32 4D tensor options.axes=[3, 0, 1] options.selectLastIndex=false",
765-
"inputs": {
766-
"input": {
767-
"shape": [2, 1, 4, 3],
768-
"data": [
769-
-51.0936194154457,
770-
-6.5397018645619625,
771-
73.81338015899149,
772-
88.46114630531724,
773-
-5.294266751122791,
774-
-79.20668057325759,
775-
-41.70176598864654,
776-
73.81338015899149,
777-
88.46114630531724,
778-
-84.939998758247,
779-
-61.488942502520906,
780-
-98.33874402761955,
781-
-51.0936194154457,
782-
-6.5397018645619625,
783-
73.81338015899149,
784-
88.46114630531724,
785-
-5.294266751122791,
786-
-79.20668057325759,
787-
-41.70176598864654,
788-
73.81338015899149,
789-
88.46114630531724,
790-
-84.939998758247,
791-
-61.488942502520906,
792-
-98.33874402761955
793-
],
794-
"type": "float32"
795-
}
796-
},
797-
"options": {
798-
"axes": [3, 0, 1],
799-
"selectLastIndex": false
656+
"axes": [3, 0, 1]
800657
},
801658
"expected": {
802659
"name": "output",
@@ -810,56 +667,6 @@
810667
"type": "int32"
811668
}
812669
},
813-
{
814-
"name": "argMax float32 4D tensor options.axes=[3, 0, 1] options.selectLastIndex=true",
815-
"inputs": {
816-
"input": {
817-
"shape": [2, 1, 4, 3],
818-
"data": [
819-
-51.0936194154457,
820-
-6.5397018645619625,
821-
73.81338015899149,
822-
88.46114630531724,
823-
-5.294266751122791,
824-
-79.20668057325759,
825-
-41.70176598864654,
826-
73.81338015899149,
827-
88.46114630531724,
828-
-84.939998758247,
829-
-61.488942502520906,
830-
-98.33874402761955,
831-
-51.0936194154457,
832-
-6.5397018645619625,
833-
73.81338015899149,
834-
88.46114630531724,
835-
-5.294266751122791,
836-
-79.20668057325759,
837-
-41.70176598864654,
838-
73.81338015899149,
839-
88.46114630531724,
840-
-84.939998758247,
841-
-61.488942502520906,
842-
-98.33874402761955
843-
],
844-
"type": "float32"
845-
}
846-
},
847-
"options": {
848-
"axes": [3, 0, 1],
849-
"selectLastIndex": true
850-
},
851-
"expected": {
852-
"name": "output",
853-
"shape": [4],
854-
"data": [
855-
5,
856-
3,
857-
5,
858-
4
859-
],
860-
"type": "int32"
861-
}
862-
},
863670
{
864671
"name": "argMax float32 4D tensor all options",
865672
"inputs": {
@@ -896,8 +703,7 @@
896703
},
897704
"options": {
898705
"axes": [3, 0],
899-
"keepDimensions": true,
900-
"selectLastIndex": false
706+
"keepDimensions": true
901707
},
902708
"expected": {
903709
"name": "output",
@@ -935,7 +741,7 @@
935741
}
936742
},
937743
{
938-
"name": "argMax float32 0D scalar options.axes=[] no effect by both keepDimensions and selectLastIndex being true",
744+
"name": "argMax float32 0D scalar options.axes=[] no effect by keepDimensions being true",
939745
"inputs": {
940746
"input": {
941747
"shape": [],
@@ -947,8 +753,7 @@
947753
},
948754
"options": {
949755
"axes": [],
950-
"keepDimensions": true,
951-
"selectLastIndex": true
756+
"keepDimensions": true
952757
},
953758
"expected": {
954759
"name": "output",

0 commit comments

Comments
 (0)