Skip to content

Commit ab84855

Browse files
committed
Bug 1949929 [wpt PR 50891] - webnn: implement quantizeLinear on coreml, a=testonly
Automatic update from web-platform-tests webnn: implement quantizeLinear on coreml Implement `quantizeLinear` using CoreML `quantize` op. Add a cast_to_supported_type flag to `webnn_conformance_test` that skips return early when input/output doesn't match opSupportLimits. `buildAndExecuteGraphFunc` already has logic that handles implicit casting. Change-Id: I370ffccfa51b3156216c4504622bfb81543ea853 Bug: 385173305 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6289944 Reviewed-by: Reilly Grant <reillygchromium.org> Commit-Queue: Phillis Tang <phillischromium.org> Cr-Commit-Position: refs/heads/main{#1423539} -- wpt-commits: f33579b93fb82e61f0c5302f05caa94bc0a274d7 wpt-pr: 50891 UltraBlame original commit: b11d24d120563a3b010411e946ce6980f9daac64
1 parent aa0d27a commit ab84855

File tree

3 files changed

+376
-5
lines changed

3 files changed

+376
-5
lines changed

testing/web-platform/tests/webnn/conformance_tests/dequantizeLinear.https.any.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3698,6 +3698,13 @@ webnn_conformance_test
36983698
buildAndExecuteGraph
36993699
getDequantizeLinearPrecisionTolerance
37003700
test
3701+
/
3702+
*
3703+
cast_to_supported_type
3704+
=
3705+
*
3706+
/
3707+
true
37013708
)
37023709
;
37033710
}

testing/web-platform/tests/webnn/conformance_tests/quantizeLinear.https.any.js

Lines changed: 256 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,9 +431,257 @@ float32
431431
1D
432432
constant
433433
tensor
434-
broadcasting
434+
'
435+
'
436+
graph
437+
'
438+
:
439+
{
440+
'
441+
inputs
442+
'
443+
:
444+
{
445+
'
446+
quantizeLinearInput
447+
'
448+
:
449+
{
450+
'
451+
data
452+
'
453+
:
454+
[
455+
-
456+
2
457+
.
458+
549168109893799
459+
-
460+
4
461+
.
462+
794857501983643
463+
8
464+
.
465+
413617134094238
466+
6
467+
.
468+
108623504638672
469+
]
470+
'
471+
descriptor
472+
'
473+
:
474+
{
475+
shape
476+
:
477+
[
478+
4
479+
]
480+
dataType
481+
:
482+
'
483+
float32
484+
'
485+
}
486+
'
487+
constant
488+
'
489+
:
490+
true
491+
}
492+
'
493+
quantizeLinearScale
494+
'
495+
:
496+
{
497+
'
498+
data
499+
'
500+
:
501+
[
502+
9
503+
.
504+
343092918395996
505+
0
506+
.
507+
2800687253475189
508+
4
509+
.
510+
617084980010986
511+
1
512+
.
513+
1202747821807861
514+
]
515+
'
516+
descriptor
517+
'
518+
:
519+
{
520+
shape
521+
:
522+
[
523+
4
524+
]
525+
dataType
526+
:
527+
'
528+
float32
529+
'
530+
}
531+
'
532+
constant
533+
'
534+
:
535+
true
536+
}
537+
'
538+
quantizeLinearZeroPoint
539+
'
540+
:
541+
{
542+
'
543+
data
544+
'
545+
:
546+
[
547+
128
548+
128
549+
128
550+
128
551+
]
552+
'
553+
descriptor
554+
'
555+
:
556+
{
557+
shape
558+
:
559+
[
560+
4
561+
]
562+
dataType
563+
:
564+
'
565+
uint8
566+
'
567+
}
568+
'
569+
constant
570+
'
571+
:
572+
true
573+
}
574+
}
575+
'
576+
operators
577+
'
578+
:
579+
[
580+
{
581+
'
582+
name
583+
'
584+
:
585+
'
586+
quantizeLinear
587+
'
588+
'
589+
arguments
590+
'
591+
:
592+
[
593+
{
594+
'
595+
input
596+
'
597+
:
598+
'
599+
quantizeLinearInput
600+
'
601+
}
602+
{
603+
'
604+
scale
605+
'
606+
:
607+
'
608+
quantizeLinearScale
609+
'
610+
}
611+
{
612+
'
435613
zeroPoint
436614
'
615+
:
616+
'
617+
quantizeLinearZeroPoint
618+
'
619+
}
620+
]
621+
'
622+
outputs
623+
'
624+
:
625+
'
626+
quantizeLinearOutput
627+
'
628+
}
629+
]
630+
'
631+
expectedOutputs
632+
'
633+
:
634+
{
635+
'
636+
quantizeLinearOutput
637+
'
638+
:
639+
{
640+
'
641+
data
642+
'
643+
:
644+
[
645+
128
646+
111
647+
130
648+
133
649+
]
650+
'
651+
descriptor
652+
'
653+
:
654+
{
655+
shape
656+
:
657+
[
658+
4
659+
]
660+
dataType
661+
:
662+
'
663+
uint8
664+
'
665+
}
666+
}
667+
}
668+
}
669+
}
670+
{
671+
'
672+
name
673+
'
674+
:
675+
'
676+
quantizeLinear
677+
float32
678+
1D
679+
constant
680+
tensor
681+
with
682+
negative
683+
scale
684+
'
437685
'
438686
graph
439687
'
@@ -3427,6 +3675,13 @@ webnn_conformance_test
34273675
buildAndExecuteGraph
34283676
getQuantizeLinearPrecisionTolerance
34293677
test
3678+
/
3679+
*
3680+
cast_to_supported_type
3681+
=
3682+
*
3683+
/
3684+
true
34303685
)
34313686
;
34323687
}

0 commit comments

Comments
 (0)