diff --git a/tests/wpt/meta-legacy-layout/css/css-animations/animate-with-color-mix.html.ini b/tests/wpt/meta-legacy-layout/css/css-animations/animate-with-color-mix.html.ini new file mode 100644 index 00000000000..4172b4ec02b --- /dev/null +++ b/tests/wpt/meta-legacy-layout/css/css-animations/animate-with-color-mix.html.ini @@ -0,0 +1,18 @@ +[animate-with-color-mix.html] + [Animate from neutral keyframe with color-mix to legacy rgb] + expected: FAIL + + [Animate from legacy rgb to neutral keyframe with color-mix] + expected: FAIL + + [Animate from neutral keyframe with color-mix to srgb] + expected: FAIL + + [Animate from srgb to neutral keyframe with color-mix] + expected: FAIL + + [Animate from color-mix with transparency to legacy rgba] + expected: FAIL + + [Animate from legacy rgba to color-mix with transparency] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-color/parsing/color-computed-relative-color.html.ini b/tests/wpt/meta-legacy-layout/css/css-color/parsing/color-computed-relative-color.html.ini index 6ca549e0935..718a1bf8f6b 100644 --- a/tests/wpt/meta-legacy-layout/css/css-color/parsing/color-computed-relative-color.html.ini +++ b/tests/wpt/meta-legacy-layout/css/css-color/parsing/color-computed-relative-color.html.ini @@ -3316,3 +3316,9 @@ [Property color value 'color(from color(xyz-d65 7 -20.5 100 / 0.8) xyz-d65 calc(x + 1) calc(y + 1) calc(z + 1) / calc(alpha + 0.01))'] expected: FAIL + + [Property color value 'color(from color(srgb 0.25 0.5 0.75) xyz-d50 x y z)'] + expected: FAIL + + [Property color value 'color(from color(srgb 0.25 0.5 0.75) xyz-d65 x y z)'] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-text/text-spacing-trim/text-spacing-trim-end-001.html.ini b/tests/wpt/meta-legacy-layout/css/css-text/text-spacing-trim/text-spacing-trim-end-001.html.ini new file mode 100644 index 00000000000..175c900f1b4 --- /dev/null +++ b/tests/wpt/meta-legacy-layout/css/css-text/text-spacing-trim/text-spacing-trim-end-001.html.ini @@ -0,0 +1,11 @@ +[text-spacing-trim-end-001.html?class=halt,vrl] + expected: FAIL + +[text-spacing-trim-end-001.html?class=chws,vrl] + expected: FAIL + +[text-spacing-trim-end-001.html?class=halt,htb] + expected: FAIL + +[text-spacing-trim-end-001.html?class=chws,htb] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-text/text-transform/math/text-transform-math-auto-003.html.ini b/tests/wpt/meta-legacy-layout/css/css-text/text-transform/math/text-transform-math-auto-003.html.ini new file mode 100644 index 00000000000..f63461815af --- /dev/null +++ b/tests/wpt/meta-legacy-layout/css/css-text/text-transform/math/text-transform-math-auto-003.html.ini @@ -0,0 +1,336 @@ +[text-transform-math-auto-003.html] + [Selection.toString() for math-auto 'A' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'B' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'C' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'D' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'E' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'F' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'G' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'H' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'I' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'J' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'K' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'L' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'M' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'N' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'O' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'P' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'Q' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'R' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'S' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'T' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'U' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'V' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'W' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'X' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'Y' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'Z' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'a' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'b' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'c' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'd' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'e' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'f' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'g' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'h' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'i' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'j' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'k' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'l' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'm' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'n' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'o' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'p' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'q' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'r' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 's' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 't' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'u' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'v' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'w' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'x' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'y' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'z' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'ı' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'ȷ' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'Α' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'Β' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'Γ' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'Δ' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'Ε' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'Ζ' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'Η' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'Θ' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'Ι' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'Κ' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'Λ' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'Μ' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'Ν' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'Ξ' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'Ο' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'Π' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'Ρ' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'Σ' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'Τ' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'Υ' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'Φ' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'Χ' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'Ψ' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'Ω' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'α' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'β' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'γ' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'δ' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'ε' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'ζ' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'η' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'θ' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'ι' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'κ' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'λ' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'μ' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'ν' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'ξ' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'ο' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'π' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'ρ' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'ς' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'σ' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'τ' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'υ' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'φ' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'χ' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'ψ' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'ω' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'ϑ' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'ϕ' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'ϖ' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'ϰ' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'ϱ' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'ϴ' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto 'ϵ' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto '∂' returns the transformed character.] + expected: FAIL + + [Selection.toString() for math-auto '∇' returns the transformed character.] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-text/text-transform/text-transform-upperlower-107.html.ini b/tests/wpt/meta-legacy-layout/css/css-text/text-transform/text-transform-upperlower-107.html.ini new file mode 100644 index 00000000000..afffdbf6c3b --- /dev/null +++ b/tests/wpt/meta-legacy-layout/css/css-text/text-transform/text-transform-upperlower-107.html.ini @@ -0,0 +1,3 @@ +[text-transform-upperlower-107.html] + [Selection.toString() for 'ß' with text-transform: uppercase] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-transitions/animations/animate-with-color-mix.html.ini b/tests/wpt/meta-legacy-layout/css/css-transitions/animations/animate-with-color-mix.html.ini new file mode 100644 index 00000000000..b195b0e5f61 --- /dev/null +++ b/tests/wpt/meta-legacy-layout/css/css-transitions/animations/animate-with-color-mix.html.ini @@ -0,0 +1,18 @@ +[animate-with-color-mix.html] + [Transition from color-mix to legacy rgb] + expected: FAIL + + [Transition from legacy rgb to color-mix] + expected: FAIL + + [Transition from color-mix to srgb] + expected: FAIL + + [Transition from srgb to color-mix] + expected: FAIL + + [Transition from color-mix with transparency to legacy rgba] + expected: FAIL + + [Transition from legacy rgba to color-mix with transparency] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-values/progress-computed.tentative.html.ini b/tests/wpt/meta-legacy-layout/css/css-values/progress-computed.tentative.html.ini index a08341d7a0f..47102f89bf6 100644 --- a/tests/wpt/meta-legacy-layout/css/css-values/progress-computed.tentative.html.ini +++ b/tests/wpt/meta-legacy-layout/css/css-values/progress-computed.tentative.html.ini @@ -55,3 +55,12 @@ [calc(progress(sign(1001em - 10lh * progress(100px from 2rex to 10ex)) * 20em from 2rem to 12em) * 2) should be used-value-equivalent to 4] expected: FAIL + + [calc(progress(abs(5%) from hypot(3%, 4%) to 10%)) should be used-value-equivalent to 0] + expected: FAIL + + [progress(1000em from 10em to 110em) should be used-value-equivalent to 9.9] + expected: FAIL + + [scale(progress(1000em from 10rem to 110em)) should be used-value-equivalent to scale(9.9)] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/cssom-view/MediaQueryList-addListener-removeListener.html.ini b/tests/wpt/meta-legacy-layout/css/cssom-view/MediaQueryList-addListener-removeListener.html.ini index 314dca9c1f5..d52a3e77a70 100644 --- a/tests/wpt/meta-legacy-layout/css/cssom-view/MediaQueryList-addListener-removeListener.html.ini +++ b/tests/wpt/meta-legacy-layout/css/cssom-view/MediaQueryList-addListener-removeListener.html.ini @@ -1,3 +1,6 @@ [MediaQueryList-addListener-removeListener.html] [listeners are called when + \ No newline at end of file diff --git a/tests/wpt/tests/css/css-highlight-api/painting/custom-highlight-dynamic-container-metrics-001.html b/tests/wpt/tests/css/css-highlight-api/painting/custom-highlight-dynamic-container-metrics-001.html new file mode 100644 index 00000000000..2c28f7d132a --- /dev/null +++ b/tests/wpt/tests/css/css-highlight-api/painting/custom-highlight-dynamic-container-metrics-001.html @@ -0,0 +1,32 @@ + + + +CSS Highlight API Test: Highlights using container sizes update on container changes + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/wpt/tests/css/css-highlight-api/painting/custom-highlight-dynamic-container-metrics-002.html b/tests/wpt/tests/css/css-highlight-api/painting/custom-highlight-dynamic-container-metrics-002.html new file mode 100644 index 00000000000..1a0cbe87a55 --- /dev/null +++ b/tests/wpt/tests/css/css-highlight-api/painting/custom-highlight-dynamic-container-metrics-002.html @@ -0,0 +1,50 @@ + + + +CSS Highlight API Test: Highlights using dynamic container sizes + + + + + + + + + + + +
+
With container size
+
+
Without container size
+ + + diff --git a/tests/wpt/tests/css/css-highlight-api/painting/custom-highlight-dynamic-container-metrics-003.html b/tests/wpt/tests/css/css-highlight-api/painting/custom-highlight-dynamic-container-metrics-003.html new file mode 100644 index 00000000000..38246a15aff --- /dev/null +++ b/tests/wpt/tests/css/css-highlight-api/painting/custom-highlight-dynamic-container-metrics-003.html @@ -0,0 +1,48 @@ + + +CSS Highlight API Test: Highlights using dynamic container sizes + + + + + + + + + +
+
With container size
+
+
Should be no highlight
+ + diff --git a/tests/wpt/tests/css/css-highlight-api/painting/custom-highlight-dynamic-container-metrics-004.html b/tests/wpt/tests/css/css-highlight-api/painting/custom-highlight-dynamic-container-metrics-004.html new file mode 100644 index 00000000000..fbdbea32efc --- /dev/null +++ b/tests/wpt/tests/css/css-highlight-api/painting/custom-highlight-dynamic-container-metrics-004.html @@ -0,0 +1,47 @@ + + +CSS Highlight API Test: Highlights using container sizes + + + + + + + + + +
With container size
+
Should be no highlight
+ + + diff --git a/tests/wpt/tests/css/css-highlight-api/painting/custom-highlight-dynamic-font-metrics-001.html b/tests/wpt/tests/css/css-highlight-api/painting/custom-highlight-dynamic-font-metrics-001.html new file mode 100644 index 00000000000..4bddbc02a1d --- /dev/null +++ b/tests/wpt/tests/css/css-highlight-api/painting/custom-highlight-dynamic-font-metrics-001.html @@ -0,0 +1,47 @@ + + +CSS Highlight API Test: + + + + + + + + + +
Font relative units with 40px font
+
Font relative units with 20px font
+ + + \ No newline at end of file diff --git a/tests/wpt/tests/css/css-highlight-api/painting/custom-highlight-dynamic-logical-metrics-001.html b/tests/wpt/tests/css/css-highlight-api/painting/custom-highlight-dynamic-logical-metrics-001.html new file mode 100644 index 00000000000..ff52aed6ab1 --- /dev/null +++ b/tests/wpt/tests/css/css-highlight-api/painting/custom-highlight-dynamic-logical-metrics-001.html @@ -0,0 +1,39 @@ + + +CSS Highlight API Test: Length relative to a changing logical direction + + + + + + + + + +
With viewport size
+ + diff --git a/tests/wpt/tests/css/css-highlight-api/painting/resources/iframe-container.html b/tests/wpt/tests/css/css-highlight-api/painting/resources/iframe-container.html new file mode 100644 index 00000000000..c89680e28c9 --- /dev/null +++ b/tests/wpt/tests/css/css-highlight-api/painting/resources/iframe-container.html @@ -0,0 +1,16 @@ + + +
With container size
+ diff --git a/tests/wpt/tests/css/css-masking/mask-image/mask-image-svg-gradient-zoomed.html b/tests/wpt/tests/css/css-masking/mask-image/mask-image-svg-gradient-zoomed.html new file mode 100644 index 00000000000..17d2869f6e4 --- /dev/null +++ b/tests/wpt/tests/css/css-masking/mask-image/mask-image-svg-gradient-zoomed.html @@ -0,0 +1,14 @@ + +linear-gradient() mask-image on <rect> in zoomed SVG + + + +

Test passes if there is a filled green square.

+ + + diff --git a/tests/wpt/tests/css/css-nesting/conditional-rules.html b/tests/wpt/tests/css/css-nesting/conditional-rules.html index ec6f781960b..0172db645b2 100644 --- a/tests/wpt/tests/css/css-nesting/conditional-rules.html +++ b/tests/wpt/tests/css/css-nesting/conditional-rules.html @@ -70,6 +70,6 @@
-
+
diff --git a/tests/wpt/tests/css/css-overflow/scrollbar-gutter-dynamic-004-ref.html b/tests/wpt/tests/css/css-overflow/scrollbar-gutter-dynamic-004-ref.html new file mode 100644 index 00000000000..edafd49e524 --- /dev/null +++ b/tests/wpt/tests/css/css-overflow/scrollbar-gutter-dynamic-004-ref.html @@ -0,0 +1,9 @@ + + + +

Should not have space around me in the inline axis.

diff --git a/tests/wpt/tests/css/css-overflow/scrollbar-gutter-dynamic-004.html b/tests/wpt/tests/css/css-overflow/scrollbar-gutter-dynamic-004.html new file mode 100644 index 00000000000..07b66eede73 --- /dev/null +++ b/tests/wpt/tests/css/css-overflow/scrollbar-gutter-dynamic-004.html @@ -0,0 +1,26 @@ + + + +CSS Overflow: scrollbar-gutter changing dynamically on the root element + + + + + + +

Should not have space around me in the inline axis.

+ diff --git a/tests/wpt/tests/css/css-page/parsing/margin-rules-001.html b/tests/wpt/tests/css/css-page/parsing/margin-rules-001.html index b73d1bc56fc..c4270fe606a 100644 --- a/tests/wpt/tests/css/css-page/parsing/margin-rules-001.html +++ b/tests/wpt/tests/css/css-page/parsing/margin-rules-001.html @@ -45,7 +45,7 @@ test(t => { } // Test that margin-rules are valid inside page-rules. for(let t in ruleTypes){ - test_valid_rule("@page{ " + ruleTypes[t] + "{ } }"); + test_valid_rule("@page { " + ruleTypes[t] + " { } }"); } }, "margin-rules-001"); diff --git a/tests/wpt/tests/css/css-properties-values-api/unit-cycles.html b/tests/wpt/tests/css/css-properties-values-api/unit-cycles.html index 9454c95ac30..de26e712c77 100644 --- a/tests/wpt/tests/css/css-properties-values-api/unit-cycles.html +++ b/tests/wpt/tests/css/css-properties-values-api/unit-cycles.html @@ -4,15 +4,23 @@ +
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/tests/wpt/tests/css/css-text/text-spacing-trim/text-spacing-trim-end-001-ref.html b/tests/wpt/tests/css/css-text/text-spacing-trim/text-spacing-trim-end-001-ref.html new file mode 100644 index 00000000000..57013882323 --- /dev/null +++ b/tests/wpt/tests/css/css-text/text-spacing-trim/text-spacing-trim-end-001-ref.html @@ -0,0 +1,19 @@ + + + + +
+
国国国)
国国国)
+
diff --git a/tests/wpt/tests/css/css-text/text-spacing-trim/text-spacing-trim-end-001.html b/tests/wpt/tests/css/css-text/text-spacing-trim/text-spacing-trim-end-001.html new file mode 100644 index 00000000000..c5293f09981 --- /dev/null +++ b/tests/wpt/tests/css/css-text/text-spacing-trim/text-spacing-trim-end-001.html @@ -0,0 +1,34 @@ + + + + + + + + + + +
+
国国国)国国国)
+
diff --git a/tests/wpt/tests/css/css-text/text-spacing-trim/text-spacing-trim-start-001-ref.html b/tests/wpt/tests/css/css-text/text-spacing-trim/text-spacing-trim-start-001-ref.html index aef81fbbc0d..60a255160f2 100644 --- a/tests/wpt/tests/css/css-text/text-spacing-trim/text-spacing-trim-start-001-ref.html +++ b/tests/wpt/tests/css/css-text/text-spacing-trim/text-spacing-trim-start-001-ref.html @@ -10,6 +10,7 @@ font-family: halt-font; font-size: 20px; inline-size: 4em; + text-spacing-trim: space-all; } .vrl { writing-mode: vertical-rl; @@ -26,6 +27,7 @@ halt {
国国国国国国
+
国国国)国国)
国国国国
国国国国
diff --git a/tests/wpt/tests/css/css-text/text-spacing-trim/text-spacing-trim-start-001.html b/tests/wpt/tests/css/css-text/text-spacing-trim/text-spacing-trim-start-001.html index 3d481df1da2..f007245277b 100644 --- a/tests/wpt/tests/css/css-text/text-spacing-trim/text-spacing-trim-start-001.html +++ b/tests/wpt/tests/css/css-text/text-spacing-trim/text-spacing-trim-start-001.html @@ -44,6 +44,7 @@
(国国国(国国国(国
+
国国国)(国国)(国
国国国国(
国国国国“
diff --git a/tests/wpt/tests/css/css-text/text-transform/math/italic-mapping.js b/tests/wpt/tests/css/css-text/text-transform/math/italic-mapping.js new file mode 100644 index 00000000000..ba17d3f6b60 --- /dev/null +++ b/tests/wpt/tests/css/css-text/text-transform/math/italic-mapping.js @@ -0,0 +1,115 @@ +// Generated by mathml/tools/mathvariant.py; DO NOT EDIT. +let italic_mapping = { + 0x41: 0x1D434, + 0x42: 0x1D435, + 0x43: 0x1D436, + 0x44: 0x1D437, + 0x45: 0x1D438, + 0x46: 0x1D439, + 0x47: 0x1D43A, + 0x48: 0x1D43B, + 0x49: 0x1D43C, + 0x4A: 0x1D43D, + 0x4B: 0x1D43E, + 0x4C: 0x1D43F, + 0x4D: 0x1D440, + 0x4E: 0x1D441, + 0x4F: 0x1D442, + 0x50: 0x1D443, + 0x51: 0x1D444, + 0x52: 0x1D445, + 0x53: 0x1D446, + 0x54: 0x1D447, + 0x55: 0x1D448, + 0x56: 0x1D449, + 0x57: 0x1D44A, + 0x58: 0x1D44B, + 0x59: 0x1D44C, + 0x5A: 0x1D44D, + 0x61: 0x1D44E, + 0x62: 0x1D44F, + 0x63: 0x1D450, + 0x64: 0x1D451, + 0x65: 0x1D452, + 0x66: 0x1D453, + 0x67: 0x1D454, + 0x68: 0x210E, + 0x69: 0x1D456, + 0x6A: 0x1D457, + 0x6B: 0x1D458, + 0x6C: 0x1D459, + 0x6D: 0x1D45A, + 0x6E: 0x1D45B, + 0x6F: 0x1D45C, + 0x70: 0x1D45D, + 0x71: 0x1D45E, + 0x72: 0x1D45F, + 0x73: 0x1D460, + 0x74: 0x1D461, + 0x75: 0x1D462, + 0x76: 0x1D463, + 0x77: 0x1D464, + 0x78: 0x1D465, + 0x79: 0x1D466, + 0x7A: 0x1D467, + 0x131: 0x1D6A4, + 0x237: 0x1D6A5, + 0x391: 0x1D6E2, + 0x392: 0x1D6E3, + 0x393: 0x1D6E4, + 0x394: 0x1D6E5, + 0x395: 0x1D6E6, + 0x396: 0x1D6E7, + 0x397: 0x1D6E8, + 0x398: 0x1D6E9, + 0x399: 0x1D6EA, + 0x39A: 0x1D6EB, + 0x39B: 0x1D6EC, + 0x39C: 0x1D6ED, + 0x39D: 0x1D6EE, + 0x39E: 0x1D6EF, + 0x39F: 0x1D6F0, + 0x3A0: 0x1D6F1, + 0x3A1: 0x1D6F2, + 0x3F4: 0x1D6F3, + 0x3A3: 0x1D6F4, + 0x3A4: 0x1D6F5, + 0x3A5: 0x1D6F6, + 0x3A6: 0x1D6F7, + 0x3A7: 0x1D6F8, + 0x3A8: 0x1D6F9, + 0x3A9: 0x1D6FA, + 0x2207: 0x1D6FB, + 0x3B1: 0x1D6FC, + 0x3B2: 0x1D6FD, + 0x3B3: 0x1D6FE, + 0x3B4: 0x1D6FF, + 0x3B5: 0x1D700, + 0x3B6: 0x1D701, + 0x3B7: 0x1D702, + 0x3B8: 0x1D703, + 0x3B9: 0x1D704, + 0x3BA: 0x1D705, + 0x3BB: 0x1D706, + 0x3BC: 0x1D707, + 0x3BD: 0x1D708, + 0x3BE: 0x1D709, + 0x3BF: 0x1D70A, + 0x3C0: 0x1D70B, + 0x3C1: 0x1D70C, + 0x3C2: 0x1D70D, + 0x3C3: 0x1D70E, + 0x3C4: 0x1D70F, + 0x3C5: 0x1D710, + 0x3C6: 0x1D711, + 0x3C7: 0x1D712, + 0x3C8: 0x1D713, + 0x3C9: 0x1D714, + 0x2202: 0x1D715, + 0x3F5: 0x1D716, + 0x3D1: 0x1D717, + 0x3F0: 0x1D718, + 0x3D5: 0x1D719, + 0x3F1: 0x1D71A, + 0x3D6: 0x1D71B, +} diff --git a/tests/wpt/tests/css/css-text/text-transform/math/text-transform-math-auto-003.html b/tests/wpt/tests/css/css-text/text-transform/math/text-transform-math-auto-003.html new file mode 100644 index 00000000000..eff01b08902 --- /dev/null +++ b/tests/wpt/tests/css/css-text/text-transform/math/text-transform-math-auto-003.html @@ -0,0 +1,38 @@ + + + + + text-transform math-auto + + + + + + + + + + + + + diff --git a/tests/wpt/tests/css/css-text/text-transform/text-transform-upperlower-107.html b/tests/wpt/tests/css/css-text/text-transform/text-transform-upperlower-107.html new file mode 100644 index 00000000000..791edd14c0e --- /dev/null +++ b/tests/wpt/tests/css/css-text/text-transform/text-transform-upperlower-107.html @@ -0,0 +1,22 @@ + + +CSS Text Test: text-transform uppercase German sharp S and selection + + + + + + + +ß + + diff --git a/tests/wpt/tests/css/css-transitions/all-with-discrete.tentative.html b/tests/wpt/tests/css/css-transitions/all-with-discrete.tentative.html index c3642eeed89..37946717b4c 100644 --- a/tests/wpt/tests/css/css-transitions/all-with-discrete.tentative.html +++ b/tests/wpt/tests/css/css-transitions/all-with-discrete.tentative.html @@ -5,17 +5,20 @@ -
hello
+
Allow discrete
+
No discrete
@@ -23,8 +26,14 @@ + + + + +
+
+
+
+
+
+ + + diff --git a/tests/wpt/tests/css/css-typed-om/stylevalue-serialization/cssUnparsedValue.html b/tests/wpt/tests/css/css-typed-om/stylevalue-serialization/cssUnparsedValue.html index 6fc2e0284c1..c87553dd917 100644 --- a/tests/wpt/tests/css/css-typed-om/stylevalue-serialization/cssUnparsedValue.html +++ b/tests/wpt/tests/css/css-typed-om/stylevalue-serialization/cssUnparsedValue.html @@ -2,17 +2,18 @@ IDL-constructed CSSUnparsedValue serialization tests - + -
+
+
diff --git a/tests/wpt/tests/css/css-ui/parsing/resize-invalid.html b/tests/wpt/tests/css/css-ui/parsing/resize-invalid.html index 7f9698f7aad..c6c19ebceac 100644 --- a/tests/wpt/tests/css/css-ui/parsing/resize-invalid.html +++ b/tests/wpt/tests/css/css-ui/parsing/resize-invalid.html @@ -15,6 +15,7 @@ test_invalid_value("resize", "auto"); test_invalid_value("resize", "horizontal vertical"); test_invalid_value("resize", "both 0"); +test_invalid_value("resize", "-internal-textarea-auto"); diff --git a/tests/wpt/tests/css/css-values/progress-computed.tentative.html b/tests/wpt/tests/css/css-values/progress-computed.tentative.html index 2ef09996d55..7f8a1ddd789 100644 --- a/tests/wpt/tests/css/css-values/progress-computed.tentative.html +++ b/tests/wpt/tests/css/css-values/progress-computed.tentative.html @@ -17,9 +17,9 @@ test_math_used('progress(sign(-10px) * 10px from (10px - 10px) to 10px * progres // General calculations test_math_used('calc(progress(100px from 0px to 50px) * 10px + 100px)', '120px'); test_math_used('calc(progress(100 from 0 to sign(50px)))', '100', {type:'number'}); -test_math_used('calc(progress(abs(5%) from hypot(3%, 4%) to 10%))', '1', {type:'number', approx:0.001}); -test_math_used('progress(1000em from 10em to 110em)', '10', {type:'number'}); -test_math_used('scale(progress(1000em from 10rem to 110em))', 'scale(10)', {prop:'transform', type:'number'}); +test_math_used('calc(progress(abs(5%) from hypot(3%, 4%) to 10%))', '0', {type:'number', approx:0.001}); +test_math_used('progress(1000em from 10em to 110em)', '9.9', {type:'number', approx:0.1}); +test_math_used('scale(progress(1000em from 10rem to 110em))', 'scale(9.9)', {prop:'transform', type:'number', approx:0.1}); test_math_used('scale(progress(0em from 0rem to 0em))', 'scale(0)', {prop:'transform', type:'number'}); test_math_used('scale(progress(sign(1em - 1rem) * 1ex from 0rem to 0em))', 'scale(0)', {prop:'transform', type:'number'}); diff --git a/tests/wpt/tests/css/css-view-transitions/parsing/view-transition-name-invalid.html b/tests/wpt/tests/css/css-view-transitions/parsing/view-transition-name-invalid.html index 0151991436c..00cd411d6ad 100644 --- a/tests/wpt/tests/css/css-view-transitions/parsing/view-transition-name-invalid.html +++ b/tests/wpt/tests/css/css-view-transitions/parsing/view-transition-name-invalid.html @@ -12,6 +12,7 @@ - - - - - + + +
@@ -27,11 +25,11 @@
-
+
+
- - - \ No newline at end of file + + diff --git a/tests/wpt/tests/css/cssom-view/getClientRects-zoom.html b/tests/wpt/tests/css/cssom-view/getClientRects-zoom.html index d4c249eadb0..93d42aee87b 100644 --- a/tests/wpt/tests/css/cssom-view/getClientRects-zoom.html +++ b/tests/wpt/tests/css/cssom-view/getClientRects-zoom.html @@ -5,31 +5,30 @@ - - - - + + +
@@ -37,7 +36,8 @@
- - -` \ No newline at end of file + + diff --git a/tests/wpt/tests/css/selectors/has-display-none-checked-ref.html b/tests/wpt/tests/css/selectors/has-display-none-checked-ref.html new file mode 100644 index 00000000000..6e855f52caf --- /dev/null +++ b/tests/wpt/tests/css/selectors/has-display-none-checked-ref.html @@ -0,0 +1,3 @@ + +CSS Test Reference +
PASS
diff --git a/tests/wpt/tests/css/selectors/has-display-none-checked.html b/tests/wpt/tests/css/selectors/has-display-none-checked.html new file mode 100644 index 00000000000..96b1f8bd048 --- /dev/null +++ b/tests/wpt/tests/css/selectors/has-display-none-checked.html @@ -0,0 +1,28 @@ + + + +:has() invalidation inside display: none subtree + + + + + + +
+ +
+
FAIL
+
PASS
+ diff --git a/tests/wpt/tests/css/selectors/invalidation/has-append-first-node.html b/tests/wpt/tests/css/selectors/invalidation/has-append-first-node.html new file mode 100644 index 00000000000..82060cc99fa --- /dev/null +++ b/tests/wpt/tests/css/selectors/invalidation/has-append-first-node.html @@ -0,0 +1,40 @@ + + + + + + + +

Test passes if there is a filled green square and no red.

+
+ + diff --git a/tests/wpt/tests/css/selectors/invalidation/has-sibling-insertion-removal.html b/tests/wpt/tests/css/selectors/invalidation/has-sibling-insertion-removal.html index 3c05a0f495a..0655b230524 100644 --- a/tests/wpt/tests/css/selectors/invalidation/has-sibling-insertion-removal.html +++ b/tests/wpt/tests/css/selectors/invalidation/has-sibling-insertion-removal.html @@ -20,6 +20,7 @@ div, main { color: grey } #subject11:has(+ #sibling11_1 + #sibling11_2 ~ #sibling11_3 > #siblingchild11_3_1) { color: blue } #subject12:has(+ #sibling12_2 ~ #sibling12_3 > #siblingchild12_3_1) { color: yellow } .sibling13:has(~ .sibling13) { color: green } +#subject14:has(~ #sibling14_1 ~ #sibling14_2 ~ #sibling14_3) { color: green }
@@ -108,6 +109,12 @@ div, main { color: grey }
+
+
+
+
+
+
diff --git a/tests/wpt/tests/css/selectors/invalidation/has-with-nesting-parent-containing-hover.html b/tests/wpt/tests/css/selectors/invalidation/has-with-nesting-parent-containing-hover.html new file mode 100644 index 00000000000..8082980e626 --- /dev/null +++ b/tests/wpt/tests/css/selectors/invalidation/has-with-nesting-parent-containing-hover.html @@ -0,0 +1,55 @@ + + +CSS Selector Invalidation: :has() with nesting parent containing :hover + + + + + + + +
#dt1
+
#dd1, Hover me, the DT above should go lime
+
#dt2
+
#dd2, Hover me, both DTs above should go lime
+ \ No newline at end of file diff --git a/tests/wpt/tests/css/selectors/parsing/invalid-pseudos.html b/tests/wpt/tests/css/selectors/parsing/invalid-pseudos.html index a09572b6517..4076e5302bd 100644 --- a/tests/wpt/tests/css/selectors/parsing/invalid-pseudos.html +++ b/tests/wpt/tests/css/selectors/parsing/invalid-pseudos.html @@ -8,7 +8,10 @@ diff --git a/tests/wpt/tests/css/support/color-testcommon.js b/tests/wpt/tests/css/support/color-testcommon.js index 44ca0bbb33c..18ab4420f67 100644 --- a/tests/wpt/tests/css/support/color-testcommon.js +++ b/tests/wpt/tests/css/support/color-testcommon.js @@ -79,3 +79,50 @@ function fuzzy_test_valid_color(specified, parsed, epsilon) { test_valid_value("color", specified, parsed, {comparisonFunction: set_up_fuzzy_color_test(epsilon)}); } + +/** + * Fuzzy color matcher for oklab color with optional transparency. + * @param {string} actual Observed color + * @param {string} expected What the color should be + * @param {string} message Error message to facilitate diagnostics + */ +function assert_oklab_color(actual, expected, message) { + const paramMatch = '(\\-?\\d*\\.?\\d*)'; + const optAlphaMatch = '( \\/ (\\d*\\.?\\d*))?'; + const pattern = + `oklab\\(${paramMatch} ${paramMatch} ${paramMatch}${optAlphaMatch}\\)`; + const oklabRegex = new RegExp(pattern); + let matches = + expected.match(oklabRegex); + assert_true(!!matches, + `Expected value ${expected} not recognized as an oklab color`); + + const p0 = parseFloat(matches[1]); + const p1 = parseFloat(matches[2]); + const p2 = parseFloat(matches[3]); + const alpha = + (matches[5] !== undefined) ? parseFloat(matches[5]) : undefined; + + matches = + actual.match(oklabRegex); + assert_true(!!matches, + `Actual value ${actual} not recognized as an oklab color`); + + const tolerance = 0.01; + let colorMatch = + Math.abs(parseFloat(matches[1]) - p0) <= tolerance && + Math.abs(parseFloat(matches[2]) - p1) <= tolerance && + Math.abs(parseFloat(matches[3]) - p2) <= tolerance; + if (colorMatch) { + if (alpha !== undefined) { + colorMatch = + matches[5] != undefined && + Math.abs(parseFloat(matches[5]) - alpha) <= tolerance; + } else { + colorMatch = matches[5] == undefined; + } + } + assert_true( + colorMatch, + `expected: ${expected} actual ${actual} -- ${message}`); +} diff --git a/tests/wpt/tests/docs/requirements.txt b/tests/wpt/tests/docs/requirements.txt index d8fb98888fd..7affe5ec629 100644 --- a/tests/wpt/tests/docs/requirements.txt +++ b/tests/wpt/tests/docs/requirements.txt @@ -2,5 +2,5 @@ recommonmark==0.7.1 sphinx-argparse==0.4.0 sphinx-autobuild==2021.3.14 sphinx-js==3.2.2 -sphinx==4.4.0 +sphinx==7.2.6 markupsafe==2.0.1 diff --git a/tests/wpt/tests/docs/writing-tests/testharness-api.md b/tests/wpt/tests/docs/writing-tests/testharness-api.md index 56dc4a4417a..19b96b550b2 100644 --- a/tests/wpt/tests/docs/writing-tests/testharness-api.md +++ b/tests/wpt/tests/docs/writing-tests/testharness-api.md @@ -823,6 +823,29 @@ eventWatcher.wait_for('animationstart').then(t.step_func(function() { })); ``` +### Loading test data from JSON files ### + +```eval_rst +.. js:autofunction:: fetch_json +``` + +Loading test data from a JSON file would normally be accomplished by +something like this: + +```js +promise_test(() => fetch('resources/my_data.json').then((res) => res.json()).then(runTests)); +function runTests(myData) { + /// ... +} +``` + +However, `fetch()` is not exposed inside ShadowRealm scopes, so if the +test is to be run inside a ShadowRealm, use `fetch_json()` instead: + +```js +promise_test(() => fetch_json('resources/my_data.json').then(runTests)); +``` + ### Utility Functions ### ```eval_rst diff --git a/tests/wpt/tests/docs/writing-tests/testharness.md b/tests/wpt/tests/docs/writing-tests/testharness.md index e88d5741ca6..e426e37f22b 100644 --- a/tests/wpt/tests/docs/writing-tests/testharness.md +++ b/tests/wpt/tests/docs/writing-tests/testharness.md @@ -171,11 +171,12 @@ are: [ShadowRealm](https://github.com/tc39/proposal-shadowrealm) context hosted in an ordinary Window context; to be run at x.any.shadowrealm.html -To check if your test is run from a window or worker you can use the following two methods that will +To check what scope your test is run from, you can use the following methods that will be made available by the framework: self.GLOBAL.isWindow() self.GLOBAL.isWorker() + self.GLOBAL.isShadowRealm() Although [the global `done()` function must be explicitly invoked for most dedicated worker tests and shared worker @@ -203,6 +204,9 @@ In window environments, the script will be included using a classic ` + + + + + + + + diff --git a/tests/wpt/tests/dom/observable/tentative/observable-toArray.any.js b/tests/wpt/tests/dom/observable/tentative/observable-toArray.any.js new file mode 100644 index 00000000000..9e6e3abee56 --- /dev/null +++ b/tests/wpt/tests/dom/observable/tentative/observable-toArray.any.js @@ -0,0 +1,174 @@ +// Because we test that the global error handler is called at various times. +setup({allow_uncaught_exception: true}); + +promise_test(async () => { + const observable = new Observable(subscriber => { + subscriber.next(1); + subscriber.next(2); + subscriber.next(3); + subscriber.complete(); + }); + + const array = await observable.toArray(); + assert_array_equals(array, [1, 2, 3]); +}, "toArray(): basic next/complete"); + +promise_test(async t => { + let errorReported = null; + let innerSubscriber = null; + self.addEventListener('error', e => errorReported = e, {once: true}); + + const error = new Error("custom error"); + const observable = new Observable(subscriber => { + innerSubscriber = subscriber; + subscriber.error(error); + }); + + try { + const array = await observable.toArray(); + assert_unreached("toArray() promise must not resolve"); + } catch (e) { + assert_equals(e, error); + assert_equals(errorReported, null); + + // Calls to `error()` after the subscription is closed still report the + // exception. + innerSubscriber.error(error); + assert_not_equals(errorReported, null, "Exception was reported to global"); + assert_true(errorReported.message.includes("custom error"), "Error message matches"); + assert_greater_than(errorReported.lineno, 0, "Error lineno is greater than 0"); + assert_greater_than(errorReported.colno, 0, "Error lineno is greater than 0"); + assert_equals(errorReported.error, error, "Error object is equivalent"); + } +}, "toArray(): first error() rejects promise; subsequent error()s report the exceptions"); + +promise_test(async t => { + let errorReported = null; + let innerSubscriber = null; + self.addEventListener('error', e => errorReported = e, {once: true}); + + const error = new Error("custom error"); + const observable = new Observable(subscriber => { + innerSubscriber = subscriber; + subscriber.complete(); + }); + + const array = await observable.toArray(); + assert_array_equals(array, []); + assert_equals(errorReported, null); + + // Calls to `error()` after the subscription is closed still report the + // exception. + innerSubscriber.error(error); + assert_not_equals(errorReported, null, "Exception was reported to global"); + assert_true(errorReported.message.includes("custom error"), "Error message matches"); + assert_greater_than(errorReported.lineno, 0, "Error lineno is greater than 0"); + assert_greater_than(errorReported.colno, 0, "Error lineno is greater than 0"); + assert_equals(errorReported.error, error, "Error object is equivalent"); +}, "toArray(): complete() resolves promise; subsequent error()s report the exceptions"); + +promise_test(async () => { + // This tracks whether `postSubscriptionPromise` has had its then handler run. + // This helps us keep track of the timing/ordering of everything. Calling a + // Promise-returning operator with an aborted signal must *immediately* reject + // the returned Promise, which means code "awaiting" it should run before any + // subsequent Promise resolution/rejection handlers are run. + let postSubscriptionPromiseResolved = false; + let subscriptionImmediatelyInactive = false; + + const observable = new Observable(subscriber => { + const inactive = !subscriber.active; + subscriptionImmediatelyInactive = inactive; + }); + + const rejectedPromise = observable.toArray({signal: AbortSignal.abort()}) + .then(() => { + assert_unreached("Operator promise must not resolve its abort signal is " + + "rejected"); + }, () => { + // See the documentation above. The rejection handler (i.e., this code) for + // immediately-aborted operator Promises runs before any later-scheduled + // Promise resolution/rejections. + assert_false(postSubscriptionPromiseResolved, + "Operator promise rejects before later promise"); + }); + const postSubscriptionPromise = + Promise.resolve().then(() => postSubscriptionPromiseResolved = true); + + await rejectedPromise; +}, "toArray(): Subscribing with an aborted signal returns an immediately " + + "rejected promise"); + +promise_test(async () => { + let postSubscriptionPromiseResolved = false; + + const observable = new Observable(subscriber => {}); + const controller = new AbortController(); + const arrayPromise = observable.toArray({signal: controller.signal}) + .then(() => { + assert_unreached("Operator promise must not resolve if its abort signal " + + "is rejected"); + }, () => { + assert_false(postSubscriptionPromiseResolved, + "controller.abort() synchronously rejects the operator " + + "Promise"); + }); + + // This must synchronously reject `arrayPromise`, scheduling in the next + // microtask. + controller.abort(); + Promise.resolve().then(value => postSubscriptionPromiseResolved = true); + + await arrayPromise; +}, "toArray(): Aborting the passed-in signal rejects the returned promise"); + +// See https://github.com/WICG/observable/issues/96 for discussion about this. +promise_test(async () => { + const results = []; + + const observable = new Observable(subscriber => { + results.push(`Subscribed. active: ${subscriber.active}`); + + subscriber.signal.addEventListener('abort', e => { + results.push("Inner signal abort event"); + Promise.resolve("Inner signal Promise").then(value => results.push(value)); + }); + + subscriber.addTeardown(() => { + results.push("Teardown"); + Promise.resolve("Teardown Promise").then(value => results.push(value)); + }); + }); + + const controller = new AbortController(); + controller.signal.addEventListener('abort', e => { + results.push("Outer signal abort event"); + Promise.resolve("Outer signal Promise").then(value => results.push(value)); + }); + + // Subscribe. + observable.toArray({signal: controller.signal}); + controller.abort(); + + assert_array_equals(results, [ + "Subscribed. active: true", + "Outer signal abort event", + "Teardown", + "Inner signal abort event", + ], "Events and teardowns are fired in the right ordered"); + + // Everything microtask above should be queued up by now, so queue one more + // final microtask that will run after all of the others, wait for it, and the + // check `results` is right. + await Promise.resolve(); + assert_array_equals(results, [ + "Subscribed. active: true", + "Outer signal abort event", + "Teardown", + "Inner signal abort event", + "Outer signal Promise", + "Teardown Promise", + "Inner signal Promise", + ], "Promises resolve in the right order"); +}, "Operator Promise abort ordering"); + diff --git a/tests/wpt/tests/editing/crashtests/delete-in-block-in-progress.html b/tests/wpt/tests/editing/crashtests/delete-in-block-in-progress.html new file mode 100644 index 00000000000..233b834ab03 --- /dev/null +++ b/tests/wpt/tests/editing/crashtests/delete-in-block-in-progress.html @@ -0,0 +1,25 @@ + + + + + + + + + +
+
  • + +a + +
  • +
    + + diff --git a/tests/wpt/tests/editing/crashtests/designMode-on-of-lazy-loading-iframe.html b/tests/wpt/tests/editing/crashtests/designMode-on-of-lazy-loading-iframe.html new file mode 100644 index 00000000000..90a6c85c45c --- /dev/null +++ b/tests/wpt/tests/editing/crashtests/designMode-on-of-lazy-loading-iframe.html @@ -0,0 +1,20 @@ + + + + + + + + +") + + # Navigate to a page with a frame. + await bidi_session.browsing_context.navigate( + context=top_context["context"], + url=root_page_url, + wait="complete", + ) + + all_contexts = await bidi_session.browsing_context.get_tree(root=top_context["context"]) + frame_context_id = all_contexts[0]["children"][0]["context"] + + partition = BrowsingContextPartitionDescriptor(frame_context_id) + + set_cookie_result = await bidi_session.storage.set_cookie( + cookie=create_cookie(domain=domain_value()), + partition=partition) + + assert set_cookie_result == { + 'partitionKey': { + 'sourceOrigin': frame_source_origin + }, + } + + await assert_cookie_is_set(bidi_session, domain=domain_value(), partition=partition) + + +async def test_partition_storage_key_source_origin(bidi_session, test_page, origin, domain_value): + source_origin = origin() + partition = StorageKeyPartitionDescriptor(source_origin=source_origin) + + set_cookie_result = await bidi_session.storage.set_cookie( + cookie=create_cookie(domain=domain_value()), + partition=partition) + + assert set_cookie_result == { + 'partitionKey': { + 'sourceOrigin': source_origin + }, + } + + await assert_cookie_is_set(bidi_session, domain=domain_value(), partition=partition) + +# TODO: test `test_partition_storage_key_user_context`. diff --git a/tests/wpt/tests/webdriver/tests/bidi/storage/set_cookie/set_cookie.py b/tests/wpt/tests/webdriver/tests/bidi/storage/set_cookie/set_cookie.py deleted file mode 100644 index 7e4f3dbb9b0..00000000000 --- a/tests/wpt/tests/webdriver/tests/bidi/storage/set_cookie/set_cookie.py +++ /dev/null @@ -1,60 +0,0 @@ -import pytest -from webdriver.bidi.modules.network import NetworkStringValue -from webdriver.bidi.modules.storage import PartialCookie, BrowsingContextPartitionDescriptor - -pytestmark = pytest.mark.asyncio - - -@pytest.mark.parametrize( - "protocol", - [ - "http", - "https", - ], -) -async def test_set_cookie_protocol(bidi_session, top_context, inline, origin, domain_value, protocol): - # Navigate to a page with a required protocol. - await bidi_session.browsing_context.navigate( - context=top_context["context"], url=(inline("
    foo
    ", protocol=protocol)), wait="complete" - ) - - source_origin = origin(protocol) - partition = BrowsingContextPartitionDescriptor(top_context["context"]) - - set_cookie_result = await bidi_session.storage.set_cookie( - cookie=PartialCookie( - name='foo', - value=NetworkStringValue('bar'), - domain=domain_value(), - secure=True - ), - partition=partition) - - assert set_cookie_result == { - 'partitionKey': { - 'sourceOrigin': source_origin - }, - } - - # Assert the cookie is actually set. - actual_cookies = await bidi_session.storage.get_cookies(partition=partition) - assert actual_cookies == { - 'cookies': [ - { - 'domain': domain_value(), - 'httpOnly': False, - 'name': 'foo', - 'path': '/', - 'sameSite': 'none', - 'secure': True, - 'size': 6, - 'value': { - 'type': 'string', - 'value': 'bar', - }, - }, - ], - 'partitionKey': { - 'sourceOrigin': source_origin, - }, - } diff --git a/tests/wpt/tests/webidl/ecmascript-binding/global-mutable-prototype.any.js b/tests/wpt/tests/webidl/ecmascript-binding/global-mutable-prototype.any.js new file mode 100644 index 00000000000..eba96e9adf4 --- /dev/null +++ b/tests/wpt/tests/webidl/ecmascript-binding/global-mutable-prototype.any.js @@ -0,0 +1,27 @@ +// META: global=shadowrealm +// META: title=Mutability of the global prototype chain + +const objects = []; +setup(() => { + for (let object = self; object; object = Object.getPrototypeOf(object)) { + objects.push(object); + } +}); + +test(() => { + for (const object of objects) { + const proto = Object.getPrototypeOf(object); + const plainObject = {}; + Object.setPrototypeOf(object, plainObject); + assert_equals(Object.getPrototypeOf(object), plainObject); + Object.setPrototypeOf(object, proto); + } +}, "Setting to a different prototype"); + +test(() => { + for (const object of objects) { + const expected = Object.getPrototypeOf(object); + Object.setPrototypeOf(object, expected); + assert_equals(Object.getPrototypeOf(object), expected); + } +}, "Setting to the same prototype"); diff --git a/tests/wpt/tests/webnn/squeeze.https.any.js b/tests/wpt/tests/webnn/gather.https.any.js similarity index 60% rename from tests/wpt/tests/webnn/squeeze.https.any.js rename to tests/wpt/tests/webnn/gather.https.any.js index 8b9310d65d4..52bcece8043 100644 --- a/tests/wpt/tests/webnn/squeeze.https.any.js +++ b/tests/wpt/tests/webnn/gather.https.any.js @@ -1,10 +1,10 @@ -// META: title=test WebNN API squeeze operation +// META: title=test WebNN API gather operation // META: global=window,dedicatedworker // META: script=./resources/utils.js // META: timeout=long 'use strict'; -// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-squeeze +// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-gather -testWebNNOperation('squeeze', buildOperationWithSingleInput); \ No newline at end of file +testWebNNOperation('gather', buildOperationWithTwoInputs); \ No newline at end of file diff --git a/tests/wpt/tests/webnn/gpu/squeeze.https.any.js b/tests/wpt/tests/webnn/gpu/gather.https.any.js similarity index 58% rename from tests/wpt/tests/webnn/gpu/squeeze.https.any.js rename to tests/wpt/tests/webnn/gpu/gather.https.any.js index 29ce3e4f91b..7c8a685c5cb 100644 --- a/tests/wpt/tests/webnn/gpu/squeeze.https.any.js +++ b/tests/wpt/tests/webnn/gpu/gather.https.any.js @@ -1,10 +1,10 @@ -// META: title=test WebNN API squeeze operation +// META: title=test WebNN API gather operation // META: global=window,dedicatedworker // META: script=../resources/utils.js // META: timeout=long 'use strict'; -// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-squeeze +// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-gather -testWebNNOperation('squeeze', buildOperationWithSingleInput, 'gpu'); \ No newline at end of file +testWebNNOperation('gather', buildOperationWithTwoInputs, 'gpu'); \ No newline at end of file diff --git a/tests/wpt/tests/webnn/gpu/layer_normalization.https.any.js b/tests/wpt/tests/webnn/gpu/layer_normalization.https.any.js new file mode 100644 index 00000000000..1deb43bee5d --- /dev/null +++ b/tests/wpt/tests/webnn/gpu/layer_normalization.https.any.js @@ -0,0 +1,10 @@ +// META: title=test WebNN API layerNormalization operation +// META: global=window,dedicatedworker +// META: script=../resources/utils.js +// META: timeout=long + +'use strict'; + +// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-layernorm + +testWebNNOperation('layerNormalization', buildLayerNorm, 'gpu'); \ No newline at end of file diff --git a/tests/wpt/tests/webnn/layer_normalization.https.any.js b/tests/wpt/tests/webnn/layer_normalization.https.any.js new file mode 100644 index 00000000000..380db4ea528 --- /dev/null +++ b/tests/wpt/tests/webnn/layer_normalization.https.any.js @@ -0,0 +1,10 @@ +// META: title=test WebNN API layerNormalization operation +// META: global=window,dedicatedworker +// META: script=./resources/utils.js +// META: timeout=long + +'use strict'; + +// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-layernorm + +testWebNNOperation('layerNormalization', buildLayerNorm); \ No newline at end of file diff --git a/tests/wpt/tests/webnn/resources/test_data/abs.json b/tests/wpt/tests/webnn/resources/test_data/abs.json index c59054c3e50..d665da6bb45 100644 --- a/tests/wpt/tests/webnn/resources/test_data/abs.json +++ b/tests/wpt/tests/webnn/resources/test_data/abs.json @@ -1,5 +1,72 @@ { "tests": [ + { + "name": "abs float32 1D constant tensor", + "inputs": { + "x": { + "shape": [24], + "data": [ + 49.8372426667043, + 82.0929095991747, + 3.1989055476550305, + 85.20904780506325, + 88.94609443980977, + -91.0352208007506, + 31.448491185882546, + -29.311109216503752, + -92.44773429213686, + -15.520709757433963, + 80.91279287806162, + -38.209706112466705, + 53.064761629102065, + 99.6537077669756, + -21.28504881273652, + 90.019831849408, + 18.324518254754622, + -33.06915295290382, + 30.097660827399608, + -74.21503493794903, + 95.60974816793694, + 6.61428748549389, + 31.283208179548808, + -53.20605974670913 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + 49.837242126464844, + 82.09291076660156, + 3.1989054679870605, + 85.20904541015625, + 88.94609069824219, + 91.03521728515625, + 31.4484920501709, + 29.31110954284668, + 92.4477310180664, + 15.520709991455078, + 80.91279602050781, + 38.2097053527832, + 53.064762115478516, + 99.6537094116211, + 21.285049438476562, + 90.01982879638672, + 18.32451820373535, + 33.06915283203125, + 30.097660064697266, + 74.21503448486328, + 95.60974884033203, + 6.614287376403809, + 31.2832088470459, + 53.206058502197266 + ], + "type": "float32" + } + }, { "name": "abs float32 1D tensor", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/add.json b/tests/wpt/tests/webnn/resources/test_data/add.json index 0a12871ceba..dba361228bd 100644 --- a/tests/wpt/tests/webnn/resources/test_data/add.json +++ b/tests/wpt/tests/webnn/resources/test_data/add.json @@ -1,5 +1,103 @@ { "tests": [ + { + "name": "add float32 1D constant tensors", + "inputs": { + "a": { + "shape": [24], + "data": [ + -43.33331702607182, + -67.89795492110251, + 26.462739729601154, + 36.74276245870831, + -65.1773897660934, + -87.70664817075895, + 65.2788147914111, + -74.05226258410215, + -13.82780997496917, + 6.9814867885681196, + 99.8375201051771, + 55.80233785150233, + -75.57196245651672, + 11.499508337009786, + 17.110109711325364, + 95.81167418402984, + 57.447496690075326, + -57.17587415294769, + 27.71905326607728, + -18.21920899392113, + 52.65309891626177, + -69.9945556346263, + 39.82165678962866, + -29.986529326327684 + ], + "type": "float32", + "constant": true + }, + "b": { + "shape": [24], + "data": [ + -59.74972612329861, + -44.814940102501396, + -87.93879800134108, + 1.884336371742009, + 84.89464239219592, + 47.55365421202336, + 85.64292769131902, + 43.02861451385175, + -60.25821191056049, + 15.606167000302435, + 70.60614780317951, + -7.454866177806224, + -30.206895875534997, + -97.69825508598404, + -0.009843301412843175, + -77.6796011606304, + 30.19668513874859, + -59.19006932092632, + 89.35886332586315, + 28.679809244991418, + -29.72130634585804, + -90.63522901925083, + 28.281854673339666, + 27.66254066077893 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + -103.08303833007812, + -112.71289825439453, + -61.47605895996094, + 38.627098083496094, + 19.717254638671875, + -40.15299606323242, + 150.9217529296875, + -31.02364730834961, + -74.08602142333984, + 22.58765411376953, + 170.44366455078125, + 48.34747314453125, + -105.77885437011719, + -86.19874572753906, + 17.100265502929688, + 18.13207244873047, + 87.64418029785156, + -116.3659439086914, + 117.07791900634766, + 10.460599899291992, + 22.931793212890625, + -160.62979125976562, + 68.10350799560547, + -2.3239879608154297 + ], + "type": "float32" + } + }, { "name": "add float32 1D tensors", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/arg_max.json b/tests/wpt/tests/webnn/resources/test_data/arg_max.json index 9af47a95894..d2fe9e62caf 100644 --- a/tests/wpt/tests/webnn/resources/test_data/arg_max.json +++ b/tests/wpt/tests/webnn/resources/test_data/arg_max.json @@ -1,5 +1,49 @@ { "tests": [ + { + "name": "argMax float32 1D constant tensor default options", + "inputs": { + "input": { + "shape": [24], + "data": [ + -51.0936194154457, + -6.5397018645619625, + 73.81338015899149, + 88.46114630531724, + -5.294266751122791, + -79.20668057325759, + -41.70176598864654, + 73.81338015899149, + 88.46114630531724, + -84.939998758247, + -61.488942502520906, + -98.33874402761955, + -51.0936194154457, + -6.5397018645619625, + 73.81338015899149, + 88.46114630531724, + -5.294266751122791, + -79.20668057325759, + -41.70176598864654, + 73.81338015899149, + 88.46114630531724, + -84.939998758247, + -61.488942502520906, + -98.33874402761955 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [], + "data": [ + 3 + ], + "type": "int64" + } + }, { "name": "argMax float32 1D tensor default options", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/arg_min.json b/tests/wpt/tests/webnn/resources/test_data/arg_min.json index dc0b5cdfd1a..132a2dc3e8b 100644 --- a/tests/wpt/tests/webnn/resources/test_data/arg_min.json +++ b/tests/wpt/tests/webnn/resources/test_data/arg_min.json @@ -1,5 +1,49 @@ { "tests": [ + { + "name": "argMin float32 1D constant tensor default options", + "inputs": { + "input": { + "shape": [24], + "data": [ + 3.830124090690262, + -24.986487937638074, + 5.299982630691289, + -48.5486590218902, + 40.30886781808215, + 60.184293919409726, + -82.78385618759043, + -96.50904103637833, + 71.87028201591897, + 38.866394268784035, + -39.143725517854435, + 31.444366685561903, + -82.78385618759043, + -96.50904103637833, + -25.53388886326502, + -16.142265850469343, + 66.63677406472371, + 82.5119815304117, + -82.78385618759043, + -96.50904103637833, + 39.7687246127592, + 42.15040238450999, + 82.66863662444459, + 85.4526923278379 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [], + "data": [ + 7 + ], + "type": "int64" + } + }, { "name": "argMin float32 1D tensor default options", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/average_pool2d.json b/tests/wpt/tests/webnn/resources/test_data/average_pool2d.json index 802e0d76462..5a9f4e28b10 100644 --- a/tests/wpt/tests/webnn/resources/test_data/average_pool2d.json +++ b/tests/wpt/tests/webnn/resources/test_data/average_pool2d.json @@ -1,5 +1,76 @@ { "tests": [ + { + "name": "averagePool2d float32 4D constant tensor all positive default options", + "inputs": { + "input": { + "shape": [1, 2, 5, 5], + "data": [ + 22.975555502750634, + 78.15438048012338, + 9.68611138116071, + 51.29803808129347, + 32.19308601456918, + 87.65037289600019, + 87.25082191311348, + 39.49793996935087, + 80.09963591169489, + 10.220142557736978, + 52.60270021646585, + 1.4128639882603933, + 11.954064466077474, + 85.0007506374375, + 64.7837446465813, + 88.03128735720126, + 11.333851214909307, + 70.61659435728073, + 84.90442561999888, + 79.06688041781518, + 7.328724951604215, + 35.97796581186121, + 10.17730631094398, + 1.4140757517112412, + 78.10038172113374, + 91.59549689157087, + 65.64701225681809, + 55.14215004436653, + 18.432438840756184, + 49.34624267439973, + 15.648024969290454, + 68.02723372727797, + 20.342549040418124, + 26.72794900604616, + 64.87446829774323, + 46.56714896227794, + 79.57832937136276, + 4.338463748959498, + 38.18383968382213, + 45.253981324455175, + 80.9717996657439, + 67.58124910163149, + 6.026499585657263, + 29.77881349289366, + 58.58993337807239, + 2.2384984647495054, + 14.505490166700486, + 68.72449589246624, + 76.45657404642184, + 23.53263275794233 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [1, 2, 1, 1], + "data": [ + 47.26926803588867, + 44.72445297241211 + ], + "type": "float32" + } + }, { "name": "averagePool2d float32 4D tensor all positive default options", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/batch_normalization.json b/tests/wpt/tests/webnn/resources/test_data/batch_normalization.json index 19f414bbfea..04ab0d0d6f1 100644 --- a/tests/wpt/tests/webnn/resources/test_data/batch_normalization.json +++ b/tests/wpt/tests/webnn/resources/test_data/batch_normalization.json @@ -89,6 +89,98 @@ "type": "float32" } }, + { + "name": "batchNormalization float32 2D constant tensor default options", + "inputs": { + "input": { + "shape": [4, 6], + "data": [ + -41.30732967168238, + 64.08864045143429, + -63.376671841233104, + -46.7903680211994, + 83.0222726565018, + -80.08049213079853, + -62.144380499565784, + -0.10012771650340824, + -40.902161220312074, + 56.963061967558474, + 37.37249789808206, + 57.04647733193906, + 82.05679802728304, + -86.11642850667623, + 76.88317547014259, + 97.03362133579051, + -21.35103988063949, + -96.93823797160586, + -9.359310262561493, + 80.2082435478892, + -85.36802529512583, + 62.35185227095363, + -68.4724340974042, + -12.107167478351585 + ], + "type": "float32", + "constant": true + }, + "mean": { + "shape": [6], + "data": [ + -7.814267643537363, + -95.6412954353084, + 38.154405424391285, + -55.9520351570133, + -87.8650062484926, + -41.636455304505525 + ], + "type": "float32", + "constant": true + }, + "variance": { + "shape": [6], + "data": [ + 60.311864286118144, + 26.432604504927436, + 53.275636661772396, + 40.146120500534074, + 59.41098289103077, + 35.99981828466932 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "shape": [4, 6], + "data": [ + -4.312741756439209, + 31.068212509155273, + -13.910240173339844, + 1.4459478855133057, + 22.170541763305664, + -6.407354354858398, + -6.995829105377197, + 18.583200454711914, + -10.831125259399414, + 17.820920944213867, + 16.2480411529541, + 16.447195053100586, + 11.57226848602295, + 1.8526301383972168, + 5.306026458740234, + 24.145092010498047, + 8.629376411437988, + -9.216986656188965, + -0.1989477425813675, + 34.203548431396484, + -16.923160552978516, + 18.671411514282227, + 2.5159497261047363, + 4.921559810638428 + ], + "type": "float32" + } + }, { "name": "batchNormalization float32 2D tensor default options", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/ceil.json b/tests/wpt/tests/webnn/resources/test_data/ceil.json index 6fa623977fc..b9bccbc3a07 100644 --- a/tests/wpt/tests/webnn/resources/test_data/ceil.json +++ b/tests/wpt/tests/webnn/resources/test_data/ceil.json @@ -1,5 +1,72 @@ { "tests": [ + { + "name": "ceil float32 1D constant tensor", + "inputs": { + "x": { + "shape": [24], + "data": [ + 67.38941577648342, + 36.78218646695805, + 99.10649131558534, + -22.587103876323283, + 32.70173557917525, + 17.688807510873474, + 5.631034848468943, + 12.965238190762022, + 83.1319330049133, + -29.29246123472926, + 19.844631250887133, + 65.27903232818329, + 26.311109519759952, + 24.2856723456172, + -48.3976724829041, + -5.617412380605998, + 61.53380759105448, + -87.81197726868459, + 69.71428621372127, + 5.0031021954943355, + 84.3683411023199, + -9.390542062321572, + -27.85661776414834, + -34.89593295662057 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + 68, + 37, + 100, + -22, + 33, + 18, + 6, + 13, + 84, + -29, + 20, + 66, + 27, + 25, + -48, + -5, + 62, + -87, + 70, + 6, + 85, + -9, + -27, + -34 + ], + "type": "float32" + } + }, { "name": "ceil float32 1D tensor", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/clamp.json b/tests/wpt/tests/webnn/resources/test_data/clamp.json index 93ab5ca0c1c..0e948f99319 100644 --- a/tests/wpt/tests/webnn/resources/test_data/clamp.json +++ b/tests/wpt/tests/webnn/resources/test_data/clamp.json @@ -1,6 +1,73 @@ { "tests": [ // default options + { + "name": "clamp float32 1D constant tensor default options", + "inputs": { + "x": { // use 'x' for input operand name + "shape": [24], + "data": [ + -9.817828475355284, + -6.024063916325786, + -4.072562498632983, + -6.575078191902692, + -7.7556836912181915, + 9.524681107378463, + 3.7292487446449307, + 6.4816868736447475, + -1.5374205904252634, + -7.343102426698445, + 7.880751290929794, + -2.056408790509967, + 6.34386375786449, + 5.52573787183, + 0.8433118207347725, + -8.19996033345526, + -7.786487326213716, + 9.280223823954241, + -2.31305948485121, + 9.549695091037119, + 5.788925460130297, + 5.549378312916486, + 7.409400528051194, + -2.1236145770503745 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + -9.817828178405762, + -6.024064064025879, + -4.0725626945495605, + -6.575078010559082, + -7.755683898925781, + 9.524681091308594, + 3.7292487621307373, + 6.481687068939209, + -1.537420630455017, + -7.34310245513916, + 7.880751132965088, + -2.0564088821411133, + 6.3438639640808105, + 5.525737762451172, + 0.8433118462562561, + -8.199960708618164, + -7.786487102508545, + 9.280223846435547, + -2.3130595684051514, + 9.549695014953613, + 5.788925647735596, + 5.549378395080566, + 7.409400463104248, + -2.123614549636841 + ], + "type": "float32" + } + }, { "name": "clamp float32 1D tensor default options", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/concat.json b/tests/wpt/tests/webnn/resources/test_data/concat.json index 4230744e86f..5e2285b75a0 100644 --- a/tests/wpt/tests/webnn/resources/test_data/concat.json +++ b/tests/wpt/tests/webnn/resources/test_data/concat.json @@ -1,6 +1,83 @@ { "tests": [ // concat 1D tensors + { + "name": "concat two float32 1D constant tensors of same shape along axis 0", + "inputs": [ + { + "name": "input1", + "shape": [12], + "data": [ + -0.39444134019222243, + 0.8619825316530809, + 0.3379962524218807, + -0.9906398615400507, + 0.576785657225761, + 0.3227640108329237, + -0.44735022799701873, + 0.11028251232581932, + -0.5945112749179908, + -0.40284849555754754, + -0.9531654171044694, + -0.6731740531810844 + ], + "type": "float32", + "constant": true + }, + { + "name": "input2", + "shape": [12], + "data": [ + 0.4918989118791477, + -0.15864110312378976, + -0.34188115459083157, + -0.9158143500894873, + -0.7206121708970712, + -0.7993468785008635, + 0.6653799854931952, + 0.03886038855553897, + 0.5182055416768865, + -0.8742016938344297, + -0.479021891130635, + 0.1211843166661235 + ], + "type": "float32", + "constant": true + } + ], + "axis": 0, + "expected": { + "name": "output", + "shape": [24], + "data": [ + -0.3944413363933563, + 0.861982524394989, + 0.337996244430542, + -0.990639865398407, + 0.576785683631897, + 0.32276400923728943, + -0.44735023379325867, + 0.11028251051902771, + -0.5945112705230713, + -0.402848482131958, + -0.9531654119491577, + -0.6731740236282349, + 0.49189892411231995, + -0.15864109992980957, + -0.3418811559677124, + -0.9158143401145935, + -0.7206121683120728, + -0.7993468642234802, + 0.6653800010681152, + 0.03886038810014725, + 0.5182055234909058, + -0.8742017149925232, + -0.4790218770503998, + 0.1211843192577362 + ], + "type": "float32" + } + }, { "name": "concat two float32 1D tensors of same shape along axis 0", "inputs": [ diff --git a/tests/wpt/tests/webnn/resources/test_data/conv2d.json b/tests/wpt/tests/webnn/resources/test_data/conv2d.json index 850897df4e1..5f8cd814a90 100644 --- a/tests/wpt/tests/webnn/resources/test_data/conv2d.json +++ b/tests/wpt/tests/webnn/resources/test_data/conv2d.json @@ -67,6 +67,75 @@ "type": "float32" } }, + { + "name": "conv2d float32 4D both input and filter constant tensors default options", + "inputs": { + "input": { + "shape": [1, 1, 5, 5], + "data": [ + 0.6124474607869732, + 0.8857858599952035, + 0.13667134799354397, + 0.564529098909835, + 0.8965171985225997, + 0.36792828664768873, + 0.6811466319147079, + 0.04795110047019757, + 0.33355462154327986, + 0.19882695924603588, + 0.4116714070095846, + 0.07934240242135737, + 0.42724633975875426, + 0.5358005687699703, + 0.5910805999797129, + 0.2841543363273238, + 0.414725865128835, + 0.026906268886554896, + 0.3621256577250671, + 0.9945681862504354, + 0.07184549434969778, + 0.1220437231354885, + 0.8422137325421886, + 0.4537501021068471, + 0.2152944303497728 + ], + "type": "float32", + "constant": true + }, + "filter": { + "shape": [1, 1, 3, 3], + "data": [ + 0.3804761331189006, + 0.5280312082437455, + 0.2194703660873738, + 0.3668976886827289, + 0.33974137307686836, + 0.42000596251782674, + 0.38050310131155185, + 0.19443586243810795, + 0.5686976617292392 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [1, 1, 3, 3], + "data": [ + 1.5323282480239868, + 1.3573521375656128, + 1.3641656637191772, + 1.071682333946228, + 1.1259644031524658, + 1.4713115692138672, + 1.078782320022583, + 1.155018925666809, + 1.656954288482666 + ], + "type": "float32" + } + }, { "name": "conv2d float32 4D input and filter tensors default options", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/conv_transpose2d.json b/tests/wpt/tests/webnn/resources/test_data/conv_transpose2d.json index 980cc9f6629..42274e6fa37 100644 --- a/tests/wpt/tests/webnn/resources/test_data/conv_transpose2d.json +++ b/tests/wpt/tests/webnn/resources/test_data/conv_transpose2d.json @@ -40,6 +40,48 @@ "type": "float32" } }, + { + "name": "convTranspose2d float32 4D both input and filter constant tensors default options", + "inputs": { + "input": { + "shape": [1, 1, 2, 2], + "data": [ + 0.5872158177067033, + 0.6077792328258038, + 0.01728916618181975, + 0.26146076483771563 + ], + "type": "float32", + "constant": true + }, + "filter": { + "shape": [1, 1, 2, 2], + "data": [ + 0.32927132527587477, + 0.5866857173772775, + 0.29701370673751004, + 0.0033378428248385106 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "shape": [1, 1, 3, 3], + "data": [ + 0.1933533400297165, + 0.5446354150772095, + 0.3565753698348999, + 0.18010397255420685, + 0.2787136137485504, + 0.15542395412921906, + 0.0051351189613342285, + 0.07771513611078262, + 0.0008727149106562138 + ], + "type": "float32" + } + }, { "name": "convTranspose2d float32 4D input and filter tensors default options", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/cos.json b/tests/wpt/tests/webnn/resources/test_data/cos.json index 4d992325509..db7ade11e38 100644 --- a/tests/wpt/tests/webnn/resources/test_data/cos.json +++ b/tests/wpt/tests/webnn/resources/test_data/cos.json @@ -1,5 +1,72 @@ { "tests": [ + { + "name": "cos float32 1D constant tensor", + "inputs": { + "x": { + "shape": [24], + "data": [ + 85.56368722678593, + -45.09983640817779, + -94.6775036804249, + 83.49029219662862, + -31.367904335227692, + 70.1804254973957, + -90.36229826898601, + -83.00758001757269, + 61.51649571682452, + -32.51877900985289, + -48.376587517032775, + -58.02735967650854, + 89.79197789644661, + -84.53326629430444, + -58.23252607768894, + -76.14168597373077, + -59.05887786348942, + 77.38546821194151, + -98.67289449592316, + -63.611559926077675, + 26.857246203003186, + 83.70417131490925, + 76.56606838780263, + -47.83436545380422 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + -0.7380040884017944, + 0.43789437413215637, + 0.9090799689292908, + -0.23584702610969543, + 0.9988471865653992, + 0.48416373133659363, + -0.7358400821685791, + 0.24218930304050446, + 0.25266921520233154, + 0.4510514736175537, + -0.31276169419288635, + 0.09197491407394409, + -0.2537800967693329, + -0.9583188891410828, + -0.11282006651163101, + 0.736129879951477, + -0.80721116065979, + -0.4045141637325287, + -0.283336341381073, + 0.7111190557479858, + -0.1531042903661728, + -0.43673399090766907, + 0.39213326573371887, + -0.7580515146255493 + ], + "type": "float32" + } + }, { "name": "cos float32 1D tensor", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/div.json b/tests/wpt/tests/webnn/resources/test_data/div.json index d72544e8ec4..a60341181d1 100644 --- a/tests/wpt/tests/webnn/resources/test_data/div.json +++ b/tests/wpt/tests/webnn/resources/test_data/div.json @@ -1,5 +1,103 @@ { "tests": [ + { + "name": "div float32 1D constant tensors", + "inputs": { + "a": { + "shape": [24], + "data": [ + 60.42374184854583, + -86.92247771592565, + -19.496113538677307, + -15.150616021872224, + 13.455190756956796, + 45.4335994568701, + 61.08286131089616, + 70.71882919883615, + -31.27858011424047, + 56.083543107783214, + 38.99276571709217, + -3.275369300234928, + 32.289323532099786, + -3.676541725498467, + 88.4349140505588, + 14.369060854798647, + 13.94319409117783, + 16.861190475721344, + 4.816806540352701, + 44.15916607007162, + -13.083211898368276, + 44.565997906464105, + -34.892785072690245, + -74.09375203216162 + ], + "type": "float32", + "constant": true + }, + "b": { + "shape": [24], + "data": [ + -95.02903333542001, + 62.804865007594174, + -85.32865597192423, + -68.20919717822437, + 79.45568261298038, + -68.69049322917093, + -94.46466465496823, + -10.000411029009541, + 18.318865013229242, + -3.623280011603569, + -5.957828048196006, + 89.49882849628409, + 94.95791079054848, + -79.00059056550418, + -79.87597038424425, + 74.997874802068, + 25.86537368134097, + 91.54433121797925, + 81.65287344691947, + 48.214831959279195, + 63.37012091471408, + 10.62638472655793, + 46.12662564540156, + 77.2232730204774 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + -0.6358450651168823, + -1.3840086460113525, + 0.22848258912563324, + 0.22211983799934387, + 0.16934208571910858, + -0.6614248752593994, + -0.6466212868690491, + -7.071591854095459, + -1.7074518203735352, + -15.478666305541992, + -6.544795513153076, + -0.036596786230802536, + 0.3400382697582245, + 0.046538159251213074, + -1.1071529388427734, + 0.19159291684627533, + 0.5390679836273193, + 0.18418607115745544, + 0.058991268277168274, + 0.9158834218978882, + -0.20645710825920105, + 4.193900108337402, + -0.7564564943313599, + -0.9594743251800537 + ], + "type": "float32" + } + }, { "name": "div float32 1D tensors", "inputs": { @@ -65,7 +163,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [24], "data": [ -0.6358450651168823, @@ -161,7 +259,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [4, 6], "data": [ -0.6358450651168823, @@ -257,7 +355,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 3, 4], "data": [ -0.6358450651168823, @@ -353,7 +451,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 2, 2, 3], "data": [ -0.6358450651168823, @@ -449,7 +547,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 2, 1, 2, 3], "data": [ -0.6358450651168823, @@ -522,7 +620,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 2, 2, 3], "data": [ -0.6922348141670227, @@ -600,7 +698,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 2, 2, 3], "data": [ 0.6208509802818298, @@ -676,7 +774,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 2, 2, 3], "data": [ 0.8047597408294678, @@ -749,7 +847,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 2, 2, 3], "data": [ -0.6922348141670227, diff --git a/tests/wpt/tests/webnn/resources/test_data/elu.json b/tests/wpt/tests/webnn/resources/test_data/elu.json index 68c0c80c59b..b1c443282e4 100644 --- a/tests/wpt/tests/webnn/resources/test_data/elu.json +++ b/tests/wpt/tests/webnn/resources/test_data/elu.json @@ -1,5 +1,72 @@ { // elu: The calculation follows the expression max(0, x) + alpha * (exp(min(0, x)) - 1). "tests": [ + { + "name": "elu float32 1D constant tensor default options", // default options: {alpha: 1} + "inputs": { + "x": { + "shape": [24], + "data": [ + 4.721739616402454, + 0.37687805459885837, + 1.4189998297338988, + -3.866366516102673, + 1.3590080831697868, + -3.8641844556612392, + 7.839725573639406, + -6.690801377003339, + 0.545640671378024, + 5.776711453839759, + 7.263273186498619, + -7.419948093040434, + 5.665064356187175, + -6.712906923265587, + -3.3348948531721945, + -1.2103675328053143, + 7.255546982014842, + 8.903468527480992, + -4.019860311974934, + 7.114678383091487, + -0.11212847159184136, + -3.688840965850466, + 6.135151096361078, + -9.895182558358613 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + 4.721739768981934, + 0.3768780529499054, + 1.4189997911453247, + -0.9790657162666321, + 1.3590080738067627, + -0.9790199995040894, + 7.839725494384766, + -0.9987577199935913, + 0.5456406474113464, + 5.776711463928223, + 7.263273239135742, + -0.999400794506073, + 5.665064334869385, + -0.9987848997116089, + -0.9643816947937012, + -0.7019122838973999, + 7.255547046661377, + 8.903468132019043, + -0.982044517993927, + 7.114678382873535, + -0.10607059299945831, + -0.9749990105628967, + 6.135150909423828, + -0.99994957447052 + ], + "type": "float32" + } + }, { "name": "elu float32 1D tensor default options", // default options: {alpha: 1} "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/equal.json b/tests/wpt/tests/webnn/resources/test_data/equal.json index 8350a25d594..bbd9143a032 100644 --- a/tests/wpt/tests/webnn/resources/test_data/equal.json +++ b/tests/wpt/tests/webnn/resources/test_data/equal.json @@ -27,6 +27,104 @@ "type": "uint8" } }, + { + "name": "equal float32 1D constant tensors", + "inputs": { + "a": { + "shape": [24], + "data": [ + 2.8057064434130865, + 5.588105051769192, + 2.8552264057573318, + 4.996258886261531, + 0.9727277518275201, + -4.7425998673234115, + 2.8057064434130865, + 5.588105051769192, + -5.107602083264831, + 6.62414218944782, + -2.320724650141428, + -7.053896009779472, + 2.8057064434130865, + 5.588105051769192, + 4.980423911313675, + -5.440841218751173, + 1.1459590058073985, + 7.774532655736756, + 2.8057064434130865, + 5.588105051769192, + -6.245251018074902, + -2.849073058101119, + -2.6951117252164236, + 5.8175630540970715 + ], + "type": "float32", + "constant": true + }, + "b": { + "shape": [24], + "data": [ + 2.8057064434130865, + 5.588105051769192, + -4.839719707803649, + 4.996258886261531, + 0.9727277518275201, + -6.173707599765419, + 2.8057064434130865, + 5.588105051769192, + 7.767369675510874, + -4.308908126069415, + -5.895479626582176, + -8.532091541161986, + 2.8057064434130865, + 5.588105051769192, + 0.17833953390240076, + -4.479541639848148, + 0.6819732148052395, + -6.687512654244134, + 2.8057064434130865, + 5.588105051769192, + -9.041799605912026, + -1.972828107164485, + -3.011512276155144, + 3.6268343183100704 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + 1, + 1, + 0, + 1, + 1, + 0, + 1, + 1, + 0, + 0, + 0, + 0, + 1, + 1, + 0, + 0, + 0, + 0, + 1, + 1, + 0, + 0, + 0, + 0 + ], + "type": "uint8" + } + }, { "name": "equal float32 1D tensors", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/erf.json b/tests/wpt/tests/webnn/resources/test_data/erf.json index 8a9ae6e68c1..6f0b550cf79 100644 --- a/tests/wpt/tests/webnn/resources/test_data/erf.json +++ b/tests/wpt/tests/webnn/resources/test_data/erf.json @@ -20,6 +20,73 @@ "type": "float32" } }, + { + "name": "erf float32 1D constant tensor", + "inputs": { + "input": { + "shape": [24], + "data": [ + -0.5883062462825124, + -0.5323766618091814, + 0.127987056070479, + 0.5772181473181615, + 0.9045778906827358, + -0.49856746753516346, + 0.9843886624146143, + 0.21642259286228738, + 0.25235170684373465, + -0.14916697974435467, + 0.9136939573458718, + -0.5736439986742754, + 0.740446832641029, + 0.5202203195176929, + -0.16549504687505712, + 0.8005731834523444, + 0.4001320000966242, + -0.7489422658248586, + -0.8946002438575227, + -0.392025619231934, + 0.6854220843685903, + -0.674490045974586, + -0.4398081957860396, + 0.2709762572248531 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + -0.5945858955383301, + -0.5484867095947266, + 0.14363321661949158, + 0.5856771469116211, + 0.7991966009140015, + -0.5192402005195618, + 0.8361185789108276, + 0.2404468059539795, + 0.27881762385368347, + -0.16707675158977509, + 0.8036975860595703, + -0.5827808976173401, + 0.7049695253372192, + 0.5380884408950806, + -0.1850501298904419, + 0.742441713809967, + 0.4285193383693695, + -0.710474967956543, + -0.7941843867301941, + -0.4207003712654114, + 0.6676210165023804, + -0.6598520874977112, + -0.46604686975479126, + 0.29844197630882263 + ], + "type": "float32" + } + }, { "name": "erf float32 1D tensor", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/exp.json b/tests/wpt/tests/webnn/resources/test_data/exp.json index 8a86edec3b8..2de52d951e9 100644 --- a/tests/wpt/tests/webnn/resources/test_data/exp.json +++ b/tests/wpt/tests/webnn/resources/test_data/exp.json @@ -1,5 +1,72 @@ { "tests": [ + { + "name": "exp float32 1D constant tensor", + "inputs": { + "x": { + "shape": [24], + "data": [ + 0.342143655338516, + -3.3109650690636583, + -3.696757542725746, + -5.105378072825206, + 5.471040383543361, + -0.06790750193598072, + 2.7373435551676373, + -3.547075850060808, + 5.3392248393586215, + -1.2636781380561768, + -0.9162953518691133, + -9.088432637604779, + -4.016050813135332, + 4.670352907446356, + 7.326991954708756, + 8.294342869341662, + -7.3454139558670795, + -0.9275799995316945, + -1.7085379363808997, + -9.737379277450184, + -1.9747875652397973, + 8.203150154065185, + -7.267597492286808, + -3.5890684093944714 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + 1.4079625606536865, + 0.03648095205426216, + 0.024803820997476578, + 0.006064045242965221, + 237.70733642578125, + 0.9343469142913818, + 15.44589900970459, + 0.02880876138806343, + 208.35113525390625, + 0.2826126217842102, + 0.39999815821647644, + 0.00011296502634650096, + 0.018024004995822906, + 106.73540496826172, + 1520.8004150390625, + 4001.173583984375, + 0.0006455459515564144, + 0.3955096900463104, + 0.18113042414188385, + 0.0000590350573475007, + 0.1387907862663269, + 3652.4365234375, + 0.0006977862794883549, + 0.02762405201792717 + ], + "type": "float32" + } + }, { "name": "exp float32 1D tensor", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/expand.json b/tests/wpt/tests/webnn/resources/test_data/expand.json index be56ca14890..00bf4a37b4e 100644 --- a/tests/wpt/tests/webnn/resources/test_data/expand.json +++ b/tests/wpt/tests/webnn/resources/test_data/expand.json @@ -220,6 +220,51 @@ "type": "float32" } }, + { + "name": "expand float32 1D constant tensor to 1D", + "inputs": { + "input": { + "shape": [1], + "data": [ + -6.461850643157959 + ], + "type": "float32", + "constant": true + } + }, + "newShape": [24], + "expected": { + "name": "output", + "shape": [24], + "data": [ + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959 + ], + "type": "float32" + } + }, { "name": "expand float32 1D tensor to 1D", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/floor.json b/tests/wpt/tests/webnn/resources/test_data/floor.json index f2fa797d416..3b5dba15762 100644 --- a/tests/wpt/tests/webnn/resources/test_data/floor.json +++ b/tests/wpt/tests/webnn/resources/test_data/floor.json @@ -1,5 +1,72 @@ { "tests": [ + { + "name": "floor float32 1D constant tensor", + "inputs": { + "x": { + "shape": [24], + "data": [ + 89.69458425635187, + -79.6715006046712, + -66.80949305244779, + -71.88439187517632, + 86.33935218844132, + 6.823808491438228, + 24.908446694609452, + 0.9734055387608578, + 19.94818517399692, + 0.8437776596471878, + -24.75293941821147, + 77.76482131339927, + -33.64446543048625, + 80.77624589277926, + 44.47844134603099, + -37.65005913863395, + -83.78780150071003, + 65.84009074464839, + -39.83677499773579, + 32.52575852910243, + -21.21354337121204, + -80.30910898865443, + 16.674850201817335, + -72.88893024677465 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + 89, + -80, + -67, + -72, + 86, + 6, + 24, + 0, + 19, + 0, + -25, + 77, + -34, + 80, + 44, + -38, + -84, + 65, + -40, + 32, + -22, + -81, + 16, + -73 + ], + "type": "float32" + } + }, { "name": "floor float32 1D tensor", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/gather.json b/tests/wpt/tests/webnn/resources/test_data/gather.json new file mode 100644 index 00000000000..a01654637f1 --- /dev/null +++ b/tests/wpt/tests/webnn/resources/test_data/gather.json @@ -0,0 +1,1268 @@ +{ + "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" + } + } + ] +} \ No newline at end of file diff --git a/tests/wpt/tests/webnn/resources/test_data/gemm.json b/tests/wpt/tests/webnn/resources/test_data/gemm.json index 3738e19f7c6..23a18b316ca 100644 --- a/tests/wpt/tests/webnn/resources/test_data/gemm.json +++ b/tests/wpt/tests/webnn/resources/test_data/gemm.json @@ -144,6 +144,103 @@ } }, // options.c + { + "name": "gemm two float32 2D constant tensors options.c", + "inputs": { + "a": { + "shape": [3, 4], + "data": [ + 82.98884511142329, + 90.51641254722982, + 59.6385201162642, + 36.27187180381433, + 18.96485038946509, + 43.89479290862091, + 98.89487912764056, + 91.46013741088626, + 50.51683887619669, + 40.45679629199866, + 50.76741460760452, + 9.336554329198155 + ], + "type": "float32", + "constant": true + }, + "b": { + "shape": [4, 5], + "data": [ + 25.14739246484985, + 66.69238549579231, + 63.29909902139696, + 10.629964783998469, + 61.32737573972831, + 0.003725653326558387, + 16.499146388625483, + 3.0366680571384252, + 93.14021782678614, + 70.08265680040718, + 75.74880854000601, + 96.6068806977233, + 99.10042039275365, + 23.243775283337477, + 86.1185682132947, + 42.90679144336773, + 34.08055187293266, + 87.37654561544477, + 92.34209530787089, + 60.32208994273669 + ], + "type": "float32", + "constant": true + } + }, + "options": { + "c": { + "shape": [3, 5], + "data": [ + 82.77202028708963, + 91.38520749770859, + 12.651897708721549, + 20.12200327935334, + 68.51224585053419, + 35.2024171023056, + 13.33466578964102, + 50.785469741049205, + 88.61195160882922, + 30.577471042677097, + 69.47062151883239, + 7.166217909076766, + 28.337108113083744, + 90.69412588106762, + 71.23025762837965 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [3, 5], + "data": [ + 8243.9189453125, + 14117.208984375, + 14620.15234375, + 14068.654296875, + 18825.609375, + 11927.712890625, + 14673.310546875, + 19176.533203125, + 15122.8896484375, + 18303.658203125, + 5586.16064453125, + 9266.43359375, + 9195.7294921875, + 6438.0244140625, + 10939.8330078125 + ], + "type": "float32" + } + }, { "name": "gemm two float32 2D tensors options.c", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/greater.json b/tests/wpt/tests/webnn/resources/test_data/greater.json index 12e32d90728..d7dc34d18bb 100644 --- a/tests/wpt/tests/webnn/resources/test_data/greater.json +++ b/tests/wpt/tests/webnn/resources/test_data/greater.json @@ -27,6 +27,104 @@ "type": "uint8" } }, + { + "name": "greater float32 1D constant tensors", + "inputs": { + "a": { + "shape": [24], + "data": [ + -5.394711458674926, + -7.189248660357093, + -3.108176577372168, + 4.977657240654292, + 5.111654167277017, + -1.538657969029952, + 1.4143663572463936, + -0.9362112515011844, + -6.029961511382025, + -3.0134198095493225, + 0.17085531331013115, + 7.395327146335315, + 7.178691694492247, + -4.826237489933036, + -2.0204401018636275, + -3.267887959306748, + 8.944384478538513, + -5.9321008596864555, + 0.7069857360876597, + 2.7764204012258844, + 0.9788337909419198, + -6.254901877789392, + 4.40903450389083, + -6.775286805113776 + ], + "type": "float32", + "constant": true + }, + "b": { + "shape": [24], + "data": [ + -6.155234276085855, + -4.023341341511664, + 5.9525983178014386, + 2.3066237309537883, + -2.7692292888690817, + -0.9711201246625745, + 1.2222066588909755, + 4.590261643319389, + 9.101232896619365, + -4.997007709812857, + -4.807293508200368, + 8.919360491720344, + 0.900502762346548, + -2.8414556193065543, + -2.8280412040974845, + 8.479845345966147, + -7.840679465875833, + 9.213960197279938, + 4.982364937519449, + -2.5073192467116145, + -4.518013838492472, + 8.351094603114355, + -6.161073167579363, + 0.7364829132932815 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + 1, + 0, + 0, + 1, + 1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 1, + 0 + ], + "type": "uint8" + } + }, { "name": "greater float32 1D tensors", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/greater_or_equal.json b/tests/wpt/tests/webnn/resources/test_data/greater_or_equal.json index 93ae0b3a4bc..e47ac4350ab 100644 --- a/tests/wpt/tests/webnn/resources/test_data/greater_or_equal.json +++ b/tests/wpt/tests/webnn/resources/test_data/greater_or_equal.json @@ -26,6 +26,103 @@ "type": "uint8" } }, + { + "name": "greaterOrEqual float32 1D constant tensors", + "inputs": { + "a": { + "shape": [24], + "data": [ + -8.049108184315305, + -5.522611295148119, + -2.097508268712267, + -7.455326346855671, + -5.4503762765457475, + 9.802918209039795, + -3.6045179646016123, + 4.088084930154503, + -5.068354954162224, + 1.5821936652025705, + 5.675583814922739, + -4.34159498166756, + 1.6946222397391875, + 2.926734617639429, + -7.000074175864097, + -2.5270822950013105, + 1.4437268276959525, + 7.862768559473771, + 5.782288879751384, + 1.8712013338616238, + -0.5233999645803635, + 0.43433289218891247, + 8.938365119196128, + 1.65683957584843 + ], + "type": "float32", + "constant": true + }, + "b": { + "shape": [24], + "data": [ + -7.028095113692983, + 1.9109992244501228, + 3.576529209692282, + 1.7167964605289043, + 2.846137548919838, + -2.311762981138341, + -6.086130252861408, + -3.437926736129744, + -3.4764428213302656, + -2.194656398262036, + 2.9962267558939892, + -5.540947945499273, + 5.098470133217425, + 6.775498827056623, + 2.4505413384295913, + 5.210598812779001, + -9.710094050019439, + -2.413028179599279, + 8.678308853275162, + -9.449530756013411, + 0.7702168987269076, + -1.518607415508292, + -9.15394321549195, + -4.9917360557925194 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "shape": [24], + "data": [ + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 0, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 1, + 1, + 0, + 1, + 0, + 1, + 1, + 1 + ], + "type": "uint8" + } + }, { "name": "greaterOrEqual float32 1D tensors", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/hard_sigmoid.json b/tests/wpt/tests/webnn/resources/test_data/hard_sigmoid.json index 22fe7c6da0c..5d8c0c5daf1 100644 --- a/tests/wpt/tests/webnn/resources/test_data/hard_sigmoid.json +++ b/tests/wpt/tests/webnn/resources/test_data/hard_sigmoid.json @@ -1,5 +1,72 @@ { // hardSigmoid: Calculate the non-smooth function used in place of a sigmoid function on the input tensor. "tests": [ + { + "name": "hardSigmoid float32 positive 1D constant tensor default options", // default options: {alpha: 0.2, beta: 0.5} + "inputs": { + "x": { + "shape": [24], + "data": [ + 0.05907066981577147, + 0.7076089198897, + 0.5228405296259637, + 0.42310158753617455, + 0.6643692569867639, + 0.9502940424761401, + 0.10918906453593258, + 0.012977113903015258, + 0.4755297159390164, + 0.5322551665299613, + 0.684307857800798, + 0.4662107602754757, + 0.3048996433987061, + 0.8025872652109942, + 0.2485963985673023, + 0.6636898942337357, + 0.554761182646025, + 0.5542584257213008, + 0.7311381962152534, + 0.48809603333206986, + 0.7766845231174959, + 0.8455570201933926, + 0.5553020911955322, + 0.5603444395469193 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + 0.5118141174316406, + 0.6415218114852905, + 0.6045681238174438, + 0.5846202969551086, + 0.6328738331794739, + 0.6900588274002075, + 0.5218378305435181, + 0.5025954246520996, + 0.5951059460639954, + 0.6064510345458984, + 0.6368615627288818, + 0.5932421684265137, + 0.5609799027442932, + 0.6605174541473389, + 0.5497192740440369, + 0.6327379941940308, + 0.6109522581100464, + 0.6108517050743103, + 0.6462276577949524, + 0.5976191759109497, + 0.6553369164466858, + 0.669111430644989, + 0.6110604405403137, + 0.6120688915252686 + ], + "type": "float32" + } + }, { "name": "hardSigmoid float32 positive 1D tensor default options", // default options: {alpha: 0.2, beta: 0.5} "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/hard_swish.json b/tests/wpt/tests/webnn/resources/test_data/hard_swish.json index 8d7812d21e2..e43f62ede0e 100644 --- a/tests/wpt/tests/webnn/resources/test_data/hard_swish.json +++ b/tests/wpt/tests/webnn/resources/test_data/hard_swish.json @@ -1,5 +1,72 @@ { "tests": [ + { + "name": "hardSwish float32 1D constant tensor", + "inputs": { + "x": { + "shape": [24], + "data": [ + 0.7341583533045579, + 9.118859151005996, + 3.545238531520827, + 2.621943879280181, + -6.445507690595167, + -1.6835596550754381, + 5.523179785756591, + -5.958856051028132, + -9.169189933081544, + 6.420943542920213, + -3.293031330275471, + 1.0410166785810624, + -7.246322671816956, + -0.9472730969847909, + -5.778352255817807, + 3.185229125228698, + -7.261818072290236, + 4.174602615173795, + 3.7802628241590686, + -6.07124038718255, + -9.909919471919547, + -7.744259390113584, + -8.286120816748381, + 8.083491160956697 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + 0.4569105803966522, + 9.11885929107666, + 3.545238494873047, + 2.4567370414733887, + 0, + -0.3693843185901642, + 5.52318000793457, + 0, + 0, + 6.420943737030029, + 0, + 0.7011276483535767, + 0, + -0.3240821659564972, + 0, + 3.1852290630340576, + 0, + 4.174602508544922, + 3.7802627086639404, + 0, + 0, + 0, + 0, + 8.083491325378418 + ], + "type": "float32" + } + }, { "name": "hardSwish float32 1D tensor", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/identity.json b/tests/wpt/tests/webnn/resources/test_data/identity.json index 444b39dc06c..6024e8786fb 100644 --- a/tests/wpt/tests/webnn/resources/test_data/identity.json +++ b/tests/wpt/tests/webnn/resources/test_data/identity.json @@ -20,6 +20,74 @@ "type": "float32" } }, + { + "name": "identity float32 1D constant tensor", + "inputs": { + "input": { + "shape":[24], + "data": [ + 0.3775514170243319, + -0.8890897684684553, + 9.965806154214683, + 7.964576323402355, + -4.207889285235442, + -3.748703004469509, + -2.5114005246358584, + 5.777673182705456, + -4.472823584733945, + -8.405767426137253, + -3.857972358579822, + 6.0361876313443865, + 9.076417609486516, + 7.101912233390028, + 1.4166420410053604, + -5.644308337756456, + -2.598648114422626, + -7.264847061642685, + -9.782458548766716, + 5.4966995825042275, + -9.967339588615012, + -6.901016518448189, + -2.850190435789366, + 3.279616439989832 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + 0.377551406621933, + -0.8890897631645203, + 9.965806007385254, + 7.964576244354248, + -4.207889080047607, + -3.7487030029296875, + -2.5114004611968994, + 5.777673244476318, + -4.472823619842529, + -8.405767440795898, + -3.8579723834991455, + 6.036187648773193, + 9.076417922973633, + 7.101912021636963, + 1.4166420698165894, + -5.644308567047119, + -2.5986480712890625, + -7.264847278594971, + -9.782458305358887, + 5.496699810028076, + -9.967339515686035, + -6.901016712188721, + -2.8501904010772705, + 3.279616355895996 + ], + "type": "float32", + "constant": true + } + }, { "name": "identity float32 1D tensor", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/layer_normalization.json b/tests/wpt/tests/webnn/resources/test_data/layer_normalization.json new file mode 100644 index 00000000000..6005776de5e --- /dev/null +++ b/tests/wpt/tests/webnn/resources/test_data/layer_normalization.json @@ -0,0 +1,842 @@ +{ + "tests": [ + { + "name": "layerNormalization float32 2D tensor default options", + "inputs": { + "input": { + "shape": [4, 6], + "data": [ + -35.51446620394829, + 54.735407789317094, + 19.65901979009459, + -15.882677905820188, + 65.48657727565143, + 25.818493353057278, + 97.5530279802174, + -8.057161374785466, + 62.941297318740425, + -48.91555566709158, + 91.90643767958213, + 46.67098666459884, + -74.85331462850246, + 30.12636276060539, + 26.130894553011203, + 59.302706651602165, + -60.36199702412532, + 18.556152152037427, + -88.0373081005649, + -26.566773146168643, + 70.81292942844541, + 9.1056120562301, + 56.66746139054709, + 21.78444497295007 + ], + "type": "float32" + } + }, + "expected": { + "name": "output", + "shape": [4, 6], + "data": [ + -1.5257738828659058, + 0.997844934463501, + 0.017018765211105347, + -0.9768186211585999, + 1.2984753847122192, + 0.18925349414348602, + 1.0812907218933105, + -0.915019690990448, + 0.4270379841327667, + -1.6873507499694824, + 0.9745554327964783, + 0.11948632448911667, + -1.5086692571640015, + 0.6123882532119751, + 0.5316619873046875, + 1.2018805742263794, + -1.215880036354065, + 0.378618448972702, + -1.795186161994934, + -0.6376377940177917, + 1.1961140632629395, + 0.034106940031051636, + 0.9297415614128113, + 0.2728613615036011 + ], + "type": "float32" + } + }, + { + "name": "layerNormalization float32 3D tensor default options", + "inputs": { + "input": { + "shape": [2, 3, 4], + "data": [ + -35.51446620394829, + 54.735407789317094, + 19.65901979009459, + -15.882677905820188, + 65.48657727565143, + 25.818493353057278, + 97.5530279802174, + -8.057161374785466, + 62.941297318740425, + -48.91555566709158, + 91.90643767958213, + 46.67098666459884, + -74.85331462850246, + 30.12636276060539, + 26.130894553011203, + 59.302706651602165, + -60.36199702412532, + 18.556152152037427, + -88.0373081005649, + -26.566773146168643, + 70.81292942844541, + 9.1056120562301, + 56.66746139054709, + 21.78444497295007 + ], + "type": "float32" + } + }, + "expected": { + "name": "output", + "shape": [2, 3, 4], + "data": [ + -1.4057259559631348, + 0.5396455526351929, + -0.21643976867198944, + -0.9825550317764282, + 0.7713912725448608, + -0.08366990834474564, + 1.46259605884552, + -0.8138729333877563, + 0.7165266871452332, + -1.6945916414260864, + 1.3408818244934082, + 0.3658137917518616, + -1.5234858989715576, + 0.5162702202796936, + 0.43863821029663086, + 1.0831668376922607, + -1.2419193983078003, + 0.29146093130111694, + -1.7796510457992554, + -0.5852779150009155, + 1.3068104982376099, + 0.10783683508634567, + 1.0319640636444092, + 0.35418668389320374 + ], + "type": "float32" + } + }, + { + "name": "layerNormalization float32 4D tensor default options", + "inputs": { + "input": { + "shape": [2, 1, 4, 3], + "data": [ + -35.51446620394829, + 54.735407789317094, + 19.65901979009459, + -15.882677905820188, + 65.48657727565143, + 25.818493353057278, + 97.5530279802174, + -8.057161374785466, + 62.941297318740425, + -48.91555566709158, + 91.90643767958213, + 46.67098666459884, + -74.85331462850246, + 30.12636276060539, + 26.130894553011203, + 59.302706651602165, + -60.36199702412532, + 18.556152152037427, + -88.0373081005649, + -26.566773146168643, + 70.81292942844541, + 9.1056120562301, + 56.66746139054709, + 21.78444497295007 + ], + "type": "float32" + } + }, + "expected": { + "name": "output", + "shape": [2, 1, 4, 3], + "data": [ + -1.4057259559631348, + 0.5396455526351929, + -0.21643976867198944, + -0.9825550317764282, + 0.7713912725448608, + -0.08366990834474564, + 1.46259605884552, + -0.8138729333877563, + 0.7165266871452332, + -1.6945916414260864, + 1.3408818244934082, + 0.3658137917518616, + -1.5234858989715576, + 0.5162702202796936, + 0.43863821029663086, + 1.0831668376922607, + -1.2419193983078003, + 0.29146093130111694, + -1.7796510457992554, + -0.5852779150009155, + 1.3068104982376099, + 0.10783683508634567, + 1.0319640636444092, + 0.35418668389320374 + ], + "type": "float32" + } + }, + { + "name": "layerNormalization float32 5D tensor default options", + "inputs": { + "input": { + "shape": [2, 1, 2, 2, 3], + "data": [ + -35.51446620394829, + 54.735407789317094, + 19.65901979009459, + -15.882677905820188, + 65.48657727565143, + 25.818493353057278, + 97.5530279802174, + -8.057161374785466, + 62.941297318740425, + -48.91555566709158, + 91.90643767958213, + 46.67098666459884, + -74.85331462850246, + 30.12636276060539, + 26.130894553011203, + 59.302706651602165, + -60.36199702412532, + 18.556152152037427, + -88.0373081005649, + -26.566773146168643, + 70.81292942844541, + 9.1056120562301, + 56.66746139054709, + 21.78444497295007 + ], + "type": "float32" + } + }, + "expected": { + "name": "output", + "shape": [2, 1, 2, 2, 3], + "data": [ + -1.4057259559631348, + 0.5396455526351929, + -0.21643976867198944, + -0.9825550317764282, + 0.7713912725448608, + -0.08366990834474564, + 1.46259605884552, + -0.8138729333877563, + 0.7165266871452332, + -1.6945916414260864, + 1.3408818244934082, + 0.3658137917518616, + -1.5234858989715576, + 0.5162702202796936, + 0.43863821029663086, + 1.0831668376922607, + -1.2419193983078003, + 0.29146093130111694, + -1.7796510457992554, + -0.5852779150009155, + 1.3068104982376099, + 0.10783683508634567, + 1.0319640636444092, + 0.35418668389320374 + ], + "type": "float32" + } + }, + { + "name": "layerNormalization float32 4D tensor options.scale", + "inputs": { + "input": { + "shape": [2, 1, 4, 3], + "data": [ + -35.51446620394829, + 54.735407789317094, + 19.65901979009459, + -15.882677905820188, + 65.48657727565143, + 25.818493353057278, + 97.5530279802174, + -8.057161374785466, + 62.941297318740425, + -48.91555566709158, + 91.90643767958213, + 46.67098666459884, + -74.85331462850246, + 30.12636276060539, + 26.130894553011203, + 59.302706651602165, + -60.36199702412532, + 18.556152152037427, + -88.0373081005649, + -26.566773146168643, + 70.81292942844541, + 9.1056120562301, + 56.66746139054709, + 21.78444497295007 + ], + "type": "float32" + } + }, + "options": { + "scale": { + "shape": [1, 4, 3], + "data": [ + -3.822842326186211, + -5.4524582226774365, + 0.6776165732478745, + -4.027037630534966, + -3.7771617295664717, + -9.327335252346955, + 7.181691199879712, + 1.5054303426700422, + 3.1208942770408132, + 0.5214731591212676, + 2.6719749293214345, + -3.5713709254192016 + ], + "type": "float32" + } + }, + "expected": { + "name": "output", + "shape": [2, 1, 4, 3], + "data": [ + 5.373868465423584, + -2.942394971847534, + -0.14666318893432617, + 3.9567861557006836, + -2.9136698246002197, + 0.780417263507843, + 10.503913879394531, + -1.225229024887085, + 2.236203908920288, + -0.8836840987205505, + 3.5828025341033936, + -1.3064566850662231, + 5.824046611785889, + -2.814941883087158, + 0.29722854495048523, + -4.3619537353515625, + 4.6909308433532715, + -2.7185537815093994, + -12.780903816223145, + -0.8810951709747314, + 4.0784173011779785, + 0.05623401328921318, + 2.7573819160461426, + -1.2649319171905518 + ], + "type": "float32" + } + }, + { + "name": "layerNormalization float32 4D tensor options.bias", + "inputs": { + "input": { + "shape": [2, 1, 4, 3], + "data": [ + -35.51446620394829, + 54.735407789317094, + 19.65901979009459, + -15.882677905820188, + 65.48657727565143, + 25.818493353057278, + 97.5530279802174, + -8.057161374785466, + 62.941297318740425, + -48.91555566709158, + 91.90643767958213, + 46.67098666459884, + -74.85331462850246, + 30.12636276060539, + 26.130894553011203, + 59.302706651602165, + -60.36199702412532, + 18.556152152037427, + -88.0373081005649, + -26.566773146168643, + 70.81292942844541, + 9.1056120562301, + 56.66746139054709, + 21.78444497295007 + ], + "type": "float32" + } + }, + "options": { + "bias": { + "shape": [1, 4, 3], + "data": [ + 7.86298294434458, + -3.660304771854861, + -6.955524501645973, + -6.397322772511171, + 3.2689586393414984, + -2.7498081789293094, + -4.080942283863029, + -7.137991900788561, + 8.465653688103547, + 2.762545157541174, + 0.8230442324150911, + -3.8275613744392922 + ], + "type": "float32" + } + }, + "expected": { + "name": "output", + "shape": [2, 1, 4, 3], + "data": [ + 6.45725679397583, + -3.120659112930298, + -7.171964168548584, + -7.37987756729126, + 4.040349960327148, + -2.8334779739379883, + -2.6183459758758545, + -7.951864719390869, + 9.182180404663086, + 1.0679534673690796, + 2.163926124572754, + -3.461747646331787, + 6.339496612548828, + -3.1440346240997314, + -6.516886234283447, + -5.314155578613281, + 2.027039051055908, + -2.4583470821380615, + -5.860593318939209, + -7.723269939422607, + 9.77246379852295, + 2.8703818321228027, + 1.8550082445144653, + -3.473374605178833 + ], + "type": "float32" + } + }, + { + "name": "layerNormalization float32 4D tensor options.axes=[2]", + "inputs": { + "input": { + "shape": [2, 1, 4, 3], + "data": [ + -35.51446620394829, + 54.735407789317094, + 19.65901979009459, + -15.882677905820188, + 65.48657727565143, + 25.818493353057278, + 97.5530279802174, + -8.057161374785466, + 62.941297318740425, + -48.91555566709158, + 91.90643767958213, + 46.67098666459884, + -74.85331462850246, + 30.12636276060539, + 26.130894553011203, + 59.302706651602165, + -60.36199702412532, + 18.556152152037427, + -88.0373081005649, + -26.566773146168643, + 70.81292942844541, + 9.1056120562301, + 56.66746139054709, + 21.78444497295007 + ], + "type": "float32" + } + }, + "options": { + "axes": [2] + }, + "expected": { + "name": "output", + "shape": [2, 1, 4, 3], + "data": [ + -0.6012066006660461, + 0.10132180899381638, + -1.112992763519287, + -0.26228588819503784, + 0.3943416476249695, + -0.7543209195137024, + 1.6960537433624268, + -1.6100702285766602, + 1.4073745012283325, + -0.8325613141059875, + 1.114406704902649, + 0.45993921160697937, + -0.8445013165473938, + 0.6554933190345764, + -0.3856155574321747, + 1.3668763637542725, + -1.3111618757247925, + -0.7422532439231873, + -1.0618212223052979, + -0.5766634941101074, + 1.7181260585784912, + 0.539446234703064, + 1.2323321104049683, + -0.5902572274208069 + ], + "type": "float32" + } + }, + { + "name": "layerNormalization float32 4D tensor options.epsilon", + "inputs": { + "input": { + "shape": [2, 1, 4, 3], + "data": [ + -35.51446620394829, + 54.735407789317094, + 19.65901979009459, + -15.882677905820188, + 65.48657727565143, + 25.818493353057278, + 97.5530279802174, + -8.057161374785466, + 62.941297318740425, + -48.91555566709158, + 91.90643767958213, + 46.67098666459884, + -74.85331462850246, + 30.12636276060539, + 26.130894553011203, + 59.302706651602165, + -60.36199702412532, + 18.556152152037427, + -88.0373081005649, + -26.566773146168643, + 70.81292942844541, + 9.1056120562301, + 56.66746139054709, + 21.78444497295007 + ], + "type": "float32" + } + }, + "options": { + "epsilon": 1e-4 + }, + "expected": { + "name": "output", + "shape": [2, 1, 4, 3], + "data": [ + -1.4057258367538452, + 0.5396455526351929, + -0.21643976867198944, + -0.9825550317764282, + 0.7713912725448608, + -0.08366990089416504, + 1.46259605884552, + -0.8138729333877563, + 0.7165266871452332, + -1.6945916414260864, + 1.3408817052841187, + 0.3658137619495392, + -1.5234858989715576, + 0.5162702202796936, + 0.43863821029663086, + 1.0831668376922607, + -1.2419193983078003, + 0.29146093130111694, + -1.7796509265899658, + -0.5852779150009155, + 1.3068104982376099, + 0.10783682763576508, + 1.0319639444351196, + 0.35418668389320374 + ], + "type": "float32" + } + }, + { + "name": "layerNormalization float32 4D tensor options.scale and options.axes=[0, 2]", + "inputs": { + "input": { + "shape": [2, 1, 4, 3], + "data": [ + -35.51446620394829, + 54.735407789317094, + 19.65901979009459, + -15.882677905820188, + 65.48657727565143, + 25.818493353057278, + 97.5530279802174, + -8.057161374785466, + 62.941297318740425, + -48.91555566709158, + 91.90643767958213, + 46.67098666459884, + -74.85331462850246, + 30.12636276060539, + 26.130894553011203, + 59.302706651602165, + -60.36199702412532, + 18.556152152037427, + -88.0373081005649, + -26.566773146168643, + 70.81292942844541, + 9.1056120562301, + 56.66746139054709, + 21.78444497295007 + ], + "type": "float32" + } + }, + "options": { + "scale": { + "shape": [2, 4], + "data": [ + 8.726573383699723, + -5.388210753831433, + -6.811323199504957, + 4.707905497256553, + -4.705779931167426, + -5.143046959493542, + -1.1115549861715444, + 5.250569701742819 + ], + "type": "float32" + }, + "axes": [0, 2] + }, + "expected": { + "name": "output", + "shape": [2, 1, 4, 3], + "data": [ + -3.3744184970855713, + 5.22746467590332, + -7.580371856689453, + 0.3324689269065857, + -4.414334774017334, + 2.973374605178833, + -12.369945526123047, + 4.680946350097656, + -9.247408866882324, + -2.8648624420166016, + 6.40486478805542, + 2.4516794681549072, + 4.884079456329346, + -0.44672244787216187, + 2.521172285079956, + -6.083702564239502, + 9.044846534729004, + 4.759283065795898, + 1.3962621688842773, + 1.185346245765686, + -1.959165334701538, + 1.8479242324829102, + 3.3530402183532715, + -3.986907958984375 + ], + "type": "float32" + } + }, + { + "name": "layerNormalization float32 4D tensor options.bias and options.axes=[3, 1, 2]", + "inputs": { + "input": { + "shape": [2, 1, 4, 3], + "data": [ + -35.51446620394829, + 54.735407789317094, + 19.65901979009459, + -15.882677905820188, + 65.48657727565143, + 25.818493353057278, + 97.5530279802174, + -8.057161374785466, + 62.941297318740425, + -48.91555566709158, + 91.90643767958213, + 46.67098666459884, + -74.85331462850246, + 30.12636276060539, + 26.130894553011203, + 59.302706651602165, + -60.36199702412532, + 18.556152152037427, + -88.0373081005649, + -26.566773146168643, + 70.81292942844541, + 9.1056120562301, + 56.66746139054709, + 21.78444497295007 + ], + "type": "float32" + } + }, + "options": { + "bias": { + "shape": [3, 1, 4], + "data": [ + -0.1396923067429423, + -6.156772261512771, + 4.3632959655495505, + 8.859804790093527, + 9.772650559072677, + -3.4626546514711087, + 9.74495010474131, + -0.39589682596727016, + -8.497353592778571, + 6.1725369732984525, + -2.893046077750334, + 1.7220044503066347 + ], + "type": "float32" + }, + "axes": [3, 1, 2] + }, + "expected": { + "name": "output", + "shape": [2, 1, 4, 3], + "data": [ + -1.5454182624816895, + 10.312295913696289, + -8.713793754577637, + -7.139327049255371, + -2.691263198852539, + 6.088866710662842, + 5.825891971588135, + 8.931077003479004, + -2.1765193939208984, + 7.165213584899902, + 0.9449849724769592, + 2.087818145751953, + -1.6631782054901123, + 10.288921356201172, + -8.058714866638184, + -5.073605060577393, + -4.704574108123779, + 6.463997840881348, + 2.5836451053619385, + 9.159672737121582, + -1.5862356424331665, + 8.967641830444336, + 0.6360672116279602, + 2.0761911869049072 + ], + "type": "float32" + } + }, + { + "name": "layerNormalization float32 4D tensor all options", + "inputs": { + "input": { + "shape": [2, 1, 4, 3], + "data": [ + -35.51446620394829, + 54.735407789317094, + 19.65901979009459, + -15.882677905820188, + 65.48657727565143, + 25.818493353057278, + 97.5530279802174, + -8.057161374785466, + 62.941297318740425, + -48.91555566709158, + 91.90643767958213, + 46.67098666459884, + -74.85331462850246, + 30.12636276060539, + 26.130894553011203, + 59.302706651602165, + -60.36199702412532, + 18.556152152037427, + -88.0373081005649, + -26.566773146168643, + 70.81292942844541, + 9.1056120562301, + 56.66746139054709, + 21.78444497295007 + ], + "type": "float32" + } + }, + "options": { + "scale": { + "shape": [2, 3, 1], + "data": [ + 7.715926600551629, + 1.737107960115587, + 9.139651060226974, + 5.7588235611312335, + -2.8198351834129154, + -0.6866958235000595 + ], + "type": "float32" + }, + "bias": { + "shape": [2, 3, 1], + "data": [ + -8.71067229356711, + -7.642980873415213, + 4.937538370466076, + -2.1876746145760695, + -4.0676126709354765, + -6.83625459268332 + ], + "type": "float32" + }, + "axes": [0, 3, 1], + "epsilon": 1e-4 + }, + "expected": { + "name": "output", + "shape": [2, 1, 4, 3], + "data": [ + -15.487034797668457, + -5.628695964813232, + 8.29687786102295, + -14.294686317443848, + -5.639192581176758, + 7.11608362197876, + 0.7769554257392883, + -8.346451759338379, + 11.279659271240234, + -22.506288528442383, + -5.173816204071045, + 8.506545066833496, + -12.360523223876953, + -5.77052116394043, + -7.18900203704834, + 3.6336634159088135, + 0.8666883707046509, + -6.884884357452393, + -11.648612976074219, + -2.117840528488159, + -7.396423816680908, + -4.869131088256836, + -5.8111701011657715, + -6.714934349060059 + ], + "type": "float32" + } + } + ] +} \ No newline at end of file diff --git a/tests/wpt/tests/webnn/resources/test_data/leaky_relu.json b/tests/wpt/tests/webnn/resources/test_data/leaky_relu.json index a95a9a0cfce..be810a90cea 100644 --- a/tests/wpt/tests/webnn/resources/test_data/leaky_relu.json +++ b/tests/wpt/tests/webnn/resources/test_data/leaky_relu.json @@ -1,5 +1,72 @@ { "tests": [ + { + "name": "leakyRelu float32 1D constant tensor default options", // default options.alpha=0.01 + "inputs": { + "x": { + "shape": [24], + "data": [ + -19.053641157857015, + 50.77590443347373, + -69.54966768567536, + -80.57432185346957, + -90.40109641580112, + 76.02884674163622, + 66.33873525494391, + -84.10186452043264, + -17.19101282693427, + -87.47624329964907, + -3.4164664941905585, + -22.7723589638245, + -2.509489125727569, + 18.933284857582677, + 98.61402761165104, + 55.33923216295767, + -33.178605382176, + -46.03901297809681, + -61.47925538549912, + 64.26514742116822, + 21.46934200700099, + -31.51468946013378, + -41.27694294131783, + -65.59528852425132 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + -0.19053640961647034, + 50.77590560913086, + -0.695496678352356, + -0.8057432770729065, + -0.9040110111236572, + 76.02884674072266, + 66.33873748779297, + -0.8410186767578125, + -0.1719101369380951, + -0.8747624158859253, + -0.0341646634042263, + -0.2277235984802246, + -0.02509489096701145, + 18.933284759521484, + 98.61402893066406, + 55.3392333984375, + -0.33178603649139404, + -0.4603901207447052, + -0.6147925853729248, + 64.26514434814453, + 21.469341278076172, + -0.31514689326286316, + -0.4127694368362427, + -0.6559529304504395 + ], + "type": "float32" + } + }, { "name": "leakyRelu float32 1D tensor default options", // default options.alpha=0.01 "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/lesser.json b/tests/wpt/tests/webnn/resources/test_data/lesser.json index 64774d1621c..7527ea5c53a 100644 --- a/tests/wpt/tests/webnn/resources/test_data/lesser.json +++ b/tests/wpt/tests/webnn/resources/test_data/lesser.json @@ -26,6 +26,103 @@ "type": "uint8" } }, + { + "name": "lesser float32 1D constant tensors", + "inputs": { + "a": { + "shape": [24], + "data": [ + -1.1472189199107738, + -8.409373914977403, + -2.2753309465448535, + -0.5770801181952088, + 8.171789524073006, + -0.907120961653046, + 5.290845327676683, + -3.9134646002455975, + 9.825094822582592, + -8.931730412646708, + -3.4574016573266553, + -7.331231867596579, + 1.2320041500405665, + 4.312076818806343, + 1.2715546106634825, + 4.184540686856884, + -6.710920186561022, + 3.0768423616317655, + 1.0030865825397903, + -9.076244529342748, + 8.907161848861044, + 4.232614785327211, + 2.1005889661509425, + -6.201345656840638 + ], + "type": "float32", + "constant": true + }, + "b": { + "shape": [24], + "data": [ + 2.9453755897484726, + 3.7304716829497266, + 4.025375190729793, + -4.718355239722074, + 6.773274305103257, + -2.042813441289626, + -6.526761957285996, + 6.826299715878466, + -9.267172939567224, + 6.118424090729771, + -2.0017322775193014, + 1.779831042224643, + 9.660093887317394, + -2.7473158972960476, + -3.4345008109025033, + -4.7510974486127955, + -6.092621934151237, + -0.43348063367342426, + -1.4069053013420518, + -0.23742098855005445, + -9.105970612932852, + 6.811780042167808, + -6.768326860738436, + -8.952353121501568 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "shape": [24], + "data": [ + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 1, + 0, + 0, + 1, + 0, + 1, + 0, + 0 + ], + "type": "uint8" + } + }, { "name": "lesser float32 1D tensors", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/lesser_or_equal.json b/tests/wpt/tests/webnn/resources/test_data/lesser_or_equal.json index 8daea5e1368..f47bd3b9d9c 100644 --- a/tests/wpt/tests/webnn/resources/test_data/lesser_or_equal.json +++ b/tests/wpt/tests/webnn/resources/test_data/lesser_or_equal.json @@ -26,6 +26,103 @@ "type": "uint8" } }, + { + "name": "lesserOrEqual float32 1D constant tensors", + "inputs": { + "a": { + "shape": [24], + "data": [ + -8.28400872674051, + -3.2192645259702735, + -6.543179908675301, + -0.5402850743134735, + -5.413843546081334, + 5.5837429023307585, + 1.5017805895450707, + 6.592243911021967, + -9.925486373960158, + -7.134800104191736, + -4.915772925181514, + -9.137166899591985, + 9.403683415346574, + -9.831502572671727, + -2.01231810920369, + -6.5976898409038665, + -8.269321065543842, + 8.281030248217476, + 1.645282309888799, + -1.486272662516086, + -4.998753723234106, + -0.9209934547883556, + -9.434256078100471, + 9.81323851825412 + ], + "type": "float32", + "constant": true + }, + "b": { + "shape": [24], + "data": [ + 5.498841374763742, + 1.7662660534986596, + -2.815573112568557, + -6.048312187382399, + 9.49753657859197, + -2.1015747067374635, + -4.079037092104509, + 5.314039986892048, + 0.0387145550620982, + -0.30728287605858995, + 4.975426828050438, + 3.4626017503711424, + 8.605685214066689, + 1.5140481393702743, + 2.009095893644295, + -0.3105867764637402, + -4.244836158037981, + -3.5506834915660024, + -2.5953286338985615, + -4.999806170449843, + 3.1189506609780526, + 9.70514084988082, + 9.546739178733759, + -6.189505543544822 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "shape": [24], + "data": [ + 1, + 1, + 1, + 0, + 1, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 0, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 1, + 1, + 1, + 0 + ], + "type": "uint8" + } + }, { "name": "lesserOrEqual float32 1D tensors", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/linear.json b/tests/wpt/tests/webnn/resources/test_data/linear.json index ded1d2d7e35..6cbb84e9cb0 100644 --- a/tests/wpt/tests/webnn/resources/test_data/linear.json +++ b/tests/wpt/tests/webnn/resources/test_data/linear.json @@ -1,5 +1,72 @@ { // linear: Calculate a linear function y = alpha * x + beta on the input tensor. "tests": [ + { + "name": "linear float32 1D constant tensor default options", // default options: {alpha: 1, beta: 0} + "inputs": { + "x": { + "shape": [24], + "data": [ + -1.1225161816883542, + -6.605223195131225, + -1.9555539248683687, + -4.598548331438281, + 4.234208072658522, + 3.097542121236385, + 3.7465923873418348, + -4.487029772637743, + 6.407402114982858, + -4.354544013606705, + -5.8190925441357955, + 3.7214346452179328, + -6.330114110872294, + 8.580595073862398, + -6.764922344398516, + 6.433565829855674, + -9.708685944356201, + 2.6431380232113746, + 5.214088864824586, + 9.658617012096975, + -8.72174939837989, + -0.4533396492565025, + 9.992619953447026, + -6.469674921617137 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + -1.12251615524292, + -6.605223178863525, + -1.9555538892745972, + -4.598548412322998, + 4.234208106994629, + 3.0975420475006104, + 3.7465922832489014, + -4.487029552459717, + 6.407402038574219, + -4.354544162750244, + -5.819092750549316, + 3.7214345932006836, + -6.330113887786865, + 8.580595016479492, + -6.764922142028809, + 6.433565616607666, + -9.708685874938965, + 2.6431379318237305, + 5.2140889167785645, + 9.65861701965332, + -8.721749305725098, + -0.4533396363258362, + 9.992619514465332, + -6.469675064086914 + ], + "type": "float32" + } + }, { "name": "linear float32 1D tensor default options", // default options: {alpha: 1, beta: 0} "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/log.json b/tests/wpt/tests/webnn/resources/test_data/log.json index c48406e7075..0481061272d 100644 --- a/tests/wpt/tests/webnn/resources/test_data/log.json +++ b/tests/wpt/tests/webnn/resources/test_data/log.json @@ -1,5 +1,72 @@ { "tests": [ + { + "name": "log float32 positive 1D constant tensor", + "inputs": { + "x": { + "shape": [24], + "data":[ + 63.82541897073002, + 25.31772341801677, + 96.44790987312221, + 40.9185632583299, + 36.57906966041302, + 57.81629837118902, + 10.057244454482062, + 17.836828533595984, + 50.79246415149721, + 83.86059370830392, + 12.065509440949572, + 22.702478725761654, + 47.55981402665108, + 17.543881349985526, + 32.65243800095941, + 20.35301082726726, + 52.54472350026202, + 45.60880392588138, + 30.38581309524917, + 13.70955827062823, + 10.39676015729949, + 50.840946828645464, + 5.682034333775321, + 94.02275663421658 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + 4.15615177154541, + 3.2315046787261963, + 4.569003105163574, + 3.7115838527679443, + 3.5994763374328613, + 4.057270526885986, + 2.308293104171753, + 2.88126540184021, + 3.927747964859009, + 4.4291558265686035, + 2.4903509616851807, + 3.122474193572998, + 3.861988067626953, + 2.8647050857543945, + 3.48591947555542, + 3.0132288932800293, + 3.9616646766662598, + 3.820100784301758, + 3.413975715637207, + 2.618093252182007, + 2.34149432182312, + 3.9287021160125732, + 1.7373093366622925, + 4.54353666305542 + ], + "type": "float32" + } + }, { "name": "log float32 positive 1D tensor", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/logical_not.json b/tests/wpt/tests/webnn/resources/test_data/logical_not.json index 5cb3208c786..3a37652a134 100644 --- a/tests/wpt/tests/webnn/resources/test_data/logical_not.json +++ b/tests/wpt/tests/webnn/resources/test_data/logical_not.json @@ -20,6 +20,73 @@ "type": "uint8" } }, + { + "name": "logicalNot uint8 1D constant tensor", + "inputs": { + "x": { + "shape": [24], + "data": [ + 204, + 130, + 90, + 0, + 147, + 42, + 10, + 18, + 13, + 235, + 0, + 233, + 53, + 83, + 9, + 254, + 69, + 56, + 219, + 109, + 171, + 0, + 228, + 135 + ], + "type": "uint8", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0 + ], + "type": "uint8" + } + }, { "name": "logicalNot uint8 1D tensor", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/matmul.json b/tests/wpt/tests/webnn/resources/test_data/matmul.json index 6e0423a68d3..2477b78add4 100644 --- a/tests/wpt/tests/webnn/resources/test_data/matmul.json +++ b/tests/wpt/tests/webnn/resources/test_data/matmul.json @@ -1,5 +1,37 @@ { "tests": [ + { + "name": "matmul float32 constant 1D and 1D tensors all positive produces a scalar", + "inputs": { + "a": { + "shape": [4], + "data": [ + 50.10142534731317, + 22.2193058046253, + 34.65448469299386, + 36.35148095671881 + ], + "type": "float32", + "constant": true + }, + "b": { + "shape": [4], + "data": [ + 27.829805134194842, + 83.14548502311283, + 34.4128942110155, + 83.20379675185079 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "data": 7458.89013671875, + "type": "float32" + } + }, { "name": "matmul float32 1D and 1D tensors all positive produces a scalar", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/max.json b/tests/wpt/tests/webnn/resources/test_data/max.json index 27a258248fc..26285042d04 100644 --- a/tests/wpt/tests/webnn/resources/test_data/max.json +++ b/tests/wpt/tests/webnn/resources/test_data/max.json @@ -1,5 +1,103 @@ { "tests": [ + { + "name": "max float32 1D constant tensors", + "inputs": { + "a": { + "shape": [24], + "data": [ + 17.729091355190548, + 88.14807331138127, + -12.79482748560001, + 11.817361453415515, + 19.513022179766494, + -62.87843656259127, + 50.77191512294212, + -56.91352259821851, + 50.572543533605796, + -96.00484496901664, + 50.21433885008736, + 20.59501102482639, + -60.69954854047626, + -96.84203452345174, + 57.258868129331574, + -56.29146148481858, + 73.7165958518618, + 21.347652653042374, + 79.85667318536576, + -22.91845979108436, + 1.2300019204149066, + 65.67965067534072, + 99.89971317042682, + -62.321684141101045 + ], + "type": "float32", + "constant": true + }, + "b": { + "shape": [24], + "data": [ + -34.504351374665106, + 85.7347144113418, + 25.81801706847253, + -91.37040900746763, + 87.01370408789617, + 0.17744044937266779, + 74.88266681438157, + -4.169913633773888, + -73.76497938350255, + 55.38879910920386, + -58.69169647961585, + -67.62333258102981, + -89.83530842960631, + -8.275739745367574, + 97.5957755490123, + -48.96886862489005, + 95.34497928951401, + -97.36359789785926, + -59.90717913787087, + 97.15334887926792, + -40.226924090258805, + -61.51427015643396, + 33.36324314194775, + 12.693191672027254 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + 17.72909164428711, + 88.1480712890625, + 25.818017959594727, + 11.817361831665039, + 87.01370239257812, + 0.17744044959545135, + 74.8826675415039, + -4.1699137687683105, + 50.57254409790039, + 55.388797760009766, + 50.21434020996094, + 20.59501075744629, + -60.699546813964844, + -8.275739669799805, + 97.59577178955078, + -48.968868255615234, + 95.34497833251953, + 21.347652435302734, + 79.85667419433594, + 97.15335083007812, + 1.2300019264221191, + 65.67964935302734, + 99.89971160888672, + 12.693191528320312 + ], + "type": "float32" + } + }, { "name": "max float32 1D tensors", "inputs": { @@ -65,7 +163,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [24], "data": [ 17.72909164428711, @@ -161,7 +259,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [4, 6], "data": [ 17.72909164428711, @@ -257,7 +355,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 3, 4], "data": [ 17.72909164428711, @@ -353,7 +451,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 2, 2, 3], "data": [ 17.72909164428711, @@ -449,7 +547,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 2, 1, 2, 3], "data": [ 17.72909164428711, @@ -522,7 +620,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 2, 2, 3], "data": [ 48.26115417480469, @@ -600,7 +698,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 2, 2, 3], "data": [ 49.523128509521484, @@ -676,7 +774,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 2, 2, 3], "data": [ 39.32178497314453, @@ -749,7 +847,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 2, 2, 3], "data": [ 48.26115417480469, diff --git a/tests/wpt/tests/webnn/resources/test_data/max_pool2d.json b/tests/wpt/tests/webnn/resources/test_data/max_pool2d.json index cf426620e56..4532843d2b5 100644 --- a/tests/wpt/tests/webnn/resources/test_data/max_pool2d.json +++ b/tests/wpt/tests/webnn/resources/test_data/max_pool2d.json @@ -1,5 +1,76 @@ { "tests": [ + { + "name": "maxPool2d float32 4D constant tensor default options", + "inputs": { + "input": { + "shape": [1, 2, 5, 5], + "data": [ + 89.00830216793153, + -45.720390400208274, + -61.3061304134967, + -4.014514560596496, + -94.54893342858352, + 46.28090328619564, + 99.28312923953135, + -10.057873368956962, + 9.742474583994337, + -39.03501766575275, + 75.08192382950091, + 12.819415189421207, + -33.01505690327188, + 38.691340789603316, + 66.09259104681504, + 97.903480409299, + -8.737769993284147, + -53.4216238072017, + 72.10852084777076, + -40.42309116918719, + -35.68864442661396, + -87.64779401381033, + 38.87424286093716, + 39.38360329656629, + 7.429088108317444, + -76.72171237621149, + 50.21706410294061, + -52.89547724835329, + -44.64233565670091, + -97.86752535352848, + 81.73119248706783, + 5.428491238061412, + -29.227728678237995, + 72.44899280781078, + -59.34124718116585, + 39.19959912145927, + -65.99438957588619, + -4.204323589500888, + -60.5458643662661, + 55.89052583821697, + 80.30483906634527, + 72.88830243502153, + -46.59610987974246, + 20.503878887964206, + -31.126462826158445, + -57.29456052682171, + -26.62357805164706, + 15.93575469730375, + -78.77953474824318, + 72.33577555559427 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [1, 2, 1, 1], + "data": [ + 99.28312683105469, + 81.73119354248047 + ], + "type": "float32" + } + }, { "name": "maxPool2d float32 4D tensor default options", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/min.json b/tests/wpt/tests/webnn/resources/test_data/min.json index f5ea4779f40..a08e6514286 100644 --- a/tests/wpt/tests/webnn/resources/test_data/min.json +++ b/tests/wpt/tests/webnn/resources/test_data/min.json @@ -1,5 +1,103 @@ { "tests": [ + { + "name": "min float32 1D constant tensors", + "inputs": { + "a": { + "shape": [24], + "data": [ + -36.069532266228244, + -38.22545078196744, + 62.07444236586957, + -16.61026674714678, + 65.99324808387394, + -17.772129967582686, + -76.01381209267042, + -69.59134776850009, + 53.60376804727625, + -39.096100673437164, + 96.94400927938446, + -40.391302324618295, + 74.14437371697878, + 0.032831973556398, + 38.79835449778915, + -17.720786393721696, + 17.383201301159886, + -82.30993955305293, + -80.47379030810471, + -31.38984799993598, + -73.27236113112741, + -33.7456195461658, + -21.701524895337613, + 4.945605121041879 + ], + "type": "float32", + "constant": true + }, + "b": { + "shape": [24], + "data": [ + -40.10139268078632, + 86.25190598846055, + 51.28017397936523, + -57.64906164772099, + -97.56107437073234, + -28.88173031289574, + 80.49570909929332, + 46.665406947365625, + 62.8068578280876, + 49.815340723067976, + -76.5204323768335, + 84.59909684299188, + 50.472812621661944, + -18.017285676776623, + 5.198459215825707, + -47.82608331903404, + 46.4500784043023, + -71.25122869019421, + -69.8506659654443, + 40.676491548922655, + -18.700123336900987, + 20.14988118692149, + 41.950685196569594, + 23.482911517986963 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + -40.10139083862305, + -38.2254524230957, + 51.280174255371094, + -57.64906311035156, + -97.56107330322266, + -28.881731033325195, + -76.01380920410156, + -69.59134674072266, + 53.60376739501953, + -39.096099853515625, + -76.52043151855469, + -40.39130401611328, + 50.47281265258789, + -18.01728630065918, + 5.198459148406982, + -47.82608413696289, + 17.383201599121094, + -82.3099365234375, + -80.47379302978516, + -31.389848709106445, + -73.2723617553711, + -33.74562072753906, + -21.70152473449707, + 4.945605278015137 + ], + "type": "float32" + } + }, { "name": "min float32 1D tensors", "inputs": { @@ -65,7 +163,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [24], "data": [ -40.10139083862305, @@ -161,7 +259,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [4, 6], "data": [ -40.10139083862305, @@ -257,7 +355,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 3, 4], "data": [ -40.10139083862305, @@ -353,7 +451,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 2, 2, 3], "data": [ -40.10139083862305, @@ -449,7 +547,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 2, 1, 2, 3], "data": [ -40.10139083862305, @@ -522,7 +620,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 2, 2, 3], "data": [ -36.06953048706055, @@ -600,7 +698,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 2, 2, 3], "data": [ -36.06953048706055, @@ -676,7 +774,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 2, 2, 3], "data": [ -36.06953048706055, @@ -749,7 +847,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 2, 2, 3], "data": [ -36.06953048706055, diff --git a/tests/wpt/tests/webnn/resources/test_data/mul.json b/tests/wpt/tests/webnn/resources/test_data/mul.json index e6487cfc591..3de90184273 100644 --- a/tests/wpt/tests/webnn/resources/test_data/mul.json +++ b/tests/wpt/tests/webnn/resources/test_data/mul.json @@ -1,5 +1,103 @@ { "tests": [ + { + "name": "mul float32 1D constant tensors", + "inputs": { + "a": { + "shape": [24], + "data": [ + 49.11121736270019, + 11.907459336794048, + -21.11579579294029, + 70.74900132517587, + -94.51628388361728, + -93.78905645837338, + 11.178888261493995, + -32.80592265135466, + 83.31897732883382, + 91.12072661737204, + -0.11235756222869497, + 15.397956296694915, + -13.45921729974026, + -50.62647440827837, + -31.176256208308388, + -6.616114020780813, + 21.727578749239072, + 22.03150842852844, + -84.02170952786258, + -94.06756015115154, + 58.807274013013654, + -63.0597856263404, + 3.3092826784791214, + 9.88400353323415 + ], + "type": "float32", + "constant": true + }, + "b": { + "shape": [24], + "data": [ + 74.96137241031886, + -34.53953260336324, + -33.316162844150114, + 53.92023954353448, + -83.69075015721262, + 19.78522024290173, + 36.2811360289287, + -34.31147605027482, + 49.10429164239241, + -54.538850393716665, + 70.77384875070422, + -55.18768187759977, + -93.96233815307488, + 60.0829826673602, + -92.73415188611666, + 87.60998747867865, + -8.881865647983787, + 71.79511481665139, + -26.158620254037416, + -18.935444705499236, + 34.64671570053736, + -60.95826678087097, + -11.11965362061676, + 77.50324337143496 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + 3681.4443359375, + -411.278076171875, + 703.4972534179688, + 3814.802978515625, + 7910.138671875, + -1855.63720703125, + 405.582763671875, + 1125.6197509765625, + 4091.3193359375, + -4969.61962890625, + -7.951977252960205, + -849.7775268554688, + 1264.6595458984375, + -3041.78955078125, + 2891.103759765625, + -579.6376342773438, + -192.98143005371094, + 1581.7545166015625, + 2197.89208984375, + 1781.2109375, + 2037.47900390625, + 3844.01513671875, + -36.79807662963867, + 766.0423583984375 + ], + "type": "float32" + } + }, { "name": "mul float32 1D tensors", "inputs": { @@ -65,7 +163,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [24], "data": [ 3681.4443359375, @@ -161,7 +259,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [4, 6], "data": [ 3681.4443359375, @@ -257,7 +355,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 3, 4], "data": [ 3681.4443359375, @@ -353,7 +451,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 2, 2, 3], "data": [ 3681.4443359375, @@ -449,7 +547,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 2, 1, 2, 3], "data": [ 3681.4443359375, @@ -522,7 +620,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 2, 2, 3], "data": [ 3315.18994140625, @@ -600,7 +698,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 2, 2, 3], "data": [ -4778.197265625, @@ -676,7 +774,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 2, 2, 3], "data": [ 427.1091003417969, @@ -749,7 +847,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 2, 2, 3], "data": [ 3315.18994140625, diff --git a/tests/wpt/tests/webnn/resources/test_data/neg.json b/tests/wpt/tests/webnn/resources/test_data/neg.json index 8a1eea34f95..34dee53df16 100644 --- a/tests/wpt/tests/webnn/resources/test_data/neg.json +++ b/tests/wpt/tests/webnn/resources/test_data/neg.json @@ -1,5 +1,72 @@ { "tests": [ + { + "name": "neg float32 1D constant tensor", + "inputs": { + "x": { + "shape": [24], + "data": [ + -58.334503020192145, + 94.230451435346, + -67.69306915096101, + -36.06663941646238, + 17.11511438752673, + 59.26063208864457, + -43.77507923449166, + -14.875581781743236, + 22.508566808333796, + 98.67680207393127, + 2.3155421451545237, + -89.86896422605746, + -14.288547289891255, + 16.222452140079383, + -4.68841786135998, + -44.46965063391528, + -52.13925804400618, + 24.165389381806392, + -66.45778331338028, + -11.172323888318175, + -25.024961990153656, + 22.26478329228287, + 35.29130058751991, + -86.18817022134313 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + 58.334503173828125, + -94.23045349121094, + 67.69306945800781, + 36.0666389465332, + -17.115114212036133, + -59.2606315612793, + 43.77507781982422, + 14.875581741333008, + -22.50856590270996, + -98.67680358886719, + -2.315542221069336, + 89.86896514892578, + 14.28854751586914, + -16.22245216369629, + 4.688417911529541, + 44.46965026855469, + 52.139259338378906, + -24.165390014648438, + 66.4577865600586, + 11.172324180603027, + 25.024961471557617, + -22.26478385925293, + -35.29130172729492, + 86.18817138671875 + ], + "type": "float32" + } + }, { "name": "neg float32 1D tensor", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/pad.json b/tests/wpt/tests/webnn/resources/test_data/pad.json index ac4834d7f09..53e8ed8f597 100644 --- a/tests/wpt/tests/webnn/resources/test_data/pad.json +++ b/tests/wpt/tests/webnn/resources/test_data/pad.json @@ -1,5 +1,45 @@ { "tests": [ + { + "name": "pad float32 1D constant tensor default options", + "inputs": { + "input": { + "shape": [9], + "data": [ + 22.763617617214834, + -21.16852940391331, + -91.66169283838785, + 16.863798710594182, + 60.51471999839896, + -70.56754852642953, + -60.64327110324324, + -47.88219132680065, + 68.7255776612235 + ], + "type": "float32", + "constant": true + } + }, + "beginningPadding": [1], + "endingPadding": [1], + "expected": { + "shape": [11], + "data": [ + 0, + 22.76361846923828, + -21.168529510498047, + -91.66168975830078, + 16.863798141479492, + 60.51472091674805, + -70.56755065917969, + -60.643272399902344, + -47.8821907043457, + 68.72557830810547, + 0 + ], + "type": "float32" + } + }, { "name": "pad float32 1D tensor default options", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/pow.json b/tests/wpt/tests/webnn/resources/test_data/pow.json index a097c21d9ef..1738722b10b 100644 --- a/tests/wpt/tests/webnn/resources/test_data/pow.json +++ b/tests/wpt/tests/webnn/resources/test_data/pow.json @@ -1,5 +1,103 @@ { "tests": [ + { + "name": "pow float32 constant 1D base tensor and 1D integer exponent tensor", + "inputs": { + "a": { + "shape": [24], + "data": [ + 17.84601042972939, + -0.06310698009783522, + -9.868203150557209, + 11.177720889025082, + -17.346274412274497, + 11.862249907078805, + -16.832276297112916, + 2.657481705284937, + -2.783346559701183, + -13.756399883988184, + 13.131383020668672, + -0.4376337155223524, + -15.678688537967744, + 10.283306376871472, + 14.89317426754188, + -4.941208383494091, + -14.231812435141862, + 3.2646027287637835, + 17.229148713687444, + -2.885918185998449, + -1.440015043233842, + -5.757015935913907, + 17.41126899618849, + 17.415215284302022 + ], + "type": "float32", + "constant": true + }, + "b": { + "shape": [24], + "data": [ + 1, + 6, + -7, + 7, + -2, + 1, + 4, + -10, + -2, + -5, + -2, + -10, + -8, + -7, + -1, + -3, + -9, + 6, + -6, + 7, + -5, + -5, + 7, + -6 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + 17.846010208129883, + 6.316321332633379e-8, + -1.0973203501407625e-7, + 21800822, + 0.0033234376460313797, + 11.862250328063965, + 80273.3359375, + 0.00005692423656000756, + 0.12908191978931427, + -0.0000020299064544815337, + 0.005799346603453159, + 3880.540283203125, + 2.7385585465999895e-10, + 8.223764069725803e-8, + 0.06714485585689545, + -0.008288968354463577, + -4.1750155416186985e-11, + 1210.5478515625, + 3.8231124932508465e-8, + -1667.201416015625, + -0.16149713099002838, + -0.00015812950732652098, + 485079424, + 3.584487018315485e-8 + ], + "type": "float32" + } + }, { "name": "pow float32 1D base tensor and 1D integer exponent tensor", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/prelu.json b/tests/wpt/tests/webnn/resources/test_data/prelu.json index e45e12cd4b6..cf79bee7a9d 100644 --- a/tests/wpt/tests/webnn/resources/test_data/prelu.json +++ b/tests/wpt/tests/webnn/resources/test_data/prelu.json @@ -1,5 +1,103 @@ { "tests": [ + { + "name": "prelu float32 1D constant tensors", + "inputs": { + "x": { + "shape": [24], + "data": [ + -2.5491681672317235, + -4.794857500523286, + 8.413617520687886, + 6.108623511441287, + -8.492292847462334, + 3.3143364551069876, + 1.1687212422078108, + -0.1417628422981423, + -6.714651930677875, + 5.787421746282195, + -3.7556274239369847, + -4.898286418001732, + 7.329515995865023, + -3.9542297833176665, + 7.067297201348715, + 9.439736453375971, + -2.5581801134299775, + -8.658834185932482, + 8.475073893236225, + 4.551425642121982, + -9.267870491380243, + -0.26217744010265776, + 1.325895534951659, + -7.418311114031475 + ], + "type": "float32", + "constant": true + }, + "slope": { + "shape": [24], + "data": [ + 9.343093097130314, + 0.2800687126385206, + -4.617085001507579, + 1.1202747481570352, + -1.4334710772165593, + -3.157594908065091, + -6.289953987035659, + -5.010787777546328, + -6.899077379471157, + 3.572534824190212, + 6.861966530502535, + -1.9615313732548287, + 4.583203900668886, + 2.664350255679274, + 9.19295531798543, + -9.554700087649, + -5.505102187715796, + -2.3927369956553557, + 3.5821293765315954, + -2.32240037283157, + -1.9816573593209075, + 4.155890213640276, + -1.7995220850663962, + 9.29585020267449 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + -23.817113876342773, + -1.342889666557312, + 8.413617134094238, + 6.108623504638672, + 12.173455238342285, + 3.3143365383148193, + 1.1687211990356445, + 0.7103435397148132, + 46.32490539550781, + 5.787421703338623, + -25.7709903717041, + 9.608142852783203, + 7.3295159339904785, + -10.535453796386719, + 7.067296981811523, + 9.439736366271973, + 14.083043098449707, + 20.718313217163086, + 8.47507381439209, + 4.551425457000732, + 18.365745544433594, + -1.0895805358886719, + 1.3258955478668213, + -68.95950317382812 + ], + "type": "float32" + } + }, { "name": "prelu float32 1D tensors", "inputs": { @@ -66,7 +164,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [24], "data": [ -23.817113876342773, @@ -163,7 +261,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [4, 6], "data": [ -23.817113876342773, @@ -260,7 +358,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 3, 4], "data": [ -23.817113876342773, @@ -357,7 +455,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 2, 2, 3], "data": [ -23.817113876342773, @@ -454,7 +552,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 2, 1, 2, 3], "data": [ -23.817113876342773, @@ -530,7 +628,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 2, 2, 3], "data": [ -12.934283256530762, @@ -604,7 +702,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 2, 2, 3], "data": [ -12.775040626525879, @@ -683,7 +781,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 2, 2, 3], "data": [ -12.425349235534668, @@ -759,7 +857,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 2, 2, 3], "data": [ -12.934283256530762, @@ -833,7 +931,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 2, 2, 3], "data": [ -12.775040626525879, diff --git a/tests/wpt/tests/webnn/resources/test_data/reciprocal.json b/tests/wpt/tests/webnn/resources/test_data/reciprocal.json index dce56e5f57d..c71ac280050 100644 --- a/tests/wpt/tests/webnn/resources/test_data/reciprocal.json +++ b/tests/wpt/tests/webnn/resources/test_data/reciprocal.json @@ -20,6 +20,73 @@ "type": "float32" } }, + { + "name": "reciprocal float32 1D constant tensor", + "inputs": { + "x": { + "shape": [24], + "data": [ + -1.011086269320547, + 4.6215385203163315, + 2.4173768502126727, + -8.934871773645101, + -3.348558485147799, + -8.803302423903414, + 8.82632175955639, + 6.572828698368518, + 6.639494748363678, + 2.6842704650429496, + -4.627160556770815, + -6.873653395070409, + -1.185412145486616, + 0.9572811852263605, + 0.021320551999082227, + 0.35645850544829827, + 4.827780063442164, + 1.312808185701284, + 8.246278209083616, + -0.20391698798075097, + -9.039937028172055, + 9.94280947774324, + -9.540112102987099, + -0.08022661906399975 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + -0.9890353083610535, + 0.21637815237045288, + 0.4136715531349182, + -0.111921027302742, + -0.29863595962524414, + -0.11359372735023499, + 0.1132974773645401, + 0.1521414965391159, + 0.15061387419700623, + 0.3725407123565674, + -0.21611526608467102, + -0.14548304677009583, + -0.8435884118080139, + 1.044625163078308, + 46.90310287475586, + 2.805375576019287, + 0.20713452994823456, + 0.761725902557373, + 0.12126683443784714, + -4.903956413269043, + -0.11062023788690567, + 0.10057520121335983, + -0.10482056438922882, + -12.464690208435059 + ], + "type": "float32" + } + }, { "name": "reciprocal float32 1D tensor", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/reduce_l1.json b/tests/wpt/tests/webnn/resources/test_data/reduce_l1.json index aa169299c7c..7cbc4425118 100644 --- a/tests/wpt/tests/webnn/resources/test_data/reduce_l1.json +++ b/tests/wpt/tests/webnn/resources/test_data/reduce_l1.json @@ -1,5 +1,46 @@ { "tests": [ + { + "name": "reduceL1 float32 1D constant tensor all positive default options", // default options: {axes: null, keepDimensions: false} + "inputs": { + "input": { + "shape": [24], + "data": [ + 5.508826448139126, + 50.61575563515446, + 1.6773050539454992, + 84.21352292914005, + 15.664374631289203, + 52.89714899357876, + 9.12515782683123, + 28.93762412170997, + 12.567061064158146, + 11.399989904078245, + 86.91246376729916, + 64.51329469980782, + 71.28342153263038, + 76.34410635436484, + 41.53409150301335, + 97.56533284219819, + 31.803831597266385, + 6.0897547388209405, + 61.70843555684953, + 69.76119433406723, + 38.91940474525253, + 52.28833355637117, + 22.31783714884341, + 99.0719229634137 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "data": 1092.72021484375, + "type": "float32" + } + }, { "name": "reduceL1 float32 1D tensor all positive default options", // default options: {axes: null, keepDimensions: false} "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/reduce_l2.json b/tests/wpt/tests/webnn/resources/test_data/reduce_l2.json index 73397cbb7a8..7e59a45d5e2 100644 --- a/tests/wpt/tests/webnn/resources/test_data/reduce_l2.json +++ b/tests/wpt/tests/webnn/resources/test_data/reduce_l2.json @@ -1,5 +1,46 @@ { "tests": [ + { + "name": "reduceL2 float32 1D constant tensor all positive default options", // default options: {axes: null, keepDimensions: false} + "inputs": { + "input": { + "shape": [24], + "data": [ + 4.860227954324237, + 88.23184532015614, + 54.489688892595865, + 64.75027573238448, + 6.855991445231058, + 91.3987084155092, + 41.888577644260664, + 73.65445188651776, + 35.31573479319383, + 48.345430062443896, + 82.3919051922353, + 77.86200561022456, + 93.31141688733462, + 62.486883544675194, + 60.292898644959706, + 13.23059966965019, + 20.535988317971942, + 53.451616950541414, + 11.32008585820996, + 64.75763553379184, + 43.65894603418228, + 0.8374307376408652, + 0.6848266407317727, + 33.504704671527506 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "data": 272.0996398925781, + "type": "float32" + } + }, { "name": "reduceL2 float32 1D tensor all positive default options", // default options: {axes: null, keepDimensions: false} "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/reduce_log_sum.json b/tests/wpt/tests/webnn/resources/test_data/reduce_log_sum.json index 2e1fee804fd..250398d227e 100644 --- a/tests/wpt/tests/webnn/resources/test_data/reduce_log_sum.json +++ b/tests/wpt/tests/webnn/resources/test_data/reduce_log_sum.json @@ -1,5 +1,46 @@ { "tests": [ + { + "name": "reduceLogSum float32 1D constant tensor all non-negative default options", // default options: {axes: null, keepDimensions: false} + "inputs": { + "input": { + "shape": [24], + "data": [ + 64.54826901463852, + 97.87423374006126, + 26.529027351852186, + 79.79046651888517, + 50.394988743199434, + 14.578406888832252, + 20.86681803845336, + 32.43873432263156, + 64.91234005889837, + 71.54029915166349, + 11.13706890220647, + 55.07930697185586, + 43.791352286892106, + 13.831947671728972, + 97.39019470916091, + 35.50775651228035, + 52.275862097336166, + 82.838655037009, + 8.568099335705881, + 0.8337112078307563, + 69.23145833259072, + 3.8541642374881446, + 70.55673656397397, + 71.99264788951747 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "data": 7.039101600646973, + "type": "float32" + } + }, { "name": "reduceLogSum float32 1D tensor all non-negative default options", // default options: {axes: null, keepDimensions: false} "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/reduce_log_sum_exp.json b/tests/wpt/tests/webnn/resources/test_data/reduce_log_sum_exp.json index e5ebb2aba39..b7f39abd522 100644 --- a/tests/wpt/tests/webnn/resources/test_data/reduce_log_sum_exp.json +++ b/tests/wpt/tests/webnn/resources/test_data/reduce_log_sum_exp.json @@ -1,5 +1,46 @@ { "tests": [ + { + "name": "reduceLogSumExp float32 1D constant tensor all positive default options", // default options: {axes: null, keepDimensions: false} + "inputs": { + "input": { + "shape": [24], + "data": [ + 0.7974132976078829, + 5.046889970229296, + 8.520371090961714, + 1.4063042363728728, + 0.11882661415275164, + 0.285854490277071, + 1.9325640291685864, + 3.7939957856803797, + 2.6040233063490925, + 4.937509735746763, + 4.571482286709769, + 0.7865120436262685, + 0.21018670996660216, + 9.063042370844672, + 4.099809553408898, + 4.596248815627706, + 0.2549232349678032, + 1.1594801326588255, + 6.802876838759606, + 5.23432518570901, + 8.914905562420849, + 9.166799240859705, + 5.71750713886038, + 0.3255050658627967 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "data": 10.39477825164795, + "type": "float32" + } + }, { "name": "reduceLogSumExp float32 1D tensor all positive default options", // default options: {axes: null, keepDimensions: false} "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/reduce_max.json b/tests/wpt/tests/webnn/resources/test_data/reduce_max.json index 4dd7098d03f..967aea8bf4d 100644 --- a/tests/wpt/tests/webnn/resources/test_data/reduce_max.json +++ b/tests/wpt/tests/webnn/resources/test_data/reduce_max.json @@ -1,5 +1,46 @@ { "tests": [ + { + "name": "reduceMax float32 1D constant tensor default options", + "inputs": { + "input": { + "shape": [24], + "data": [ + 32.166585683408215, + 90.42288038051404, + -26.341795469529572, + -7.147959324354275, + 75.90379209491468, + -48.204211355965356, + -53.094252997077795, + 66.66099234322033, + -96.16854360851454, + -88.30545253131574, + 94.99645116994563, + 37.28493087456198, + -42.209860696518845, + 96.55397216250705, + 0.8807230095547567, + 62.504641219832195, + 36.650633791794576, + 99.77313292829271, + -72.86485546227293, + -46.03200926418318, + 20.253753500247612, + -21.55738542170144, + -51.287275192229046, + -42.588327517032454 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "data": 99.77313232421875, + "type": "float32" + } + }, { "name": "reduceMax float32 1D tensor default options", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/reduce_mean.json b/tests/wpt/tests/webnn/resources/test_data/reduce_mean.json index db20b17a835..5a48952c060 100644 --- a/tests/wpt/tests/webnn/resources/test_data/reduce_mean.json +++ b/tests/wpt/tests/webnn/resources/test_data/reduce_mean.json @@ -1,5 +1,46 @@ { "tests": [ + { + "name": "reduceMean float32 1D constant tensor all positive default options", + "inputs": { + "input": { + "shape": [24], + "data": [ + 95.84498772347054, + 75.69370054099012, + 1.5417720846181426, + 8.787033906673592, + 70.08280339173061, + 13.784331379836544, + 20.006068194857885, + 94.80963809344851, + 25.829190184293417, + 94.13260521032214, + 67.72958187044576, + 16.099351117563778, + 92.19433555001908, + 11.567352371276595, + 52.705496151946285, + 22.471793133903972, + 3.6623324286590764, + 20.2102781903039, + 58.56523137489753, + 28.673493080608758, + 42.134198143189195, + 21.637750690378144, + 14.160698325191756, + 15.127351396412191 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "data": 40.31047439575195, + "type": "float32" + } + }, { "name": "reduceMean float32 1D tensor all positive default options", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/reduce_min.json b/tests/wpt/tests/webnn/resources/test_data/reduce_min.json index db6c0e22695..92de75e92ab 100644 --- a/tests/wpt/tests/webnn/resources/test_data/reduce_min.json +++ b/tests/wpt/tests/webnn/resources/test_data/reduce_min.json @@ -1,5 +1,46 @@ { "tests": [ + { + "name": "reduceMin float32 1D constant tensor default options", + "inputs": { + "input": { + "shape": [24], + "data": [ + -58.76195671214997, + -87.962299829198, + -70.13690195964651, + -53.61766646981643, + -39.50931280469092, + 76.48815138549966, + -18.705087479309455, + 44.78261924634546, + 30.70233967738929, + 61.463613873181146, + 77.84043646028437, + -53.747413472322414, + -31.713543832764827, + -9.735438243016588, + 77.93652481771113, + 99.01705821629525, + 73.39929943432298, + 92.08459468237234, + -59.40851905900759, + -84.40769111096932, + 75.88834177123843, + 96.02651672898816, + -55.976554418350545, + -1.791101785391234 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "data": -87.9623031616211, + "type": "float32" + } + }, { "name": "reduceMin float32 1D tensor default options", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/reduce_product.json b/tests/wpt/tests/webnn/resources/test_data/reduce_product.json index 60484300bca..691bf4da9b3 100644 --- a/tests/wpt/tests/webnn/resources/test_data/reduce_product.json +++ b/tests/wpt/tests/webnn/resources/test_data/reduce_product.json @@ -1,5 +1,46 @@ { "tests": [ + { + "name": "reduceProduct float32 1D constant tensor default options", + "inputs": { + "input": { + "shape": [24], + "data": [ + -68.75911760233478, + 99.4496130391401, + 24.860555622046746, + -44.23515424391753, + -22.69974404385384, + 79.97555172142995, + 14.46502415218545, + 49.231095225588376, + 30.058706923717068, + 69.45106401985521, + -20.15709647137976, + -58.02551401530734, + 51.89660954258355, + -2.020799112914105, + 39.392973241316554, + 26.780734701055266, + -97.97651593223856, + 48.66154478867011, + -85.19523905815305, + -18.169861657911653, + 64.83759066937682, + -14.958838503675935, + -74.50931980014732, + -11.319679210869765 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "data": 1.5855958784642327e+37, + "type": "float32" + } + }, { "name": "reduceProduct float32 1D tensor default options", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/reduce_sum.json b/tests/wpt/tests/webnn/resources/test_data/reduce_sum.json index 6da78ae804a..df47a1a2b26 100644 --- a/tests/wpt/tests/webnn/resources/test_data/reduce_sum.json +++ b/tests/wpt/tests/webnn/resources/test_data/reduce_sum.json @@ -1,5 +1,46 @@ { "tests": [ + { + "name": "reduceSum float32 1D constant tensor all positive default options", + "inputs": { + "input": { + "shape": [24], + "data": [ + 69.6038605453285, + 99.1748548274599, + 32.782341359545676, + 8.881362932730319, + 16.094296257493014, + 11.806894918510213, + 32.64223805640243, + 43.998363476438975, + 77.01777099153088, + 79.79425759062173, + 45.007949804090174, + 24.39779644056914, + 57.50268541631618, + 57.60172895173401, + 80.26985885745457, + 43.65110628848945, + 87.50368667545843, + 94.50203768533922, + 35.54289690580114, + 42.856416416096344, + 88.58631651618441, + 98.85772999308332, + 25.62685451963782, + 60.17613590317996 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "data": 1313.87939453125, + "type": "float32" + } + }, { "name": "reduceSum float32 1D tensor all positive default options", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/reduce_sum_square.json b/tests/wpt/tests/webnn/resources/test_data/reduce_sum_square.json index cf6bbb65d41..8ac373e4b36 100644 --- a/tests/wpt/tests/webnn/resources/test_data/reduce_sum_square.json +++ b/tests/wpt/tests/webnn/resources/test_data/reduce_sum_square.json @@ -1,5 +1,46 @@ { "tests": [ + { + "name": "reduceSumSquare float32 1D constant tensor all positive default options", // default options: {axes: null, keepDimensions: false} + "inputs": { + "input": { + "shape": [24], + "data": [ + 52.5615351837915, + 2.6261063680439234, + 82.04877759500097, + 14.401411284784604, + 33.96051675758925, + 83.93837980977771, + 47.44504659398938, + 19.177289239472593, + 13.493006439137023, + 44.15238362662202, + 86.53118079678906, + 70.20919468463771, + 25.67262870756528, + 79.73770192548034, + 66.42284577584445, + 70.40363336301188, + 13.503327808732468, + 41.22539754662389, + 6.654552839238637, + 85.79743668166222, + 89.91348950671976, + 53.55647451130674, + 39.48537158474081, + 3.9460408540454184 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "data": 73275.859375, + "type": "float32" + } + }, { "name": "reduceSumSquare float32 1D tensor all positive default options", // default options: {axes: null, keepDimensions: false} "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/relu.json b/tests/wpt/tests/webnn/resources/test_data/relu.json index b4597891472..248902c6658 100644 --- a/tests/wpt/tests/webnn/resources/test_data/relu.json +++ b/tests/wpt/tests/webnn/resources/test_data/relu.json @@ -1,5 +1,72 @@ { "tests": [ // relu input tensor of 1D to 5D with same data values + { + "name": "relu float32 1D constant tensor", + "inputs": { + "x": { + "shape": [24], + "data": [ + 79.04725231657116, + 2.2503608756501166, + 80.73939090529203, + 63.90392076789547, + 77.67340745512104, + -71.09157819044825, + -82.74703468427575, + -26.814426600801028, + -99.16788836397058, + -35.71083406288831, + 18.36165830990626, + -37.36091648205435, + -52.8386119809162, + -10.408374773008958, + 60.60291560236189, + -13.644198913810342, + -76.54250291031946, + -8.132338049258351, + 51.51447452437017, + -51.63370281825297, + -64.567999424324, + -5.093302411117136, + 15.354103550744384, + 90.03858807393516 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + 79.04724884033203, + 2.2503609657287598, + 80.73938751220703, + 63.9039192199707, + 77.67340850830078, + 0, + 0, + 0, + 0, + 0, + 18.361658096313477, + 0, + 0, + 0, + 60.6029167175293, + 0, + 0, + 0, + 51.51447296142578, + 0, + 0, + 0, + 15.354103088378906, + 90.03858947753906 + ], + "type": "float32" + } + }, { "name": "relu float32 1D tensor", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/reshape.json b/tests/wpt/tests/webnn/resources/test_data/reshape.json index fbb93a8e03c..ada3daa4e2d 100644 --- a/tests/wpt/tests/webnn/resources/test_data/reshape.json +++ b/tests/wpt/tests/webnn/resources/test_data/reshape.json @@ -6,30 +6,30 @@ "input": { "shape": [2, 3, 4], "data": [ - -30.056147250771076, - 99.5694232746736, - 88.04620115823073, - -91.87507576772606, - -23.797235323955633, - -91.28665022600151, - -63.15204449663816, - 12.066952464893262, - -96.1172904235943, - -44.77365489782947, - -80.08650883940432, - -64.4375694650447, - 27.641954235862485, - -96.86306613475395, - 83.68347403572196, - 50.599484132010815, - -20.187656772788642, - -1.3904608012750117, - -96.9360325497362, - 65.34144119048645, - 34.835993949837274, - 62.01485845563673, - -2.8698414892852355, - 27.903749097190158 + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 ], "type": "float32" } @@ -73,30 +73,30 @@ "input": { "shape": [4, 1, 1, 1, 6], "data": [ - -30.056147250771076, - 99.5694232746736, - 88.04620115823073, - -91.87507576772606, - -23.797235323955633, - -91.28665022600151, - -63.15204449663816, - 12.066952464893262, - -96.1172904235943, - -44.77365489782947, - -80.08650883940432, - -64.4375694650447, - 27.641954235862485, - -96.86306613475395, - 83.68347403572196, - 50.599484132010815, - -20.187656772788642, - -1.3904608012750117, - -96.9360325497362, - 65.34144119048645, - 34.835993949837274, - 62.01485845563673, - -2.8698414892852355, - 27.903749097190158 + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 ], "type": "float32" } @@ -140,30 +140,30 @@ "input": { "shape": [2, 2, 2, 3], "data": [ - -30.056147250771076, - 99.5694232746736, - 88.04620115823073, - -91.87507576772606, - -23.797235323955633, - -91.28665022600151, - -63.15204449663816, - 12.066952464893262, - -96.1172904235943, - -44.77365489782947, - -80.08650883940432, - -64.4375694650447, - 27.641954235862485, - -96.86306613475395, - 83.68347403572196, - 50.599484132010815, - -20.187656772788642, - -1.3904608012750117, - -96.9360325497362, - 65.34144119048645, - 34.835993949837274, - 62.01485845563673, - -2.8698414892852355, - 27.903749097190158 + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 ], "type": "float32" } @@ -207,30 +207,30 @@ "input": { "shape": [3, 2, 2, 2], "data": [ - -30.056147250771076, - 99.5694232746736, - 88.04620115823073, - -91.87507576772606, - -23.797235323955633, - -91.28665022600151, - -63.15204449663816, - 12.066952464893262, - -96.1172904235943, - -44.77365489782947, - -80.08650883940432, - -64.4375694650447, - 27.641954235862485, - -96.86306613475395, - 83.68347403572196, - 50.599484132010815, - -20.187656772788642, - -1.3904608012750117, - -96.9360325497362, - 65.34144119048645, - 34.835993949837274, - 62.01485845563673, - -2.8698414892852355, - 27.903749097190158 + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 ], "type": "float32" } @@ -274,30 +274,30 @@ "input": { "shape": [3, 2, 2, 2], "data": [ - -30.056147250771076, - 99.5694232746736, - 88.04620115823073, - -91.87507576772606, - -23.797235323955633, - -91.28665022600151, - -63.15204449663816, - 12.066952464893262, - -96.1172904235943, - -44.77365489782947, - -80.08650883940432, - -64.4375694650447, - 27.641954235862485, - -96.86306613475395, - 83.68347403572196, - 50.599484132010815, - -20.187656772788642, - -1.3904608012750117, - -96.9360325497362, - 65.34144119048645, - 34.835993949837274, - 62.01485845563673, - -2.8698414892852355, - 27.903749097190158 + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 ], "type": "float32" } @@ -334,6 +334,1723 @@ ], "type": "float32" } + }, + { + "name": "reshape (squeeze) float32 2D tensor by eliminating one dimension", + "inputs": { + "input": { + "shape": [1, 24], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + "newShape": [24], + "expected": { + "name": "output", + "shape": [24], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + { + "name": "reshape (squeeze) float32 3D tensor by eliminating one dimension", + "inputs": { + "input": { + "shape": [4, 1, 6], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + "newShape": [4, 6], + "expected": { + "name": "output", + "shape": [4, 6], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + { + "name": "reshape (squeeze) float32 3D tensor by eliminating two dimensions", + "inputs": { + "input": { + "shape": [1, 24, 1], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + "newShape": [24], + "expected": { + "name": "output", + "shape": [24], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + { + "name": "reshape (squeeze) float32 4D tensor by eliminating two dimensions", + "inputs": { + "input": { + "shape": [1, 4, 1, 6], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + "newShape": [4, 6], + "expected": { + "name": "output", + "shape": [4, 6], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + { + "name": "reshape (squeeze) float32 4D tensor by eliminating all dimensions", + "inputs": { + "input": { + "shape": [1, 1, 1, 1], + "data": [ + -33.82555389404297 + ], + "type": "float32" + } + }, + "newShape": [], + "expected": { + "name": "output", + "shape": [], + "data": [ + -33.82555389404297 + ], + "type": "float32" + } + }, + { + "name": "reshape (squeeze) float32 5D tensor by eliminating four dimensions", + "inputs": { + "input": { + "shape": [1, 1, 1, 24, 1], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + "newShape": [24], + "expected": { + "name": "output", + "shape": [24], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + { + "name": "reshape (squeeze) float32 2D tensor by eliminating 1st dimension", + "inputs": { + "input": { + "shape": [1, 24], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + "newShape": [24], + "expected": { + "name": "output", + "shape": [24], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + { + "name": "reshape (squeeze) float32 3D tensor by eliminating 2nd and 3rd dimensions", + "inputs": { + "input": { + "shape": [24, 1, 1], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + "newShape": [24], + "expected": { + "name": "output", + "shape": [24], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + { + "name": "reshape (squeeze) float32 4D tensor by eliminating 1st and 4th dimensions", + "inputs": { + "input": { + "shape": [1, 4, 6, 1], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + "newShape": [4, 6], + "expected": { + "name": "output", + "shape": [4, 6], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + { + "name": "reshape (squeeze) float32 5D tensor by eliminating 2nd and 3rd dimensions", + "inputs": { + "input": { + "shape": [2, 1, 1, 12, 1], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + "newShape": [2, 12, 1], + "expected": { + "name": "output", + "shape": [2, 12, 1], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + { + "name": "reshape (squeeze) float32 5D tensor by eliminating 1st, 2nd and 5th dimensions", + "inputs": { + "input": { + "shape": [1, 1, 1, 24, 1], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + "newShape": [1, 24], + "expected": { + "name": "output", + "shape": [1, 24], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + { + "name": "reshape (unsqueeze) float32 0D tensor to 4D", + "inputs": { + "input": { + "shape": [], + "data": [ + -33.82555389404297 + ], + "type": "float32" + } + }, + "newShape": [1, 1, 1, 1], + "expected": { + "name": "output", + "shape": [1, 1, 1, 1], + "data": [ + -33.82555389404297 + ], + "type": "float32" + } + }, + { + "name": "reshape (unsqueeze) float32 1D tensor by adding one dimension", + "inputs": { + "input": { + "shape": [24], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + "newShape": [1, 24], + "expected": { + "name": "output", + "shape": [1, 24], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + { + "name": "reshape (unsqueeze) float32 1D tensor by adding two dimensions", + "inputs": { + "input": { + "shape": [24], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + "newShape": [1, 24, 1], + "expected": { + "name": "output", + "shape": [1, 24, 1], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + { + "name": "reshape (unsqueeze) float32 1D tensor to 5D", + "inputs": { + "input": { + "shape": [24], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + "newShape": [1, 1, 1, 24, 1], + "expected": { + "name": "output", + "shape": [1, 1, 1, 24, 1], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + { + "name": "reshape (unsqueeze) float32 1D tensor by adding 2nd and 3rd dimensions", + "inputs": { + "input": { + "shape": [24], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + "newShape": [24, 1, 1], + "expected": { + "name": "output", + "shape": [24, 1, 1], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + { + "name": "reshape (unsqueeze) float32 2D tensor by adding one dimension", + "inputs": { + "input": { + "shape": [4, 6], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + "newShape": [4, 1, 6], + "expected": { + "name": "output", + "shape": [4, 1, 6], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + { + "name": "reshape (unsqueeze) float32 2D tensor by adding two dimensions", + "inputs": { + "input": { + "shape": [4, 6], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + "newShape": [1, 4, 1, 6], + "expected": { + "name": "output", + "shape": [1, 4, 1, 6], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + { + "name": "reshape (unsqueeze) float32 2D tensor by adding 1st dimension", + "inputs": { + "input": { + "shape": [24], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + "newShape": [1, 24], + "expected": { + "name": "output", + "shape": [1, 24], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + { + "name": "reshape (unsqueeze) float32 2D tensor by adding 1st and 4th dimensions", + "inputs": { + "input": { + "shape": [4, 6], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + "newShape": [1, 4, 6, 1], + "expected": { + "name": "output", + "shape": [1, 4, 6, 1], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + { + "name": "reshape (unsqueeze) float32 3D tensor by adding 2nd and 3rd dimensions", + "inputs": { + "input": { + "shape": [2, 12, 1], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + "newShape": [2, 1, 1, 12, 1], + "expected": { + "name": "output", + "shape": [2, 1, 1, 12, 1], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + { + "name": "reshape (unsqueeze) float32 4D tensor by adding 2nd dimension", + "inputs": { + "input": { + "shape": [2, 2, 2, 3], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + "newShape": [2, 1, 2, 2, 3], + "expected": { + "name": "output", + "shape": [2, 1, 2, 2, 3], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + { + "name": "reshape (unsqueeze) float32 5D tensor by adding 4th dimension", + "inputs": { + "input": { + "shape": [2, 1, 4, 3, 1], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + "newShape": [2, 1, 4, 1, 3, 1], + "expected": { + "name": "output", + "shape": [2, 1, 4, 1, 3, 1], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + { + "name": "reshape (flatten) float32 3D tensor to 2D", + "inputs": { + "input": { + "shape": [2, 3, 4], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + "newShape": [2, 12], + "expected": { + "name": "output", + "shape": [2, 12], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + { + "name": "reshape (flatten) float32 4D to 2D", + "inputs": { + "input": { + "shape": [2, 2, 2, 3], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + "newShape": [4, 6], + "expected": { + "name": "output", + "shape": [4, 6], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + { + "name": "reshape (flatten) float32 4D to 2D exclusive 1st dimension", + "inputs": { + "input": { + "shape": [2, 2, 2, 3], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + "newShape": [1, 24], + "expected": { + "name": "output", + "shape": [1, 24], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + { + "name": "reshape (flatten) float32 4D to 2D exclusive 4th dimension", + "inputs": { + "input": { + "shape": [2, 2, 2, 3], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } + }, + "newShape": [24, 1], + "expected": { + "name": "output", + "shape": [24, 1], + "data": [ + -30.0561466217041, + 99.56941986083984, + 88.04620361328125, + -91.87507629394531, + -23.7972354888916, + -91.28665161132812, + -63.15204620361328, + 12.0669527053833, + -96.1172866821289, + -44.77365493774414, + -80.08650970458984, + -64.43756866455078, + 27.64195442199707, + -96.86306762695312, + 83.6834716796875, + 50.599483489990234, + -20.18765640258789, + -1.3904608488082886, + -96.93603515625, + 65.34143829345703, + 34.835994720458984, + 62.01485824584961, + -2.8698415756225586, + 27.903749465942383 + ], + "type": "float32" + } } ] } \ No newline at end of file diff --git a/tests/wpt/tests/webnn/resources/test_data/sigmoid.json b/tests/wpt/tests/webnn/resources/test_data/sigmoid.json index c2333363217..69756fbb9c2 100644 --- a/tests/wpt/tests/webnn/resources/test_data/sigmoid.json +++ b/tests/wpt/tests/webnn/resources/test_data/sigmoid.json @@ -1,5 +1,72 @@ { "tests": [ + { + "name": "sigmoid float32 1D constant tensor", + "inputs": { + "x": { + "shape": [24], + "data": [ + -0.3769951326450487, + -0.6848450678710742, + -5.98887201399973, + 4.431885748123033, + -0.9386848809986663, + 4.591195578857441, + -2.5067027776293456, + 1.5669522849917055, + -2.596473257404651, + -3.647293770068697, + 2.6785236795981433, + -3.105160168372808, + 2.258501824714781, + -0.2865157795154527, + 4.640436413897461, + 1.0606156163391969, + -3.536252613252593, + 0.44104409560934066, + 4.79146007344656, + 2.0745488579530846, + 0.8354471082395971, + -5.433595857448718, + -4.184835816765236, + -2.484982429169702 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + 0.4068518280982971, + 0.33518078923225403, + 0.0025002227630466223, + 0.9882476925849915, + 0.28116607666015625, + 0.9899610877037048, + 0.07538963109254837, + 0.8273487091064453, + 0.0693657398223877, + 0.02539960853755474, + 0.9357474446296692, + 0.04289489984512329, + 0.9053813815116882, + 0.42885708808898926, + 0.9904388189315796, + 0.7428081631660461, + 0.0282981526106596, + 0.6085078120231628, + 0.9917680025100708, + 0.8884047269821167, + 0.6975054740905762, + 0.004348373040556908, + 0.014996387995779514, + 0.07691769301891327 + ], + "type": "float32" + } + }, { "name": "sigmoid float32 1D tensor", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/sin.json b/tests/wpt/tests/webnn/resources/test_data/sin.json index 3cc4771a336..1fe76df45fb 100644 --- a/tests/wpt/tests/webnn/resources/test_data/sin.json +++ b/tests/wpt/tests/webnn/resources/test_data/sin.json @@ -1,5 +1,72 @@ { "tests": [ + { + "name": "sin float32 1D constant tensor", + "inputs": { + "x": { + "shape": [24], + "data": [ + 79.78058345331559, + 55.00573351892254, + -28.052533009972393, + -31.644301395318934, + 56.28375442556609, + -96.18512135074778, + -72.99826309079677, + -3.4241827262925852, + 84.02549499853444, + 5.030371842664394, + -9.512612392430725, + 9.540593026227612, + -25.267252298101056, + -20.831639431837345, + -32.024754770208745, + -55.69102662814118, + 15.92748126354438, + -57.8835344652012, + 31.0160642695962, + -94.88304659350737, + -84.58417183546084, + 44.848744233535655, + -19.000272686086987, + -48.03827737658466 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + -0.946033775806427, + -0.9996118545532227, + -0.21998752653598785, + -0.22639396786689758, + -0.2618238627910614, + -0.9335716366767883, + 0.6754903197288513, + 0.27884384989738464, + 0.7156150341033936, + -0.9498680830001831, + 0.08772148936986923, + -0.11555644869804382, + -0.13410548865795135, + -0.9166066646575928, + -0.5719056725502014, + 0.7563026547431946, + -0.21775959432125092, + -0.9722972512245178, + -0.38929200172424316, + -0.59339439868927, + -0.23656263947486877, + 0.7620325684547424, + -0.15014687180519104, + 0.7921885848045349 + ], + "type": "float32" + } + }, { "name": "sin float32 1D tensor", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/slice.json b/tests/wpt/tests/webnn/resources/test_data/slice.json index ed193dd6563..28cfd2c0e26 100644 --- a/tests/wpt/tests/webnn/resources/test_data/slice.json +++ b/tests/wpt/tests/webnn/resources/test_data/slice.json @@ -1,5 +1,62 @@ { "tests": [ + { + "name": "slice float32 1D constant tensor", + "inputs": { + "input": { + "shape": [24], + "data": [ + 28.846251144212147, + 97.9541470229301, + -68.15961736262523, + 14.978987588557175, + 90.23090084798065, + 76.59095547712559, + -24.556316258204532, + 79.58749302462488, + 65.21375982234204, + 57.43970862960305, + 74.41775256222849, + -4.513182026141791, + 0.5424534704526991, + 80.44634130202977, + 28.327650022124686, + 74.0261938866893, + -74.54558964005362, + -27.30604081001799, + -70.4277433212161, + 59.82631931755259, + -58.46095416849133, + 79.80571087632629, + -9.857854207596304, + 42.66519880465225 + ], + "type": "float32", + "constant": true + } + }, + "starts": [12], + "sizes": [12], + "expected": { + "name": "output", + "shape": [12], + "data": [ + 0.5424534678459167, + 80.44634246826172, + 28.32765007019043, + 74.02619171142578, + -74.54559326171875, + -27.306041717529297, + -70.42774200439453, + 59.82632064819336, + -58.46095275878906, + 79.80570983886719, + -9.857853889465332, + 42.665199279785156 + ], + "type": "float32" + } + }, { "name": "slice float32 1D tensor", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/softmax.json b/tests/wpt/tests/webnn/resources/test_data/softmax.json index 52ea57c7632..ebb12114fc6 100644 --- a/tests/wpt/tests/webnn/resources/test_data/softmax.json +++ b/tests/wpt/tests/webnn/resources/test_data/softmax.json @@ -1,5 +1,72 @@ { "tests": [ + { + "name": "softmax float32 2D constant tensor all positive", + "inputs": { + "x": { + "shape": [4, 6], + "data": [ + 7.903734730203054, + 6.358251623091922, + 4.833756774572475, + 9.579165187926348, + 0.21071856783621445, + 4.554958961778823, + 7.150174113718282, + 8.330297576341172, + 1.535985791562966, + 6.633619497318013, + 1.45393689965033, + 0.21341864769940821, + 5.257819475802503, + 8.1921378632378, + 8.161730206898543, + 2.8744343334015565, + 8.950733525100087, + 6.111632812590415, + 1.6371468489476149, + 0.2762612074523485, + 5.028227187056009, + 3.898326029997037, + 2.8967114227178836, + 6.8894703393234575 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [4, 6], + "data": [ + 0.15068615972995758, + 0.03212761878967285, + 0.006995180621743202, + 0.8048291206359863, + 0.00006871300138300285, + 0.005293202120810747, + 0.2057899534702301, + 0.6698001027107239, + 0.0007502624066546559, + 0.1227685883641243, + 0.0006911618984304368, + 0.00019990770670119673, + 0.012398251332342625, + 0.23319464921951294, + 0.22621041536331177, + 0.0011435872875154018, + 0.4979347288608551, + 0.029118351638317108, + 0.004253828432410955, + 0.001090824487619102, + 0.12633030116558075, + 0.040812913328409195, + 0.014990009367465973, + 0.8125221133232117 + ], + "type": "float32" + } + }, { "name": "softmax float32 2D tensor all positive", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/softplus.json b/tests/wpt/tests/webnn/resources/test_data/softplus.json index 2b26e1439e3..eb05b7b2811 100644 --- a/tests/wpt/tests/webnn/resources/test_data/softplus.json +++ b/tests/wpt/tests/webnn/resources/test_data/softplus.json @@ -1,5 +1,72 @@ { // softplus: The calculation follows the expression ln(1 + exp(steepness * x)) / steepness. "tests": [ + { + "name": "softplus float32 1D constant tensor default options", // default options: {steepness: 1} + "inputs": { + "x": { + "shape": [24], + "data": [ + 5.626614582460632, + 5.167487045486892, + 4.0146356193402655, + 9.48003299650489, + 9.989938045769978, + 7.0654412821434125, + 2.132681001794825, + 8.187151346059956, + 5.169976220175496, + 2.1044997879382077, + 3.523329401138895, + 4.136340646976668, + 1.7418719794295656, + 5.145224066290767, + 5.015515309165462, + 0.045903935074711466, + 2.9570898924917377, + 3.959244712098706, + 5.517926978255181, + 7.192322388417094, + 8.76492480390928, + 1.3734704039113388, + 8.930669016709397, + 8.660283210871246 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + 5.630208969116211, + 5.1731696128845215, + 4.032524108886719, + 9.480109214782715, + 9.989983558654785, + 7.0662946701049805, + 2.2446866035461426, + 8.187429428100586, + 5.175644874572754, + 2.219529390335083, + 3.552403688430786, + 4.152195453643799, + 1.903303623199463, + 5.151034355163574, + 5.022127628326416, + 0.7163625359535217, + 3.007754325866699, + 3.978142499923706, + 5.521933078765869, + 7.1930742263793945, + 8.765081405639648, + 1.5991919040679932, + 8.930801391601562, + 8.660456657409668 + ], + "type": "float32" + } + }, { "name": "softplus float32 1D tensor default options", // default options: {steepness: 1} "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/softsign.json b/tests/wpt/tests/webnn/resources/test_data/softsign.json index e3208b18ad4..290f6711d09 100644 --- a/tests/wpt/tests/webnn/resources/test_data/softsign.json +++ b/tests/wpt/tests/webnn/resources/test_data/softsign.json @@ -1,5 +1,72 @@ { // softsign: The calculation follows the expression x / (1 + |x|). "tests": [ + { + "name": "softsign positive float32 1D constant tensor", + "inputs": { + "x": { + "shape": [24], + "data": [ + 1.5834133593790956, + 4.0787189411490115, + 8.883356617490337, + 8.070860233252166, + 8.211773633019915, + 2.4554003891197818, + 0.653374178120758, + 7.866281154604682, + 3.1239552336192666, + 8.013792390668268, + 3.9409862749371283, + 1.8131727337833081, + 2.390676102273188, + 1.3359680092645565, + 9.416410839467265, + 0.44325690899325254, + 5.236662013213598, + 9.424242359034539, + 7.816190418459348, + 5.849185795081855, + 8.780370640491928, + 5.1205157788312246, + 7.1172223514005095, + 4.59910661262345 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + 0.6129152178764343, + 0.8030999898910522, + 0.8988198041915894, + 0.8897568583488464, + 0.8914432525634766, + 0.7105979323387146, + 0.3951762318611145, + 0.8872131109237671, + 0.7575143575668335, + 0.8890588879585266, + 0.7976112365722656, + 0.6445294618606567, + 0.7050735354423523, + 0.5719119310379028, + 0.9039976596832275, + 0.30712267756462097, + 0.8396578431129456, + 0.9040697813034058, + 0.8865723013877869, + 0.8539972305297852, + 0.8977543711662292, + 0.8366150856018066, + 0.8768051266670227, + 0.8214001059532166 + ], + "type": "float32" + } + }, { "name": "softsign positive float32 1D tensor", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/split.json b/tests/wpt/tests/webnn/resources/test_data/split.json index e4216003c02..6432044ea20 100644 --- a/tests/wpt/tests/webnn/resources/test_data/split.json +++ b/tests/wpt/tests/webnn/resources/test_data/split.json @@ -1,5 +1,89 @@ { "tests": [ + { + "name": "split float32 1D constant tensor number splits default options", + "inputs": { + "input": { + "shape": [24], + "data": [ + -64.52057192772567, + -84.60513454654502, + -67.9928282139549, + -23.446074622313745, + -85.64383132426956, + 46.877522730892906, + -68.11224159891194, + 75.99607609082298, + -61.05668616435924, + -90.92643605408041, + 53.916621140775476, + 84.16269171442175, + -95.57494716023527, + -52.40757884637803, + -29.007187148127983, + 71.65495730084652, + 50.663572707062656, + 21.364581604631596, + -27.127241457105228, + 65.1489516233315, + -30.406812651567833, + -6.818390152438795, + 46.67362179020569, + -21.12453802903387 + ], + "type": "float32", + "constant": true + } + }, + "splits": 3, + "expected": [ + { + "name": "output1", + "shape": [8], + "data": [ + -64.52056884765625, + -84.60513305664062, + -67.99282836914062, + -23.446075439453125, + -85.64382934570312, + 46.87752151489258, + -68.11224365234375, + 75.99607849121094 + ], + "type": "float32" + }, + { + "name": "output2", + "shape": [8], + "data": [ + -61.05668640136719, + -90.92643737792969, + 53.916622161865234, + 84.16268920898438, + -95.57494354248047, + -52.40757751464844, + -29.007186889648438, + 71.65496063232422 + ], + "type": "float32" + }, + { + "name": "output3", + "shape": [8], + "data": [ + 50.66357421875, + 21.364582061767578, + -27.127241134643555, + 65.1489486694336, + -30.40681266784668, + -6.818390369415283, + 46.673622131347656, + -21.12453842163086 + ], + "type": "float32" + } + ] + }, { "name": "split float32 1D tensor number splits default options", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/sqrt.json b/tests/wpt/tests/webnn/resources/test_data/sqrt.json index be9666590bd..fa59308d45b 100644 --- a/tests/wpt/tests/webnn/resources/test_data/sqrt.json +++ b/tests/wpt/tests/webnn/resources/test_data/sqrt.json @@ -20,6 +20,73 @@ "type": "float32" } }, + { + "name": "sqrt float32 1D constant tensor", + "inputs": { + "x": { + "shape": [24], + "data": [ + 7.256007082508322, + 7.786442153556337, + 1.3684587069592324, + 8.053416211473843, + 9.131288551146515, + 8.525780428509535, + 4.870553385406751, + 7.625959393700068, + 2.7050268401423483, + 8.709602770137977, + 3.2687935624375797, + 4.712883187439902, + 8.669182019771712, + 8.82960710328718, + 0.5529024533541915, + 7.95877117461449, + 4.096406313025051, + 7.919884221032476, + 4.424484759327438, + 0.09894099762703057, + 4.690024907987658, + 1.5277378145575349, + 5.929779749165696, + 6.06647154134714 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + 2.693697690963745, + 2.790419816970825, + 1.1698113679885864, + 2.8378541469573975, + 3.0218021869659424, + 2.919893980026245, + 2.20693302154541, + 2.7615139484405518, + 1.644696593284607, + 2.9512035846710205, + 1.8079805374145508, + 2.170917510986328, + 2.944347381591797, + 2.9714653491973877, + 0.7435740828514099, + 2.821129322052002, + 2.023958206176758, + 2.8142287731170654, + 2.1034460067749023, + 0.31454887986183167, + 2.165646553039551, + 1.2360169887542725, + 2.4351139068603516, + 2.4630208015441895 + ], + "type": "float32" + } + }, { "name": "sqrt float32 1D tensor", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/squeeze.json b/tests/wpt/tests/webnn/resources/test_data/squeeze.json deleted file mode 100644 index 88890fe8702..00000000000 --- a/tests/wpt/tests/webnn/resources/test_data/squeeze.json +++ /dev/null @@ -1,696 +0,0 @@ -{ - "tests": [ - { - "name": "squeeze float32 2D tensor by eliminating one dimension default options", - "inputs": { - "input": { - "shape": [1, 24], - "data": [ - 1.1293665986622017, - -93.29325783541842, - -19.999887095191227, - 41.119214363429876, - 92.69352298075461, - -41.51937878962313, - -56.75228730395734, - 11.148093991767155, - 5.57540042674151, - 15.709176425437747, - 62.550443705517665, - -5.299276370816216, - -18.61525168224469, - -66.94721623021692, - 94.97520289870027, - -21.94004801967297, - 30.047636856615554, - 13.805134987122344, - -45.08670702769, - 76.90356276507339, - 46.96974979938284, - -86.58127045567055, - 31.645846897982068, - -67.96637618240129 - ], - "type": "float32" - } - }, - "expected": { - "name": "output", - "shape": [24], - "data": [ - 1.1293666362762451, - -93.29325866699219, - -19.999887466430664, - 41.11921310424805, - 92.69351959228516, - -41.519378662109375, - -56.752288818359375, - 11.148094177246094, - 5.575400352478027, - 15.709176063537598, - 62.550445556640625, - -5.299276351928711, - -18.615251541137695, - -66.94721984863281, - 94.97520446777344, - -21.940048217773438, - 30.047636032104492, - 13.805134773254395, - -45.086708068847656, - 76.903564453125, - 46.969749450683594, - -86.58126831054688, - 31.64584732055664, - -67.96637725830078 - ], - "type": "float32" - } - }, - { - "name": "squeeze float32 3D tensor by eliminating one dimension default options", - "inputs": { - "input": { - "shape": [4, 1, 6], - "data": [ - 1.1293665986622017, - -93.29325783541842, - -19.999887095191227, - 41.119214363429876, - 92.69352298075461, - -41.51937878962313, - -56.75228730395734, - 11.148093991767155, - 5.57540042674151, - 15.709176425437747, - 62.550443705517665, - -5.299276370816216, - -18.61525168224469, - -66.94721623021692, - 94.97520289870027, - -21.94004801967297, - 30.047636856615554, - 13.805134987122344, - -45.08670702769, - 76.90356276507339, - 46.96974979938284, - -86.58127045567055, - 31.645846897982068, - -67.96637618240129 - ], - "type": "float32" - } - }, - "expected": { - "name": "output", - "shape": [4, 6], - "data": [ - 1.1293666362762451, - -93.29325866699219, - -19.999887466430664, - 41.11921310424805, - 92.69351959228516, - -41.519378662109375, - -56.752288818359375, - 11.148094177246094, - 5.575400352478027, - 15.709176063537598, - 62.550445556640625, - -5.299276351928711, - -18.615251541137695, - -66.94721984863281, - 94.97520446777344, - -21.940048217773438, - 30.047636032104492, - 13.805134773254395, - -45.086708068847656, - 76.903564453125, - 46.969749450683594, - -86.58126831054688, - 31.64584732055664, - -67.96637725830078 - ], - "type": "float32" - } - }, - { - "name": "squeeze float32 3D tensor by eliminating two dimensions default options", - "inputs": { - "input": { - "shape": [1, 24, 1], - "data": [ - 1.1293665986622017, - -93.29325783541842, - -19.999887095191227, - 41.119214363429876, - 92.69352298075461, - -41.51937878962313, - -56.75228730395734, - 11.148093991767155, - 5.57540042674151, - 15.709176425437747, - 62.550443705517665, - -5.299276370816216, - -18.61525168224469, - -66.94721623021692, - 94.97520289870027, - -21.94004801967297, - 30.047636856615554, - 13.805134987122344, - -45.08670702769, - 76.90356276507339, - 46.96974979938284, - -86.58127045567055, - 31.645846897982068, - -67.96637618240129 - ], - "type": "float32" - } - }, - "expected": { - "name": "output", - "shape": [24], - "data": [ - 1.1293666362762451, - -93.29325866699219, - -19.999887466430664, - 41.11921310424805, - 92.69351959228516, - -41.519378662109375, - -56.752288818359375, - 11.148094177246094, - 5.575400352478027, - 15.709176063537598, - 62.550445556640625, - -5.299276351928711, - -18.615251541137695, - -66.94721984863281, - 94.97520446777344, - -21.940048217773438, - 30.047636032104492, - 13.805134773254395, - -45.086708068847656, - 76.903564453125, - 46.969749450683594, - -86.58126831054688, - 31.64584732055664, - -67.96637725830078 - ], - "type": "float32" - } - }, - { - "name": "squeeze float32 4D tensor by eliminating two dimensions default options", - "inputs": { - "input": { - "shape": [1, 4, 1, 6], - "data": [ - 1.1293665986622017, - -93.29325783541842, - -19.999887095191227, - 41.119214363429876, - 92.69352298075461, - -41.51937878962313, - -56.75228730395734, - 11.148093991767155, - 5.57540042674151, - 15.709176425437747, - 62.550443705517665, - -5.299276370816216, - -18.61525168224469, - -66.94721623021692, - 94.97520289870027, - -21.94004801967297, - 30.047636856615554, - 13.805134987122344, - -45.08670702769, - 76.90356276507339, - 46.96974979938284, - -86.58127045567055, - 31.645846897982068, - -67.96637618240129 - ], - "type": "float32" - } - }, - "expected": { - "name": "output", - "shape": [4, 6], - "data": [ - 1.1293666362762451, - -93.29325866699219, - -19.999887466430664, - 41.11921310424805, - 92.69351959228516, - -41.519378662109375, - -56.752288818359375, - 11.148094177246094, - 5.575400352478027, - 15.709176063537598, - 62.550445556640625, - -5.299276351928711, - -18.615251541137695, - -66.94721984863281, - 94.97520446777344, - -21.940048217773438, - 30.047636032104492, - 13.805134773254395, - -45.086708068847656, - 76.903564453125, - 46.969749450683594, - -86.58126831054688, - 31.64584732055664, - -67.96637725830078 - ], - "type": "float32" - } - }, - { - "name": "squeeze float32 4D tensor by eliminating all dimensions default options", - "inputs": { - "input": { - "shape": [1, 1, 1, 1], - "data": [ - 19.404981030500302 - ], - "type": "float32" - } - }, - "expected": { - "name": "output", - "data": 19.40498161315918, - "type": "float32" - } - }, - { - "name": "squeeze float32 5D tensor by eliminating four dimensions default options", - "inputs": { - "input": { - "shape": [1, 1, 1, 24, 1], - "data": [ - 1.1293665986622017, - -93.29325783541842, - -19.999887095191227, - 41.119214363429876, - 92.69352298075461, - -41.51937878962313, - -56.75228730395734, - 11.148093991767155, - 5.57540042674151, - 15.709176425437747, - 62.550443705517665, - -5.299276370816216, - -18.61525168224469, - -66.94721623021692, - 94.97520289870027, - -21.94004801967297, - 30.047636856615554, - 13.805134987122344, - -45.08670702769, - 76.90356276507339, - 46.96974979938284, - -86.58127045567055, - 31.645846897982068, - -67.96637618240129 - ], - "type": "float32" - } - }, - "expected": { - "name": "output", - "shape": [24], - "data": [ - 1.1293666362762451, - -93.29325866699219, - -19.999887466430664, - 41.11921310424805, - 92.69351959228516, - -41.519378662109375, - -56.752288818359375, - 11.148094177246094, - 5.575400352478027, - 15.709176063537598, - 62.550445556640625, - -5.299276351928711, - -18.615251541137695, - -66.94721984863281, - 94.97520446777344, - -21.940048217773438, - 30.047636032104492, - 13.805134773254395, - -45.086708068847656, - 76.903564453125, - 46.969749450683594, - -86.58126831054688, - 31.64584732055664, - -67.96637725830078 - ], - "type": "float32" - } - }, - { - "name": "squeeze float32 2D tensor by eliminating one dimension options.axes", - "inputs": { - "input": { - "shape": [1, 24], - "data": [ - 1.1293665986622017, - -93.29325783541842, - -19.999887095191227, - 41.119214363429876, - 92.69352298075461, - -41.51937878962313, - -56.75228730395734, - 11.148093991767155, - 5.57540042674151, - 15.709176425437747, - 62.550443705517665, - -5.299276370816216, - -18.61525168224469, - -66.94721623021692, - 94.97520289870027, - -21.94004801967297, - 30.047636856615554, - 13.805134987122344, - -45.08670702769, - 76.90356276507339, - 46.96974979938284, - -86.58127045567055, - 31.645846897982068, - -67.96637618240129 - ], - "type": "float32" - } - }, - "options": { - "axes": [0] - }, - "expected": { - "name": "output", - "shape": [24], - "data": [ - 1.1293666362762451, - -93.29325866699219, - -19.999887466430664, - 41.11921310424805, - 92.69351959228516, - -41.519378662109375, - -56.752288818359375, - 11.148094177246094, - 5.575400352478027, - 15.709176063537598, - 62.550445556640625, - -5.299276351928711, - -18.615251541137695, - -66.94721984863281, - 94.97520446777344, - -21.940048217773438, - 30.047636032104492, - 13.805134773254395, - -45.086708068847656, - 76.903564453125, - 46.969749450683594, - -86.58126831054688, - 31.64584732055664, - -67.96637725830078 - ], - "type": "float32" - } - }, - { - "name": "squeeze float32 3D tensor by eliminating two dimensions options.axes", - "inputs": { - "input": { - "shape": [24, 1, 1], - "data": [ - 1.1293665986622017, - -93.29325783541842, - -19.999887095191227, - 41.119214363429876, - 92.69352298075461, - -41.51937878962313, - -56.75228730395734, - 11.148093991767155, - 5.57540042674151, - 15.709176425437747, - 62.550443705517665, - -5.299276370816216, - -18.61525168224469, - -66.94721623021692, - 94.97520289870027, - -21.94004801967297, - 30.047636856615554, - 13.805134987122344, - -45.08670702769, - 76.90356276507339, - 46.96974979938284, - -86.58127045567055, - 31.645846897982068, - -67.96637618240129 - ], - "type": "float32" - } - }, - "options": { - "axes": [1, 2] - }, - "expected": { - "name": "output", - "shape": [24], - "data": [ - 1.1293666362762451, - -93.29325866699219, - -19.999887466430664, - 41.11921310424805, - 92.69351959228516, - -41.519378662109375, - -56.752288818359375, - 11.148094177246094, - 5.575400352478027, - 15.709176063537598, - 62.550445556640625, - -5.299276351928711, - -18.615251541137695, - -66.94721984863281, - 94.97520446777344, - -21.940048217773438, - 30.047636032104492, - 13.805134773254395, - -45.086708068847656, - 76.903564453125, - 46.969749450683594, - -86.58126831054688, - 31.64584732055664, - -67.96637725830078 - ], - "type": "float32" - } - }, - { - "name": "squeeze float32 4D tensor by eliminating two dimensions options.axes", - "inputs": { - "input": { - "shape": [1, 4, 6, 1], - "data": [ - 1.1293665986622017, - -93.29325783541842, - -19.999887095191227, - 41.119214363429876, - 92.69352298075461, - -41.51937878962313, - -56.75228730395734, - 11.148093991767155, - 5.57540042674151, - 15.709176425437747, - 62.550443705517665, - -5.299276370816216, - -18.61525168224469, - -66.94721623021692, - 94.97520289870027, - -21.94004801967297, - 30.047636856615554, - 13.805134987122344, - -45.08670702769, - 76.90356276507339, - 46.96974979938284, - -86.58127045567055, - 31.645846897982068, - -67.96637618240129 - ], - "type": "float32" - } - }, - "options": { - "axes": [0, 3] - }, - "expected": { - "name": "output", - "shape": [4, 6], - "data": [ - 1.1293666362762451, - -93.29325866699219, - -19.999887466430664, - 41.11921310424805, - 92.69351959228516, - -41.519378662109375, - -56.752288818359375, - 11.148094177246094, - 5.575400352478027, - 15.709176063537598, - 62.550445556640625, - -5.299276351928711, - -18.615251541137695, - -66.94721984863281, - 94.97520446777344, - -21.940048217773438, - 30.047636032104492, - 13.805134773254395, - -45.086708068847656, - 76.903564453125, - 46.969749450683594, - -86.58126831054688, - 31.64584732055664, - -67.96637725830078 - ], - "type": "float32" - } - }, - { - "name": "squeeze float32 5D tensor by eliminating two dimensions options.axes", - "inputs": { - "input": { - "shape": [2, 1, 1, 12, 1], - "data": [ - 1.1293665986622017, - -93.29325783541842, - -19.999887095191227, - 41.119214363429876, - 92.69352298075461, - -41.51937878962313, - -56.75228730395734, - 11.148093991767155, - 5.57540042674151, - 15.709176425437747, - 62.550443705517665, - -5.299276370816216, - -18.61525168224469, - -66.94721623021692, - 94.97520289870027, - -21.94004801967297, - 30.047636856615554, - 13.805134987122344, - -45.08670702769, - 76.90356276507339, - 46.96974979938284, - -86.58127045567055, - 31.645846897982068, - -67.96637618240129 - ], - "type": "float32" - } - }, - "options": { - "axes": [1, 2] - }, - "expected": { - "name": "output", - "shape": [2, 12, 1], - "data": [ - 1.1293666362762451, - -93.29325866699219, - -19.999887466430664, - 41.11921310424805, - 92.69351959228516, - -41.519378662109375, - -56.752288818359375, - 11.148094177246094, - 5.575400352478027, - 15.709176063537598, - 62.550445556640625, - -5.299276351928711, - -18.615251541137695, - -66.94721984863281, - 94.97520446777344, - -21.940048217773438, - 30.047636032104492, - 13.805134773254395, - -45.086708068847656, - 76.903564453125, - 46.969749450683594, - -86.58126831054688, - 31.64584732055664, - -67.96637725830078 - ], - "type": "float32" - } - }, - { - "name": "squeeze float32 5D tensor by eliminating four dimensions options.axes", - "inputs": { - "input": { - "shape": [1, 1, 1, 24, 1], - "data": [ - 1.1293665986622017, - -93.29325783541842, - -19.999887095191227, - 41.119214363429876, - 92.69352298075461, - -41.51937878962313, - -56.75228730395734, - 11.148093991767155, - 5.57540042674151, - 15.709176425437747, - 62.550443705517665, - -5.299276370816216, - -18.61525168224469, - -66.94721623021692, - 94.97520289870027, - -21.94004801967297, - 30.047636856615554, - 13.805134987122344, - -45.08670702769, - 76.90356276507339, - 46.96974979938284, - -86.58127045567055, - 31.645846897982068, - -67.96637618240129 - ], - "type": "float32" - } - }, - "options": { - "axes": [0, 1, 2, 4] - }, - "expected": { - "name": "output", - "shape": [24], - "data": [ - 1.1293666362762451, - -93.29325866699219, - -19.999887466430664, - 41.11921310424805, - 92.69351959228516, - -41.519378662109375, - -56.752288818359375, - 11.148094177246094, - 5.575400352478027, - 15.709176063537598, - 62.550445556640625, - -5.299276351928711, - -18.615251541137695, - -66.94721984863281, - 94.97520446777344, - -21.940048217773438, - 30.047636032104492, - 13.805134773254395, - -45.086708068847656, - 76.903564453125, - 46.969749450683594, - -86.58126831054688, - 31.64584732055664, - -67.96637725830078 - ], - "type": "float32" - } - } - ] -} \ No newline at end of file diff --git a/tests/wpt/tests/webnn/resources/test_data/sub.json b/tests/wpt/tests/webnn/resources/test_data/sub.json index 4a3096313e1..207d9106b42 100644 --- a/tests/wpt/tests/webnn/resources/test_data/sub.json +++ b/tests/wpt/tests/webnn/resources/test_data/sub.json @@ -1,5 +1,103 @@ { "tests": [ + { + "name": "sub float32 1D constant tensors", + "inputs": { + "a": { + "shape": [24], + "data": [ + 73.59273411765761, + 14.484682970108636, + -69.40201711151408, + -52.04528488626416, + -75.78136877111933, + -2.274051445061204, + -83.29907743841476, + 15.57776886289956, + -62.70080421291606, + 32.95400351079056, + 82.55709225645836, + -74.90638758877455, + 78.22299428029646, + 48.39240254947623, + -19.153541450651716, + -85.93221227232242, + 89.12354776921964, + 22.874629248059804, + 80.56973297595874, + 97.62598337281631, + 52.74850952689357, + 89.16604046945432, + -20.503417738603375, + 99.48707602133317 + ], + "type": "float32", + "constant": true + }, + "b": { + "shape": [24], + "data": [ + -49.12813049327167, + 40.189291278955295, + 7.224666637037913, + 89.26004842468907, + -81.43340528622471, + 59.61165817521396, + 11.234410659855328, + 48.884057695505845, + 85.26825586730342, + 27.6952967767901, + 30.989454126839945, + -38.1290365096719, + -83.14809826804765, + -86.16174952283208, + 16.758884614336495, + 46.128898841129086, + -28.432477462364687, + 28.229338368319986, + 35.23646170623519, + -77.05516625176658, + -57.8714723086966, + -58.15086093387936, + 27.48886675763096, + 31.998020251913943 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + 122.72087097167969, + -25.704608917236328, + -76.62667846679688, + -141.30532836914062, + 5.652030944824219, + -61.885711669921875, + -94.53349304199219, + -33.3062858581543, + -147.96905517578125, + 5.258705139160156, + 51.56763458251953, + -36.77735137939453, + 161.37109375, + 134.5541534423828, + -35.91242599487305, + -132.0611114501953, + 117.5560302734375, + -5.354707717895508, + 45.33327102661133, + 174.68115234375, + 110.61997985839844, + 147.31689453125, + -47.992286682128906, + 67.48905944824219 + ], + "type": "float32" + } + }, { "name": "sub float32 1D tensors", "inputs": { @@ -65,7 +163,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [24], "data": [ 122.72087097167969, @@ -161,7 +259,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [4, 6], "data": [ 122.72087097167969, @@ -257,7 +355,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 3, 4], "data": [ 122.72087097167969, @@ -353,7 +451,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 2, 2, 3], "data": [ 122.72087097167969, @@ -449,7 +547,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 2, 1, 2, 3], "data": [ 122.72087097167969, @@ -522,7 +620,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 2, 2, 3], "data": [ -170.641845703125, @@ -600,7 +698,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 2, 2, 3], "data": [ 62.82989501953125, @@ -676,7 +774,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 2, 2, 3], "data": [ 81.98584747314453, @@ -749,7 +847,7 @@ } }, "expected": { - "name": "ouput", + "name": "output", "shape": [2, 2, 2, 3], "data": [ -170.641845703125, diff --git a/tests/wpt/tests/webnn/resources/test_data/tan.json b/tests/wpt/tests/webnn/resources/test_data/tan.json index 857e2b65059..63c7056d905 100644 --- a/tests/wpt/tests/webnn/resources/test_data/tan.json +++ b/tests/wpt/tests/webnn/resources/test_data/tan.json @@ -1,5 +1,72 @@ { "tests": [ + { + "name": "tan float32 1D constant tensor", + "inputs": { + "x": { + "shape": [24], + "data": [ + 52.697813799029234, + 70.06912795961244, + 90.49689556206596, + 24.656670346007246, + 11.665126934214868, + -50.95264467861913, + 40.32006298292501, + -9.641122915742358, + -31.567750159821898, + 45.59520766037491, + -55.93085683516472, + -44.602971816473726, + 80.45398224930159, + -2.314880760077372, + -25.474768449753242, + 62.589453387873476, + -70.9440311153533, + 62.8486191264619, + 84.79767085874772, + -95.58503093501218, + 15.552484501850643, + -55.256541162343574, + -26.884890419121504, + 0.15926108746810996 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + -0.8582430481910706, + 1.410544753074646, + -0.6978657245635986, + -0.5156278610229492, + -1.2633823156356812, + -0.8205758929252625, + -0.5734118819236755, + -0.21978461742401123, + -0.1530018001794815, + -23.731182098388672, + 0.7106066942214966, + -0.7149254679679871, + -2.7969717979431152, + 1.086239218711853, + -0.3560185432434082, + -0.24726025760173798, + 3.7865755558013916, + 0.016766052693128586, + -0.025338610634207726, + -4.203672409057617, + -0.1567438244819641, + 3.495089292526245, + 5.453553199768066, + 0.16062140464782715 + ], + "type": "float32" + } + }, { "name": "tan float32 1D tensor", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/tanh.json b/tests/wpt/tests/webnn/resources/test_data/tanh.json index 9e13b62472a..063c10623d8 100644 --- a/tests/wpt/tests/webnn/resources/test_data/tanh.json +++ b/tests/wpt/tests/webnn/resources/test_data/tanh.json @@ -1,5 +1,72 @@ { "tests": [ + { + "name": "tanh float32 1D constant tensor", + "inputs": { + "x": { + "shape": [24], + "data": [ + 5.47352732138576, + -1.1535596038683664, + 0.4074455820170506, + 1.8297704953674545, + 2.8690003001236537, + -4.570195171586943, + 4.146744465978713, + -4.0659342722666105, + -3.712847102459686, + 0.9077175268859179, + -0.11083049583219662, + 5.955096345162751, + 1.7831856867406417, + 4.023128342782897, + 5.587857512324163, + -5.280654174784587, + 1.4147950164785632, + -5.707717050109768, + -1.4439182665473629, + -1.9129082844854288, + 2.7495969049667437, + -0.7420240173058836, + 4.856568111647942, + -0.7563357776241926 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + 0.9999647736549377, + -0.8189298510551453, + 0.38630160689353943, + 0.9498035907745361, + 0.9935782551765442, + -0.9997855424880981, + 0.9994998574256897, + -0.9994121193885803, + -0.9988092184066772, + 0.7200349569320679, + -0.1103789210319519, + 0.9999865293502808, + 0.945036768913269, + 0.9993596076965332, + 0.9999719858169556, + -0.9999482035636902, + 0.8885080814361572, + -0.9999779462814331, + -0.894483745098114, + -0.9573289752006531, + 0.9918531775474548, + -0.6303664445877075, + 0.9998790621757507, + -0.6389135718345642 + ], + "type": "float32" + } + }, { "name": "tanh float32 1D tensor", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/transpose.json b/tests/wpt/tests/webnn/resources/test_data/transpose.json index 03092031d9c..f7e6a7d2dd2 100644 --- a/tests/wpt/tests/webnn/resources/test_data/transpose.json +++ b/tests/wpt/tests/webnn/resources/test_data/transpose.json @@ -1,5 +1,72 @@ { "tests": [ + { + "name": "transpose float32 1D constant tensor default options", + "inputs": { + "input": { + "shape": [24], + "data": [ + -45.67443169971317, + 53.45924798828125, + -60.118491676622114, + 38.08174802652866, + 78.64247328659363, + -69.2532431989057, + 1.843458570865181, + 92.81028097440239, + 56.10007526080264, + 77.05838267016932, + 57.46807874077655, + -84.74308916696364, + 46.38539267170415, + -84.89764374240352, + 56.70438712681607, + -25.69514467758806, + 5.622173913750174, + -25.6628149156966, + 99.46284660658401, + -87.58919988335086, + -65.37790624507953, + -66.00990219021253, + 38.46682821671709, + 2.1999381880991393 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + -45.67443084716797, + 53.45924758911133, + -60.118492126464844, + 38.081748962402344, + 78.64247131347656, + -69.25324249267578, + 1.8434585332870483, + 92.8102798461914, + 56.100074768066406, + 77.05838012695312, + 57.46807861328125, + -84.74308776855469, + 46.38539123535156, + -84.89764404296875, + 56.70438766479492, + -25.695144653320312, + 5.62217378616333, + -25.66281509399414, + 99.46284484863281, + -87.58920288085938, + -65.3779067993164, + -66.00990295410156, + 38.466827392578125, + 2.1999382972717285 + ], + "type": "float32" + } + }, { "name": "transpose float32 1D tensor default options", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/where.json b/tests/wpt/tests/webnn/resources/test_data/where.json index ce3cda4bad3..7c55b3171ae 100644 --- a/tests/wpt/tests/webnn/resources/test_data/where.json +++ b/tests/wpt/tests/webnn/resources/test_data/where.json @@ -34,6 +34,135 @@ "type": "float32" } }, + { + "name": "where float32 1D constant tensors", + "inputs": { + "condition": { + "shape": [24], + "data": [ + 241, + 0, + 85, + 0, + 227, + 51, + 202, + 0, + 104, + 227, + 129, + 129, + 175, + 134, + 130, + 140, + 103, + 46, + 158, + 17, + 0, + 41, + 94, + 0 + ], + "type": "uint8", + "constant": true + }, + "trueValues": { + "shape": [24], + "data": [ + 70.27151489257812, + 89.99047088623047, + -1.5351932048797607, + -83.77035522460938, + 29.59670639038086, + -37.10446548461914, + -6.663239002227783, + -83.15333557128906, + -90.47624206542969, + -45.470706939697266, + 50.38861083984375, + 46.510799407958984, + 47.503013610839844, + -21.95842933654785, + 42.89878463745117, + -76.8262710571289, + 67.0030746459961, + 40.09717559814453, + -29.081029891967773, + -12.19106674194336, + -10.8577880859375, + -23.302522659301758, + 30.851404190063477, + -58.82704544067383 + ], + "type": "float32", + "constant": true + }, + "falseValues": { + "shape": [24], + "data": [ + 90.44255065917969, + 66.7642593383789, + -39.82423782348633, + -21.683168411254883, + -67.3449478149414, + -46.46003341674805, + -55.907073974609375, + 65.5730209350586, + 35.14354705810547, + 11.960981369018555, + 76.65287780761719, + 60.741416931152344, + -93.93305206298828, + -30.397233963012695, + 34.315250396728516, + 7.7088470458984375, + -82.2353286743164, + 91.12223052978516, + 22.937334060668945, + 74.97810363769531, + 18.877336502075195, + 62.31299591064453, + 48.867103576660156, + -75.41789245605469 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + 70.27151489257812, + 66.7642593383789, + -1.5351932048797607, + -21.683168411254883, + 29.59670639038086, + -37.10446548461914, + -6.663239002227783, + 65.5730209350586, + -90.47624206542969, + -45.470706939697266, + 50.38861083984375, + 46.510799407958984, + 47.503013610839844, + -21.95842933654785, + 42.89878463745117, + -76.8262710571289, + 67.0030746459961, + 40.09717559814453, + -29.081029891967773, + -12.19106674194336, + 18.877336502075195, + -23.302522659301758, + 30.851404190063477, + -75.41789245605469 + ], + "type": "float32" + } + }, { "name": "where float32 1D tensors", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/utils.js b/tests/wpt/tests/webnn/resources/utils.js index 0e2687ec22b..955e01fb949 100644 --- a/tests/wpt/tests/webnn/resources/utils.js +++ b/tests/wpt/tests/webnn/resources/utils.js @@ -327,9 +327,11 @@ const PrecisionMetrics = { // End Element-wise unary operations elu: {ULP: {float32: 18, float16: 18}}, expand: {ULP: {float32: 0, float16: 0}}, + gather: {ULP: {float32: 0, float16: 0}}, gemm: {ULP: {float32: getGemmPrecisionTolerance, float16: getGemmPrecisionTolerance}}, hardSigmoid: {ULP: {float32: 2, float16: 2}}, hardSwish: {ULP: {float32: 4, float16: 4}}, + layerNormalization: {ATOL: {float32: 1/1024, float16: 1/512}}, leakyRelu: {ULP: {float32: 1, float16: 1}}, linear: {ULP: {float32: 2, float16: 2}}, matmul: {ULP: {float32: getMatmulPrecisionTolerance, float16: getMatmulPrecisionTolerance}}, @@ -359,7 +361,6 @@ const PrecisionMetrics = { softplus: {ULP: {float32: 18, float16: 18}}, softsign: {ULP: {float32: 3, float16: 3}}, split: {ULP: {float32: 0, float16: 0}}, - squeeze: {ULP: {float32: 0, float16: 0}}, tanh: {ATOL: {float32: 1/1024, float16: 1/512}}, transpose: {ULP: {float32: 0, float16: 0}}, where: {ULP: {float32: 0, float16: 0}}, @@ -526,7 +527,13 @@ const createConstantOperand = (builder, resources) => { const createSingleInputOperand = (builder, resources, inputOperandName) => { inputOperandName = inputOperandName ? inputOperandName : Object.keys(resources.inputs)[0]; const inputResources = resources.inputs[inputOperandName]; - return builder.input(inputOperandName, {dataType: inputResources.type, type: inputResources.type, dimensions: inputResources.shape}); + let operand; + if (resources.inputs[inputOperandName].hasOwnProperty('constant') && resources.inputs[inputOperandName]['constant']) { + operand = createConstantOperand(builder, resources.inputs[inputOperandName]); + } else { + operand = builder.input(inputOperandName, {dataType: inputResources.type, type: inputResources.type, dimensions: inputResources.shape}); + } + return operand; }; /** @@ -539,12 +546,7 @@ const createMultiInputOperands = (builder, resources) => { let inputOperands = []; const inputOperandNameArray = Object.keys(resources.inputs); inputOperandNameArray.forEach(inputOperandName => { - let operand; - if (resources.inputs[inputOperandName].hasOwnProperty('constant') && resources.inputs[inputOperandName]['constant']) { - operand = createConstantOperand(builder, resources.inputs[inputOperandName]); - } else { - operand = createSingleInputOperand(builder, resources, inputOperandName); - } + const operand = createSingleInputOperand(builder, resources, inputOperandName); inputOperands.push(operand); }); return inputOperands; @@ -608,8 +610,14 @@ const buildConcat = (operationName, builder, resources) => { // MLOperand concat(sequence inputs, unsigned long axis); const namedOutputOperand = {}; const inputOperands = []; + let operand; for (let input of resources.inputs) { - inputOperands.push(builder.input(input.name, {dataType: input.type, type: input.type, dimensions: input.shape})); + if (input.hasOwnProperty('constant') && input['constant']) { + operand = createConstantOperand(builder, input); + } else { + operand = builder.input(input.name, {dataType: input.type, type: input.type, dimensions: input.shape}); + } + inputOperands.push(operand); } // invoke builder.concat() namedOutputOperand[resources.expected.name] = builder[operationName](inputOperands, resources.axis); @@ -664,6 +672,22 @@ const buildGemm = (operationName, builder, resources) => { return namedOutputOperand; }; +const buildLayerNorm = (operationName, builder, resources) => { + // MLOperand layerNormalization(MLOperand input, optional MLLayerNormalizationOptions options = {}); + const namedOutputOperand = {}; + const inputOperand = createSingleInputOperand(builder, resources); + const layerNormOptions = {...resources.options}; + if (layerNormOptions.scale) { + layerNormOptions.scale = createConstantOperand(builder, layerNormOptions.scale); + } + if (layerNormOptions.bias) { + layerNormOptions.bias = createConstantOperand(builder, layerNormOptions.bias); + } + // invoke builder.layerNormalization() + namedOutputOperand[resources.expected.name] = builder[operationName](inputOperand, layerNormOptions); + return namedOutputOperand; +}; + const buildPad = (operationName, builder, resources) => { // MLOperand pad(MLOperand input, sequence beginningPadding, sequence endingPadding, optional MLPadOptions options = {}); const namedOutputOperand = {}; diff --git a/tests/wpt/tests/webrtc-encoded-transform/META.yml b/tests/wpt/tests/webrtc-encoded-transform/META.yml index 6365c8d16af..8947732b6fb 100644 --- a/tests/wpt/tests/webrtc-encoded-transform/META.yml +++ b/tests/wpt/tests/webrtc-encoded-transform/META.yml @@ -1 +1,6 @@ spec: https://w3c.github.io/webrtc-encoded-transform/ +suggested_reviewers: + - alvestrand + - guidou + - youennf + - jan-ivar diff --git a/tests/wpt/tests/webrtc-encoded-transform/RTCEncodedAudioFrame-clone.https.html b/tests/wpt/tests/webrtc-encoded-transform/tentative/RTCEncodedAudioFrame-clone.https.html similarity index 89% rename from tests/wpt/tests/webrtc-encoded-transform/RTCEncodedAudioFrame-clone.https.html rename to tests/wpt/tests/webrtc-encoded-transform/tentative/RTCEncodedAudioFrame-clone.https.html index 83cf642d77f..9f07713d443 100644 --- a/tests/wpt/tests/webrtc-encoded-transform/RTCEncodedAudioFrame-clone.https.html +++ b/tests/wpt/tests/webrtc-encoded-transform/tentative/RTCEncodedAudioFrame-clone.https.html @@ -5,9 +5,9 @@ - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - + + diff --git a/tests/wpt/tests/webrtc-encoded-transform/RTCPeerConnection-insertable-streams-errors.https.html b/tests/wpt/tests/webrtc-encoded-transform/tentative/RTCPeerConnection-insertable-streams-errors.https.html similarity index 91% rename from tests/wpt/tests/webrtc-encoded-transform/RTCPeerConnection-insertable-streams-errors.https.html rename to tests/wpt/tests/webrtc-encoded-transform/tentative/RTCPeerConnection-insertable-streams-errors.https.html index d36df8227bf..a0c68c400a2 100644 --- a/tests/wpt/tests/webrtc-encoded-transform/RTCPeerConnection-insertable-streams-errors.https.html +++ b/tests/wpt/tests/webrtc-encoded-transform/tentative/RTCPeerConnection-insertable-streams-errors.https.html @@ -6,8 +6,8 @@ - - + + diff --git a/tests/wpt/tests/webrtc-encoded-transform/RTCPeerConnection-insertable-streams-simulcast.https.html b/tests/wpt/tests/webrtc-encoded-transform/tentative/RTCPeerConnection-insertable-streams-simulcast.https.html similarity index 92% rename from tests/wpt/tests/webrtc-encoded-transform/RTCPeerConnection-insertable-streams-simulcast.https.html rename to tests/wpt/tests/webrtc-encoded-transform/tentative/RTCPeerConnection-insertable-streams-simulcast.https.html index cb33e458d18..834644674e8 100644 --- a/tests/wpt/tests/webrtc-encoded-transform/RTCPeerConnection-insertable-streams-simulcast.https.html +++ b/tests/wpt/tests/webrtc-encoded-transform/tentative/RTCPeerConnection-insertable-streams-simulcast.https.html @@ -5,10 +5,10 @@ - - - - + + + + - - + + diff --git a/tests/wpt/tests/webrtc-encoded-transform/RTCPeerConnection-insertable-streams-video.https.html b/tests/wpt/tests/webrtc-encoded-transform/tentative/RTCPeerConnection-insertable-streams-video.https.html similarity index 97% rename from tests/wpt/tests/webrtc-encoded-transform/RTCPeerConnection-insertable-streams-video.https.html rename to tests/wpt/tests/webrtc-encoded-transform/tentative/RTCPeerConnection-insertable-streams-video.https.html index aa0ff474e97..5334b8d1f94 100644 --- a/tests/wpt/tests/webrtc-encoded-transform/RTCPeerConnection-insertable-streams-video.https.html +++ b/tests/wpt/tests/webrtc-encoded-transform/tentative/RTCPeerConnection-insertable-streams-video.https.html @@ -6,8 +6,8 @@ - - + + diff --git a/tests/wpt/tests/webrtc-encoded-transform/RTCPeerConnection-insertable-streams-worker.https.html b/tests/wpt/tests/webrtc-encoded-transform/tentative/RTCPeerConnection-insertable-streams-worker.https.html similarity index 98% rename from tests/wpt/tests/webrtc-encoded-transform/RTCPeerConnection-insertable-streams-worker.https.html rename to tests/wpt/tests/webrtc-encoded-transform/tentative/RTCPeerConnection-insertable-streams-worker.https.html index cb31057cac9..94943f8b696 100644 --- a/tests/wpt/tests/webrtc-encoded-transform/RTCPeerConnection-insertable-streams-worker.https.html +++ b/tests/wpt/tests/webrtc-encoded-transform/tentative/RTCPeerConnection-insertable-streams-worker.https.html @@ -6,8 +6,8 @@ - - + + diff --git a/tests/wpt/tests/webrtc-encoded-transform/RTCPeerConnection-insertable-streams.js b/tests/wpt/tests/webrtc-encoded-transform/tentative/RTCPeerConnection-insertable-streams.js similarity index 100% rename from tests/wpt/tests/webrtc-encoded-transform/RTCPeerConnection-insertable-streams.js rename to tests/wpt/tests/webrtc-encoded-transform/tentative/RTCPeerConnection-insertable-streams.js diff --git a/tests/wpt/tests/webrtc-encoded-transform/RTCPeerConnection-sender-worker-single-frame.js b/tests/wpt/tests/webrtc-encoded-transform/tentative/RTCPeerConnection-sender-worker-single-frame.js similarity index 100% rename from tests/wpt/tests/webrtc-encoded-transform/RTCPeerConnection-sender-worker-single-frame.js rename to tests/wpt/tests/webrtc-encoded-transform/tentative/RTCPeerConnection-sender-worker-single-frame.js diff --git a/tests/wpt/tests/webrtc-encoded-transform/RTCPeerConnection-worker-transform.js b/tests/wpt/tests/webrtc-encoded-transform/tentative/RTCPeerConnection-worker-transform.js similarity index 100% rename from tests/wpt/tests/webrtc-encoded-transform/RTCPeerConnection-worker-transform.js rename to tests/wpt/tests/webrtc-encoded-transform/tentative/RTCPeerConnection-worker-transform.js diff --git a/tests/wpt/tests/webrtc-encoded-transform/resources/blank.html b/tests/wpt/tests/webrtc-encoded-transform/tentative/resources/blank.html similarity index 100% rename from tests/wpt/tests/webrtc-encoded-transform/resources/blank.html rename to tests/wpt/tests/webrtc-encoded-transform/tentative/resources/blank.html diff --git a/tests/wpt/tests/webrtc-encoded-transform/resources/serviceworker-failure.js b/tests/wpt/tests/webrtc-encoded-transform/tentative/resources/serviceworker-failure.js similarity index 100% rename from tests/wpt/tests/webrtc-encoded-transform/resources/serviceworker-failure.js rename to tests/wpt/tests/webrtc-encoded-transform/tentative/resources/serviceworker-failure.js diff --git a/tests/wpt/tests/webrtc/RTCRtpSender-setParameters-keyFrame.html b/tests/wpt/tests/webrtc/RTCRtpSender-setParameters-keyFrame.html new file mode 100644 index 00000000000..c78dfa141c1 --- /dev/null +++ b/tests/wpt/tests/webrtc/RTCRtpSender-setParameters-keyFrame.html @@ -0,0 +1,94 @@ + + + +RTCRtpSender.prototype.setParameters for generating keyFrames + + + + diff --git a/tests/wpt/tests/webrtc/legacy/munge-dont.html b/tests/wpt/tests/webrtc/legacy/munge-dont.html new file mode 100644 index 00000000000..b5f0a4cb63b --- /dev/null +++ b/tests/wpt/tests/webrtc/legacy/munge-dont.html @@ -0,0 +1,88 @@ + + + +SDP munging is a bad idea + + + diff --git a/tests/wpt/tests/webrtc/protocol/sdes-dont-dont-dont.html b/tests/wpt/tests/webrtc/protocol/sdes-dont-dont-dont.html index e938c84c8bf..dcf7ad1b546 100644 --- a/tests/wpt/tests/webrtc/protocol/sdes-dont-dont-dont.html +++ b/tests/wpt/tests/webrtc/protocol/sdes-dont-dont-dont.html @@ -37,19 +37,13 @@ promise_test(async t => { pc.addTransceiver('audio'); const offer = await pc.createOffer(); assert_false(offer.sdp.includes('\na=crypto:')); -}, 'does not create offers with SDES'); +}, 'Does not create offers with SDES'); -promise_test(async t => { +promise_test(t => { const pc = new RTCPeerConnection(); t.add_cleanup(() => pc.close()); - try { - await pc.setRemoteDescription({type: 'offer', sdp}); - assert_unreached("Must not accept SDP without fingerprint"); - } catch (e) { - // TODO: which error is correct? See - // https://github.com/w3c/webrtc-pc/issues/2672 - assert_true(['OperationError', 'InvalidAccessError'].includes(e.name)); - } + return promise_rejects_dom(t, 'InvalidAccessError', + pc.setRemoteDescription({type: 'offer', sdp})); }, 'rejects a remote offer that only includes SDES and no DTLS fingerprint');