summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/webnn/resources/test_data/pad.json
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/webnn/resources/test_data/pad.json')
-rw-r--r--testing/web-platform/tests/webnn/resources/test_data/pad.json797
1 files changed, 797 insertions, 0 deletions
diff --git a/testing/web-platform/tests/webnn/resources/test_data/pad.json b/testing/web-platform/tests/webnn/resources/test_data/pad.json
new file mode 100644
index 0000000000..53e8ed8f59
--- /dev/null
+++ b/testing/web-platform/tests/webnn/resources/test_data/pad.json
@@ -0,0 +1,797 @@
+{
+ "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": {
+ "input": {
+ "shape": [9],
+ "data": [
+ 22.763617617214834,
+ -21.16852940391331,
+ -91.66169283838785,
+ 16.863798710594182,
+ 60.51471999839896,
+ -70.56754852642953,
+ -60.64327110324324,
+ -47.88219132680065,
+ 68.7255776612235
+ ],
+ "type": "float32"
+ }
+ },
+ "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 2D tensor default options",
+ "inputs": {
+ "input": {
+ "shape": [3, 3],
+ "data": [
+ 22.763617617214834,
+ -21.16852940391331,
+ -91.66169283838785,
+ 16.863798710594182,
+ 60.51471999839896,
+ -70.56754852642953,
+ -60.64327110324324,
+ -47.88219132680065,
+ 68.7255776612235
+ ],
+ "type": "float32"
+ }
+ },
+ "beginningPadding": [1, 1],
+ "endingPadding": [1, 1],
+ "expected": {
+ "shape": [5, 5],
+ "data": [
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 22.76361846923828,
+ -21.168529510498047,
+ -91.66168975830078,
+ 0,
+ 0,
+ 16.863798141479492,
+ 60.51472091674805,
+ -70.56755065917969,
+ 0,
+ 0,
+ -60.643272399902344,
+ -47.8821907043457,
+ 68.72557830810547,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
+ ],
+ "type": "float32"
+ }
+ },
+ {
+ "name": "pad float32 3D tensor default options",
+ "inputs": {
+ "input": {
+ "shape": [1, 3, 3],
+ "data": [
+ 22.763617617214834,
+ -21.16852940391331,
+ -91.66169283838785,
+ 16.863798710594182,
+ 60.51471999839896,
+ -70.56754852642953,
+ -60.64327110324324,
+ -47.88219132680065,
+ 68.7255776612235
+ ],
+ "type": "float32"
+ }
+ },
+ "beginningPadding": [1, 1, 1],
+ "endingPadding": [1, 1, 1],
+ "expected": {
+ "shape": [3, 5, 5],
+ "data": [
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 22.76361846923828,
+ -21.168529510498047,
+ -91.66168975830078,
+ 0,
+ 0,
+ 16.863798141479492,
+ 60.51472091674805,
+ -70.56755065917969,
+ 0,
+ 0,
+ -60.643272399902344,
+ -47.8821907043457,
+ 68.72557830810547,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
+ ],
+ "type": "float32"
+ }
+ },
+ {
+ "name": "pad float32 4D tensor default options",
+ "inputs": {
+ "input": {
+ "shape": [1, 3, 3, 1],
+ "data": [
+ 22.763617617214834,
+ -21.16852940391331,
+ -91.66169283838785,
+ 16.863798710594182,
+ 60.51471999839896,
+ -70.56754852642953,
+ -60.64327110324324,
+ -47.88219132680065,
+ 68.7255776612235
+ ],
+ "type": "float32"
+ }
+ },
+ "beginningPadding": [0, 1, 1, 1],
+ "endingPadding": [0, 1, 1, 1],
+ "expected": {
+ "shape": [1, 5, 5, 3],
+ "data": [
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 22.76361846923828,
+ 0,
+ 0,
+ -21.168529510498047,
+ 0,
+ 0,
+ -91.66168975830078,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 16.863798141479492,
+ 0,
+ 0,
+ 60.51472091674805,
+ 0,
+ 0,
+ -70.56755065917969,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ -60.643272399902344,
+ 0,
+ 0,
+ -47.8821907043457,
+ 0,
+ 0,
+ 68.72557830810547,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
+ ],
+ "type": "float32"
+ }
+ },
+ {
+ "name": "pad float32 5D tensor default options",
+ "inputs": {
+ "input": {
+ "shape": [1, 3, 3, 1, 1],
+ "data": [
+ 22.763617617214834,
+ -21.16852940391331,
+ -91.66169283838785,
+ 16.863798710594182,
+ 60.51471999839896,
+ -70.56754852642953,
+ -60.64327110324324,
+ -47.88219132680065,
+ 68.7255776612235
+ ],
+ "type": "float32"
+ }
+ },
+ "beginningPadding": [0, 1, 1, 0, 1],
+ "endingPadding": [0, 1, 1, 0, 1],
+ "expected": {
+ "shape": [1, 5, 5, 1, 3],
+ "data": [
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 22.76361846923828,
+ 0,
+ 0,
+ -21.168529510498047,
+ 0,
+ 0,
+ -91.66168975830078,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 16.863798141479492,
+ 0,
+ 0,
+ 60.51472091674805,
+ 0,
+ 0,
+ -70.56755065917969,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ -60.643272399902344,
+ 0,
+ 0,
+ -47.8821907043457,
+ 0,
+ 0,
+ 68.72557830810547,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
+ ],
+ "type": "float32"
+ }
+ },
+ {
+ "name": "pad float32 2D tensor explicit options.mode='constant'",
+ "inputs": {
+ "input": {
+ "shape": [3, 3],
+ "data": [
+ 22.763617617214834,
+ -21.16852940391331,
+ -91.66169283838785,
+ 16.863798710594182,
+ 60.51471999839896,
+ -70.56754852642953,
+ -60.64327110324324,
+ -47.88219132680065,
+ 68.7255776612235
+ ],
+ "type": "float32"
+ }
+ },
+ "beginningPadding": [1, 1],
+ "endingPadding": [1, 1],
+ "options": {
+ "mode": "constant"
+ },
+ "expected": {
+ "shape": [5, 5],
+ "data": [
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 22.76361846923828,
+ -21.168529510498047,
+ -91.66168975830078,
+ 0,
+ 0,
+ 16.863798141479492,
+ 60.51472091674805,
+ -70.56755065917969,
+ 0,
+ 0,
+ -60.643272399902344,
+ -47.8821907043457,
+ 68.72557830810547,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
+ ],
+ "type": "float32"
+ }
+ },
+ {
+ "name": "pad float32 2D tensor options.value default constant mode",
+ "inputs": {
+ "input": {
+ "shape": [3, 3],
+ "data": [
+ 22.763617617214834,
+ -21.16852940391331,
+ -91.66169283838785,
+ 16.863798710594182,
+ 60.51471999839896,
+ -70.56754852642953,
+ -60.64327110324324,
+ -47.88219132680065,
+ 68.7255776612235
+ ],
+ "type": "float32"
+ }
+ },
+ "beginningPadding": [1, 1],
+ "endingPadding": [1, 1],
+ "options": {
+ "value": 1.0
+ },
+ "expected": {
+ "shape": [5, 5],
+ "data": [
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 22.76361846923828,
+ -21.168529510498047,
+ -91.66168975830078,
+ 1,
+ 1,
+ 16.863798141479492,
+ 60.51472091674805,
+ -70.56755065917969,
+ 1,
+ 1,
+ -60.643272399902344,
+ -47.8821907043457,
+ 68.72557830810547,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1
+ ],
+ "type": "float32"
+ }
+ },
+ {
+ "name": "pad float32 4D tensor options.mode='edge'",
+ "inputs": {
+ "input": {
+ "shape": [1, 3, 3, 1],
+ "data": [
+ 22.763617617214834,
+ -21.16852940391331,
+ -91.66169283838785,
+ 16.863798710594182,
+ 60.51471999839896,
+ -70.56754852642953,
+ -60.64327110324324,
+ -47.88219132680065,
+ 68.7255776612235
+ ],
+ "type": "float32"
+ }
+ },
+ "beginningPadding": [0, 2, 2, 0],
+ "endingPadding": [0, 2, 2, 0],
+ "options": {
+ "mode": "edge"
+ },
+ "expected": {
+ "shape": [1, 7, 7, 1],
+ "data": [
+ 22.76361846923828,
+ 22.76361846923828,
+ 22.76361846923828,
+ -21.168529510498047,
+ -91.66168975830078,
+ -91.66168975830078,
+ -91.66168975830078,
+ 22.76361846923828,
+ 22.76361846923828,
+ 22.76361846923828,
+ -21.168529510498047,
+ -91.66168975830078,
+ -91.66168975830078,
+ -91.66168975830078,
+ 22.76361846923828,
+ 22.76361846923828,
+ 22.76361846923828,
+ -21.168529510498047,
+ -91.66168975830078,
+ -91.66168975830078,
+ -91.66168975830078,
+ 16.863798141479492,
+ 16.863798141479492,
+ 16.863798141479492,
+ 60.51472091674805,
+ -70.56755065917969,
+ -70.56755065917969,
+ -70.56755065917969,
+ -60.643272399902344,
+ -60.643272399902344,
+ -60.643272399902344,
+ -47.8821907043457,
+ 68.72557830810547,
+ 68.72557830810547,
+ 68.72557830810547,
+ -60.643272399902344,
+ -60.643272399902344,
+ -60.643272399902344,
+ -47.8821907043457,
+ 68.72557830810547,
+ 68.72557830810547,
+ 68.72557830810547,
+ -60.643272399902344,
+ -60.643272399902344,
+ -60.643272399902344,
+ -47.8821907043457,
+ 68.72557830810547,
+ 68.72557830810547,
+ 68.72557830810547
+ ],
+ "type": "float32"
+ }
+ },
+ {
+ "name": "pad float32 4D tensor options.mode='reflection'",
+ "inputs": {
+ "input": {
+ "shape": [1, 3, 3, 1],
+ "data": [
+ 22.763617617214834,
+ -21.16852940391331,
+ -91.66169283838785,
+ 16.863798710594182,
+ 60.51471999839896,
+ -70.56754852642953,
+ -60.64327110324324,
+ -47.88219132680065,
+ 68.7255776612235
+ ],
+ "type": "float32"
+ }
+ },
+ "beginningPadding": [0, 2, 2, 0],
+ "endingPadding": [0, 2, 2, 0],
+ "options": {
+ "mode": "reflection"
+ },
+ "expected": {
+ "shape": [1, 7, 7, 1],
+ "data": [
+ 68.72557830810547,
+ -47.8821907043457,
+ -60.643272399902344,
+ -47.8821907043457,
+ 68.72557830810547,
+ -47.8821907043457,
+ -60.643272399902344,
+ -70.56755065917969,
+ 60.51472091674805,
+ 16.863798141479492,
+ 60.51472091674805,
+ -70.56755065917969,
+ 60.51472091674805,
+ 16.863798141479492,
+ -91.66168975830078,
+ -21.168529510498047,
+ 22.76361846923828,
+ -21.168529510498047,
+ -91.66168975830078,
+ -21.168529510498047,
+ 22.76361846923828,
+ -70.56755065917969,
+ 60.51472091674805,
+ 16.863798141479492,
+ 60.51472091674805,
+ -70.56755065917969,
+ 60.51472091674805,
+ 16.863798141479492,
+ 68.72557830810547,
+ -47.8821907043457,
+ -60.643272399902344,
+ -47.8821907043457,
+ 68.72557830810547,
+ -47.8821907043457,
+ -60.643272399902344,
+ -70.56755065917969,
+ 60.51472091674805,
+ 16.863798141479492,
+ 60.51472091674805,
+ -70.56755065917969,
+ 60.51472091674805,
+ 16.863798141479492,
+ -91.66168975830078,
+ -21.168529510498047,
+ 22.76361846923828,
+ -21.168529510498047,
+ -91.66168975830078,
+ -21.168529510498047,
+ 22.76361846923828
+ ],
+ "type": "float32"
+ }
+ },
+ {
+ "name": "pad float32 4D tensor options.mode='symmetric'",
+ "inputs": {
+ "input": {
+ "shape": [1, 3, 3, 1],
+ "data": [
+ 22.763617617214834,
+ -21.16852940391331,
+ -91.66169283838785,
+ 16.863798710594182,
+ 60.51471999839896,
+ -70.56754852642953,
+ -60.64327110324324,
+ -47.88219132680065,
+ 68.7255776612235
+ ],
+ "type": "float32"
+ }
+ },
+ "beginningPadding": [0, 2, 2, 0],
+ "endingPadding": [0, 2, 2, 0],
+ "options": {
+ "mode": "symmetric"
+ },
+ "expected": {
+ "shape": [1, 7, 7, 1],
+ "data": [
+ 60.51472091674805,
+ 16.863798141479492,
+ 16.863798141479492,
+ 60.51472091674805,
+ -70.56755065917969,
+ -70.56755065917969,
+ 60.51472091674805,
+ -21.168529510498047,
+ 22.76361846923828,
+ 22.76361846923828,
+ -21.168529510498047,
+ -91.66168975830078,
+ -91.66168975830078,
+ -21.168529510498047,
+ -21.168529510498047,
+ 22.76361846923828,
+ 22.76361846923828,
+ -21.168529510498047,
+ -91.66168975830078,
+ -91.66168975830078,
+ -21.168529510498047,
+ 60.51472091674805,
+ 16.863798141479492,
+ 16.863798141479492,
+ 60.51472091674805,
+ -70.56755065917969,
+ -70.56755065917969,
+ 60.51472091674805,
+ -47.8821907043457,
+ -60.643272399902344,
+ -60.643272399902344,
+ -47.8821907043457,
+ 68.72557830810547,
+ 68.72557830810547,
+ -47.8821907043457,
+ -47.8821907043457,
+ -60.643272399902344,
+ -60.643272399902344,
+ -47.8821907043457,
+ 68.72557830810547,
+ 68.72557830810547,
+ -47.8821907043457,
+ 60.51472091674805,
+ 16.863798141479492,
+ 16.863798141479492,
+ 60.51472091674805,
+ -70.56755065917969,
+ -70.56755065917969,
+ 60.51472091674805
+ ],
+ "type": "float32"
+ }
+ }
+ ]
+} \ No newline at end of file