sync 2e7068faf55e
Browse files- README.md +76 -0
- build/webgpu/bench.json +114 -0
- build/webgpu/manifest.json +188 -0
- build/webgpu/metadata.json +19 -0
- build/webgpu/pad-quad-vec4.wgsl.jinja +113 -0
- build/webgpu/pad.wgsl.jinja +100 -0
- build/webgpu/test.json +1383 -0
README.md
CHANGED
|
@@ -1,3 +1,79 @@
|
|
| 1 |
---
|
|
|
|
| 2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
library_name: kernels
|
| 3 |
license: apache-2.0
|
| 4 |
+
tags:
|
| 5 |
+
- kernel
|
| 6 |
+
- webgpu
|
| 7 |
+
- wgsl
|
| 8 |
---
|
| 9 |
+
# ai.onnx.Pad
|
| 10 |
+
|
| 11 |
+
`ai.onnx` · standard ONNX operator · ONNX opset ≥ 19
|
| 12 |
+
|
| 13 |
+
## Description
|
| 14 |
+
|
| 15 |
+
Pads a tensor along each axis using one of four modes: `constant` (fill with a scalar value), `reflect` (mirror edge values), `edge` (replicate boundary values), or `wrap` (torus-like wrap-around). Supply the required ONNX `pads` tensor, and optional `axes` tensor when present, through the `pads` request attribute as a full-rank list. Negative counts crop the corresponding edge.
|
| 16 |
+
|
| 17 |
+
See the [ONNX `Pad` spec](https://onnx.ai/onnx/operators/onnx__Pad.html) for the reference semantics.
|
| 18 |
+
|
| 19 |
+
## Inputs
|
| 20 |
+
|
| 21 |
+
| Name | Bind key | Logical dtype | Rank | Shape | Description | Presence |
|
| 22 |
+
| --- | --- | --- | --- | --- | --- | --- |
|
| 23 |
+
| `data` | `data` | `T` | — | — | Input tensor to be padded. | required |
|
| 24 |
+
| `constant_value` | `constant_value` | `T` | `0` | — | Optional scalar value used as the fill constant when `mode` is `constant`; defaults to 0. | optional |
|
| 25 |
+
|
| 26 |
+
## Outputs
|
| 27 |
+
|
| 28 |
+
| Name | Bind key | Logical dtype | Rank | Shape | Description | Presence |
|
| 29 |
+
| --- | --- | --- | --- | --- | --- | --- |
|
| 30 |
+
| `output` | `output` | `T` | same as `data` | — | Tensor after padding, with each axis enlarged by the corresponding begin and end pad counts. | required |
|
| 31 |
+
|
| 32 |
+
## Attributes
|
| 33 |
+
|
| 34 |
+
Attributes and default values (overridable per request):
|
| 35 |
+
|
| 36 |
+
| Attribute | Default | Description |
|
| 37 |
+
| --- | --- | --- |
|
| 38 |
+
| `mode` | `"constant"` | Padding mode: `constant` (default), `reflect`, `edge`, or `wrap`. |
|
| 39 |
+
| `pads` | — | Values of the required `pads` tensor, with an optional `axes` tensor expanded to full rank, supplied as `[x1_begin, ..., xN_begin, x1_end, ..., xN_end]`. |
|
| 40 |
+
|
| 41 |
+
## Type constraints
|
| 42 |
+
|
| 43 |
+
| Variable | Allowed dtypes |
|
| 44 |
+
| --- | --- |
|
| 45 |
+
| `T` | `float32`, `float16`, `uint32`, `int32`, `uint8`, `int8`, `bool` |
|
| 46 |
+
|
| 47 |
+
## Files
|
| 48 |
+
|
| 49 |
+
- [`metadata.json`](build/webgpu/metadata.json) — kernel metadata (id, digests, provenance)
|
| 50 |
+
- [`manifest.json`](build/webgpu/manifest.json) — the op contract (source of truth)
|
| 51 |
+
- [`test.json`](build/webgpu/test.json) — correctness cases
|
| 52 |
+
- [`bench.json`](build/webgpu/bench.json) — benchmark + tuning cases
|
| 53 |
+
- [`pad-quad-vec4.wgsl.jinja`](build/webgpu/pad-quad-vec4.wgsl.jinja)
|
| 54 |
+
- [`pad.wgsl.jinja`](build/webgpu/pad.wgsl.jinja)
|
| 55 |
+
|
| 56 |
+
## Use with `@huggingface/kernels`
|
| 57 |
+
|
| 58 |
+
The loader automatically allocates outputs whose metadata it can derive from the manifest contract and this call.
|
| 59 |
+
|
| 60 |
+
The explicit `outputs` entries provide shape and logical dtype metadata for the results listed below:
|
| 61 |
+
|
| 62 |
+
- `output`
|
| 63 |
+
|
| 64 |
+
Each entry either requests an optional result or supplies metadata that cannot be inferred from the inputs.
|
| 65 |
+
|
| 66 |
+
The `version: 1` option selects the published kernel contract; it is independent of any operator opset, contrib `since_version`, or model version.
|
| 67 |
+
|
| 68 |
+
Replace each `*Data` placeholder with a typed array containing the corresponding input data.
|
| 69 |
+
|
| 70 |
+
```js
|
| 71 |
+
import { getKernel } from "@huggingface/kernels";
|
| 72 |
+
|
| 73 |
+
const kernel = await getKernel("webgpu-kernels/ai.onnx.Pad", { version: 1 });
|
| 74 |
+
// Explicit destinations request optional results or supply metadata that cannot be inferred.
|
| 75 |
+
const { output } = await kernel({ data: { data: dataData, shape: [2] } }, {
|
| 76 |
+
attrs: { pads: [0, 0] },
|
| 77 |
+
outputs: { output: { shape: [2], dtype: "float32" } },
|
| 78 |
+
});
|
| 79 |
+
```
|
build/webgpu/bench.json
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"op": "ai.onnx.Pad",
|
| 3 |
+
"tunableSpace": { "WORKGROUP_SIZE": [64, 128, 256] },
|
| 4 |
+
"cases": [
|
| 5 |
+
{
|
| 6 |
+
"name": "rank4_image",
|
| 7 |
+
"attrs": { "pads": [0, 0, 1, 1, 0, 0, 1, 1] },
|
| 8 |
+
"inputs": { "data": { "dtype": "float32", "shape": [1, 16, 128, 128], "dist": "normal", "seed": 1 } },
|
| 9 |
+
"outputs": { "output": { "dtype": "float32", "shape": [1, 16, 130, 130], "dist": "empty" } },
|
| 10 |
+
"bench": {
|
| 11 |
+
"primary": true,
|
| 12 |
+
"metrics": [{ "type": "bandwidth", "value": "(numel(shapes.data) + numel(shapes.output)) * 4" }]
|
| 13 |
+
}
|
| 14 |
+
},
|
| 15 |
+
{
|
| 16 |
+
"name": "rank4_image_inner_aligned",
|
| 17 |
+
"attrs": { "pads": [0, 0, 1, 1, 0, 0, 1, 1] },
|
| 18 |
+
"inputs": { "data": { "dtype": "float32", "shape": [1, 16, 126, 126], "dist": "normal", "seed": 2 } },
|
| 19 |
+
"outputs": { "output": { "dtype": "float32", "shape": [1, 16, 128, 128], "dist": "empty" } },
|
| 20 |
+
"bench": {
|
| 21 |
+
"primary": true,
|
| 22 |
+
"metrics": [{ "type": "bandwidth", "value": "(numel(shapes.data) + numel(shapes.output)) * 4" }]
|
| 23 |
+
},
|
| 24 |
+
"preset": "smoke"
|
| 25 |
+
},
|
| 26 |
+
{
|
| 27 |
+
"name": "rank3_seq_pad_llm",
|
| 28 |
+
"attrs": { "pads": [0, 0, 0, 0, 64, 0] },
|
| 29 |
+
"inputs": { "data": { "dtype": "float32", "shape": [1, 448, 768], "dist": "normal", "seed": 3 } },
|
| 30 |
+
"outputs": { "output": { "dtype": "float32", "shape": [1, 512, 768], "dist": "empty" } },
|
| 31 |
+
"bench": {
|
| 32 |
+
"primary": true,
|
| 33 |
+
"metrics": [{ "type": "bandwidth", "value": "(numel(shapes.data) + numel(shapes.output)) * 4" }]
|
| 34 |
+
}
|
| 35 |
+
},
|
| 36 |
+
{
|
| 37 |
+
"name": "rank4_image_reflect_inner_aligned",
|
| 38 |
+
"attrs": { "pads": [0, 0, 2, 2, 0, 0, 2, 2], "mode": "reflect" },
|
| 39 |
+
"inputs": { "data": { "dtype": "float32", "shape": [1, 16, 128, 128], "dist": "normal", "seed": 4 } },
|
| 40 |
+
"outputs": { "output": { "dtype": "float32", "shape": [1, 16, 132, 132], "dist": "empty" } },
|
| 41 |
+
"bench": {
|
| 42 |
+
"primary": true,
|
| 43 |
+
"metrics": [{ "type": "bandwidth", "value": "(numel(shapes.data) + numel(shapes.output)) * 4" }]
|
| 44 |
+
}
|
| 45 |
+
},
|
| 46 |
+
{
|
| 47 |
+
"name": "rank4_image_f16_inner_aligned",
|
| 48 |
+
"attrs": { "pads": [0, 0, 1, 1, 0, 0, 1, 1] },
|
| 49 |
+
"inputs": { "data": { "dtype": "float16", "shape": [1, 16, 126, 126], "dist": "normal", "seed": 5 } },
|
| 50 |
+
"outputs": { "output": { "dtype": "float16", "shape": [1, 16, 128, 128], "dist": "empty" } },
|
| 51 |
+
"bench": {
|
| 52 |
+
"primary": true,
|
| 53 |
+
"metrics": [{ "type": "bandwidth", "value": "(numel(shapes.data) + numel(shapes.output)) * 2" }]
|
| 54 |
+
}
|
| 55 |
+
},
|
| 56 |
+
{
|
| 57 |
+
"name": "rank4_image_value_input_inner_aligned",
|
| 58 |
+
"attrs": { "pads": [0, 0, 1, 1, 0, 0, 1, 1] },
|
| 59 |
+
"inputs": {
|
| 60 |
+
"data": { "dtype": "float32", "shape": [1, 16, 126, 126], "dist": "normal", "seed": 6 },
|
| 61 |
+
"constant_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [0.0] } }
|
| 62 |
+
},
|
| 63 |
+
"outputs": { "output": { "dtype": "float32", "shape": [1, 16, 128, 128], "dist": "empty" } },
|
| 64 |
+
"bench": { "metrics": [{ "type": "bandwidth", "value": "(numel(shapes.data) + numel(shapes.output)) * 4" }] }
|
| 65 |
+
},
|
| 66 |
+
{
|
| 67 |
+
"name": "rank4_image_edge_inner_aligned",
|
| 68 |
+
"attrs": { "pads": [0, 0, 1, 1, 0, 0, 1, 1], "mode": "edge" },
|
| 69 |
+
"inputs": { "data": { "dtype": "float32", "shape": [1, 16, 126, 126], "dist": "normal", "seed": 7 } },
|
| 70 |
+
"outputs": { "output": { "dtype": "float32", "shape": [1, 16, 128, 128], "dist": "empty" } },
|
| 71 |
+
"bench": { "metrics": [{ "type": "bandwidth", "value": "(numel(shapes.data) + numel(shapes.output)) * 4" }] }
|
| 72 |
+
},
|
| 73 |
+
{
|
| 74 |
+
"name": "rank4_image_f16_reflect_inner_aligned",
|
| 75 |
+
"attrs": { "pads": [0, 0, 2, 2, 0, 0, 2, 2], "mode": "reflect" },
|
| 76 |
+
"inputs": { "data": { "dtype": "float16", "shape": [1, 16, 128, 128], "dist": "normal", "seed": 8 } },
|
| 77 |
+
"outputs": { "output": { "dtype": "float16", "shape": [1, 16, 132, 132], "dist": "empty" } },
|
| 78 |
+
"bench": { "metrics": [{ "type": "bandwidth", "value": "(numel(shapes.data) + numel(shapes.output)) * 2" }] }
|
| 79 |
+
},
|
| 80 |
+
{
|
| 81 |
+
"name": "rank3_value_input_forces_scalar_path_large",
|
| 82 |
+
"preset": "stress",
|
| 83 |
+
"attrs": { "mode": "constant", "pads": [0, 0, 0, 0, 64, 0] },
|
| 84 |
+
"inputs": {
|
| 85 |
+
"data": { "dtype": "float32", "shape": [8, 448, 768], "dist": "normal", "seed": 11, "scale": 2 },
|
| 86 |
+
"constant_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [0.0] } }
|
| 87 |
+
},
|
| 88 |
+
"outputs": { "output": { "dtype": "float32", "shape": [8, 512, 768], "dist": "empty" } },
|
| 89 |
+
"bench": {
|
| 90 |
+
"primary": true,
|
| 91 |
+
"metrics": [{ "type": "bandwidth", "value": "(numel(shapes.data) + numel(shapes.output)) * 4" }]
|
| 92 |
+
}
|
| 93 |
+
},
|
| 94 |
+
{
|
| 95 |
+
"name": "rank4_edge_inner_unaligned_forces_scalar_path",
|
| 96 |
+
"preset": "stress",
|
| 97 |
+
"attrs": { "mode": "edge", "pads": [0, 0, 1, 1, 0, 0, 1, 1] },
|
| 98 |
+
"inputs": { "data": { "dtype": "float32", "shape": [1, 64, 127, 127], "dist": "normal", "seed": 12, "scale": 2 } },
|
| 99 |
+
"outputs": { "output": { "dtype": "float32", "shape": [1, 64, 129, 129], "dist": "empty" } },
|
| 100 |
+
"bench": { "metrics": [{ "type": "bandwidth", "value": "(numel(shapes.data) + numel(shapes.output)) * 4" }] }
|
| 101 |
+
},
|
| 102 |
+
{
|
| 103 |
+
"name": "rank2_constant_inner_unaligned_forces_scalar_path",
|
| 104 |
+
"preset": "stress",
|
| 105 |
+
"attrs": { "mode": "constant", "pads": [1, 1, 1, 0] },
|
| 106 |
+
"inputs": {
|
| 107 |
+
"data": { "dtype": "float32", "shape": [2046, 1024], "dist": "normal", "seed": 13, "scale": 2 },
|
| 108 |
+
"constant_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [3.0] } }
|
| 109 |
+
},
|
| 110 |
+
"outputs": { "output": { "dtype": "float32", "shape": [2048, 1025], "dist": "empty" } },
|
| 111 |
+
"bench": { "metrics": [{ "type": "bandwidth", "value": "(numel(shapes.data) + numel(shapes.output)) * 4" }] }
|
| 112 |
+
}
|
| 113 |
+
]
|
| 114 |
+
}
|
build/webgpu/manifest.json
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"domain": "ai.onnx",
|
| 3 |
+
"name": "Pad",
|
| 4 |
+
"sinceVersion": 19,
|
| 5 |
+
"description": "Pads a tensor along each axis using one of four modes: `constant` (fill with a scalar value), `reflect` (mirror edge values), `edge` (replicate boundary values), or `wrap` (torus-like wrap-around). Supply the required ONNX `pads` tensor, and optional `axes` tensor when present, through the `pads` request attribute as a full-rank list. Negative counts crop the corresponding edge.",
|
| 6 |
+
"inputs": [
|
| 7 |
+
{ "role": "data", "dtype": "T", "description": "Input tensor to be padded." },
|
| 8 |
+
{
|
| 9 |
+
"role": "constant_value",
|
| 10 |
+
"dtype": "T",
|
| 11 |
+
"rank": 0,
|
| 12 |
+
"optional": true,
|
| 13 |
+
"description": "Optional scalar value used as the fill constant when `mode` is `constant`; defaults to 0."
|
| 14 |
+
}
|
| 15 |
+
],
|
| 16 |
+
"outputs": [
|
| 17 |
+
{
|
| 18 |
+
"role": "output",
|
| 19 |
+
"dtype": "T",
|
| 20 |
+
"description": "Tensor after padding, with each axis enlarged by the corresponding begin and end pad counts.",
|
| 21 |
+
"rank": "ranks.data"
|
| 22 |
+
}
|
| 23 |
+
],
|
| 24 |
+
"attributes": { "mode": "constant" },
|
| 25 |
+
"attributeDescriptions": {
|
| 26 |
+
"pads": "Values of the required `pads` tensor, with an optional `axes` tensor expanded to full rank, supplied as `[x1_begin, ..., xN_begin, x1_end, ..., xN_end]`.",
|
| 27 |
+
"mode": "Padding mode: `constant` (default), `reflect`, `edge`, or `wrap`."
|
| 28 |
+
},
|
| 29 |
+
"attributeConstraints": {
|
| 30 |
+
"pads": { "required": true },
|
| 31 |
+
"mode": { "values": ["constant", "reflect", "edge", "wrap"] }
|
| 32 |
+
},
|
| 33 |
+
"typeConstraints": { "T": ["float32", "float16", "uint32", "int32", "uint8", "int8", "bool"] },
|
| 34 |
+
"args": {
|
| 35 |
+
"data": { "kind": "tensor", "semantic": "data", "role": "input" },
|
| 36 |
+
"constant_value": { "kind": "tensor", "semantic": "constant_value", "role": "constant_value", "required": false },
|
| 37 |
+
"output": { "kind": "tensor", "semantic": "output", "role": "output" }
|
| 38 |
+
},
|
| 39 |
+
"tunables": { "WORKGROUP_SIZE": 256 },
|
| 40 |
+
"derive": {
|
| 41 |
+
"shapeContract": "ranks.data == ranks.output and ranks.output >= 1",
|
| 42 |
+
"defaultValueContract": "not present.constant_value and shapeContract and f16Ok(dtypes.T)",
|
| 43 |
+
"vec4Contract": "defaultValueContract and numel(shapes.output) > 0 and dim(shapes.output, ranks.output - 1) % 4 == 0"
|
| 44 |
+
},
|
| 45 |
+
"constants": { "scalar": "dtypes.T", "usesF16": "dtypes.T == \"f16\"", "mode": "attrs.mode" },
|
| 46 |
+
"bindingSets": {
|
| 47 |
+
"valueInput": [
|
| 48 |
+
{
|
| 49 |
+
"name": "data",
|
| 50 |
+
"arg": "data",
|
| 51 |
+
"semantic": "data",
|
| 52 |
+
"buffer": { "type": "read-only-storage" },
|
| 53 |
+
"elementType": "$scalar"
|
| 54 |
+
},
|
| 55 |
+
{
|
| 56 |
+
"name": "padValue",
|
| 57 |
+
"arg": "constant_value",
|
| 58 |
+
"semantic": "constant_value",
|
| 59 |
+
"buffer": { "type": "read-only-storage" },
|
| 60 |
+
"elementType": "$scalar",
|
| 61 |
+
"length": 1
|
| 62 |
+
},
|
| 63 |
+
{
|
| 64 |
+
"name": "output",
|
| 65 |
+
"arg": "output",
|
| 66 |
+
"semantic": "output",
|
| 67 |
+
"buffer": { "type": "storage" },
|
| 68 |
+
"elementType": "$scalar"
|
| 69 |
+
},
|
| 70 |
+
{
|
| 71 |
+
"name": "params",
|
| 72 |
+
"semantic": "kernel.params",
|
| 73 |
+
"buffer": { "type": "uniform" },
|
| 74 |
+
"struct": { "name": "Params", "fields": [{ "name": "count", "type": "u32", "value": "numel(shapes.output)" }] }
|
| 75 |
+
}
|
| 76 |
+
],
|
| 77 |
+
"copy": [
|
| 78 |
+
{
|
| 79 |
+
"name": "data",
|
| 80 |
+
"arg": "data",
|
| 81 |
+
"semantic": "data",
|
| 82 |
+
"buffer": { "type": "read-only-storage" },
|
| 83 |
+
"elementType": "$scalar"
|
| 84 |
+
},
|
| 85 |
+
{
|
| 86 |
+
"name": "output",
|
| 87 |
+
"arg": "output",
|
| 88 |
+
"semantic": "output",
|
| 89 |
+
"buffer": { "type": "storage" },
|
| 90 |
+
"elementType": "$outputElement"
|
| 91 |
+
}
|
| 92 |
+
],
|
| 93 |
+
"scalarPad": [
|
| 94 |
+
{
|
| 95 |
+
"name": "data",
|
| 96 |
+
"arg": "data",
|
| 97 |
+
"semantic": "data",
|
| 98 |
+
"buffer": { "type": "read-only-storage" },
|
| 99 |
+
"elementType": "$scalar"
|
| 100 |
+
},
|
| 101 |
+
{
|
| 102 |
+
"name": "output",
|
| 103 |
+
"arg": "output",
|
| 104 |
+
"semantic": "output",
|
| 105 |
+
"buffer": { "type": "storage" },
|
| 106 |
+
"elementType": "$scalar"
|
| 107 |
+
},
|
| 108 |
+
{
|
| 109 |
+
"name": "params",
|
| 110 |
+
"semantic": "kernel.params",
|
| 111 |
+
"buffer": { "type": "uniform" },
|
| 112 |
+
"struct": { "name": "Params", "fields": [{ "name": "count", "type": "u32", "value": "numel(shapes.output)" }] }
|
| 113 |
+
}
|
| 114 |
+
]
|
| 115 |
+
},
|
| 116 |
+
"variants": [
|
| 117 |
+
{
|
| 118 |
+
"id": "constant_value_input",
|
| 119 |
+
"priority": 30,
|
| 120 |
+
"when": ["present.constant_value", "numel(shapes.constant_value) == 1", "shapeContract", "f16Ok(dtypes.T)"],
|
| 121 |
+
"constants": { "valueFromInput": true },
|
| 122 |
+
"passes": [
|
| 123 |
+
{
|
| 124 |
+
"id": "main",
|
| 125 |
+
"name": "Pad",
|
| 126 |
+
"source": {
|
| 127 |
+
"shader": "pad.wgsl.jinja",
|
| 128 |
+
"inputs": {
|
| 129 |
+
"dataShape": "shapes.data",
|
| 130 |
+
"outputShape": "shapes.output",
|
| 131 |
+
"rank": "ranks.output",
|
| 132 |
+
"pads": "attrs.pads"
|
| 133 |
+
}
|
| 134 |
+
},
|
| 135 |
+
"bindings": "valueInput",
|
| 136 |
+
"dispatch": { "threads": "numel(shapes.output)", "workgroupSize": "tunables.WORKGROUP_SIZE" }
|
| 137 |
+
}
|
| 138 |
+
]
|
| 139 |
+
},
|
| 140 |
+
{
|
| 141 |
+
"id": "quad_vec4",
|
| 142 |
+
"priority": 11,
|
| 143 |
+
"when": ["vec4Contract"],
|
| 144 |
+
"constants": { "outputElement": "\"vec4<\" ~ dtypes.T ~ \">\"", "vectorScalar": "\"vec4<\" ~ dtypes.T ~ \">\"" },
|
| 145 |
+
"passes": [
|
| 146 |
+
{
|
| 147 |
+
"id": "main",
|
| 148 |
+
"name": "Pad.quadVec4",
|
| 149 |
+
"source": {
|
| 150 |
+
"shader": "pad-quad-vec4.wgsl.jinja",
|
| 151 |
+
"inputs": {
|
| 152 |
+
"dataShape": "shapes.data",
|
| 153 |
+
"outputShape": "shapes.output",
|
| 154 |
+
"rank": "ranks.output",
|
| 155 |
+
"pads": "attrs.pads",
|
| 156 |
+
"value": 0
|
| 157 |
+
}
|
| 158 |
+
},
|
| 159 |
+
"bindings": "copy",
|
| 160 |
+
"dispatch": { "gridStride": "numel(shapes.output) / 4", "workgroupSize": "tunables.WORKGROUP_SIZE" }
|
| 161 |
+
}
|
| 162 |
+
]
|
| 163 |
+
},
|
| 164 |
+
{
|
| 165 |
+
"id": "constant_rank1_to_4",
|
| 166 |
+
"when": ["defaultValueContract"],
|
| 167 |
+
"constants": { "valueFromInput": false },
|
| 168 |
+
"passes": [
|
| 169 |
+
{
|
| 170 |
+
"id": "main",
|
| 171 |
+
"name": "Pad",
|
| 172 |
+
"source": {
|
| 173 |
+
"shader": "pad.wgsl.jinja",
|
| 174 |
+
"inputs": {
|
| 175 |
+
"dataShape": "shapes.data",
|
| 176 |
+
"outputShape": "shapes.output",
|
| 177 |
+
"rank": "ranks.output",
|
| 178 |
+
"pads": "attrs.pads",
|
| 179 |
+
"value": 0
|
| 180 |
+
}
|
| 181 |
+
},
|
| 182 |
+
"bindings": "scalarPad",
|
| 183 |
+
"dispatch": { "threads": "numel(shapes.output)", "workgroupSize": "tunables.WORKGROUP_SIZE" }
|
| 184 |
+
}
|
| 185 |
+
]
|
| 186 |
+
}
|
| 187 |
+
]
|
| 188 |
+
}
|
build/webgpu/metadata.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "ai.onnx.Pad",
|
| 3 |
+
"id": "_ai_onnx_pad_webgpu_f677a1e",
|
| 4 |
+
"version": 1,
|
| 5 |
+
"license": "Apache-2.0",
|
| 6 |
+
"backend": { "type": "webgpu" },
|
| 7 |
+
"digest": {
|
| 8 |
+
"algorithm": "sha256",
|
| 9 |
+
"files": {
|
| 10 |
+
"bench.json": "c5OFqXWDpHEMBxvQhbwziuREKzcvtHq7AD3mAWc/O/w=",
|
| 11 |
+
"manifest.json": "LdYMiDSOmaf3p/AM+35OYK9r6K9ujcB5KaVJwyW/gWc=",
|
| 12 |
+
"pad-quad-vec4.wgsl.jinja": "1CGMCSmy+Suuii9slZko0MXqHiIf0+iAb8UjG/mKLkU=",
|
| 13 |
+
"pad.wgsl.jinja": "/dyKjV18AkgaduRKI8SGVZz6qhpg3i/XVAj4IROc5r8=",
|
| 14 |
+
"test.json": "9NikPawZjt0OZY+069sKOCAJ/K5Xc7F6usOSJ6TrvpE="
|
| 15 |
+
}
|
| 16 |
+
},
|
| 17 |
+
"provenance": { "kernel": { "sha": "2e7068faf55e7f43df740015f6d1ee49391a41c5", "dirty": false } },
|
| 18 |
+
"webgpu": { "manifestSpec": "1.0", "specialized": true, "opPath": "ops/ai.onnx.Pad" }
|
| 19 |
+
}
|
build/webgpu/pad-quad-vec4.wgsl.jinja
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Vec4 form for outputs whose innermost dimension is four-aligned. One invocation
|
| 2 |
+
// handles four consecutive innermost elements and decomposes the outer
|
| 3 |
+
// coordinates once; only the innermost axis runs map_coord per element. This
|
| 4 |
+
// supports constant, edge, reflect, and wrap modes.
|
| 5 |
+
//
|
| 6 |
+
// map_coord returns -1 outside bounds in constant mode and for empty extents.
|
| 7 |
+
// Its reflect period and crop_start/sliced_dim arithmetic define the exact
|
| 8 |
+
// coordinate mapping.
|
| 9 |
+
{% if usesF16 %}
|
| 10 |
+
enable f16;
|
| 11 |
+
{% endif %}
|
| 12 |
+
{{ env.wgsl.resourceDeclarations }}
|
| 13 |
+
|
| 14 |
+
{% set rank = source.rank %}
|
| 15 |
+
fn map_coord(coord: i32, dim: i32) -> i32 {
|
| 16 |
+
if (coord >= 0i && coord < dim) {
|
| 17 |
+
return coord;
|
| 18 |
+
}
|
| 19 |
+
{% if mode == "constant" %}
|
| 20 |
+
return -1i;
|
| 21 |
+
{% elif mode == "edge" %}
|
| 22 |
+
if (dim <= 0i) {
|
| 23 |
+
return -1i;
|
| 24 |
+
}
|
| 25 |
+
return min(max(coord, 0i), dim - 1i);
|
| 26 |
+
{% elif mode == "wrap" %}
|
| 27 |
+
if (dim <= 0i) {
|
| 28 |
+
return -1i;
|
| 29 |
+
}
|
| 30 |
+
return ((coord % dim) + dim) % dim;
|
| 31 |
+
{% else %}
|
| 32 |
+
if (dim < 2i) {
|
| 33 |
+
return -1i;
|
| 34 |
+
}
|
| 35 |
+
let period = 2i * dim - 2i;
|
| 36 |
+
let wrapped = ((coord % period) + period) % period;
|
| 37 |
+
if (wrapped < dim) {
|
| 38 |
+
return wrapped;
|
| 39 |
+
}
|
| 40 |
+
return period - wrapped;
|
| 41 |
+
{% endif %}
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
{% set countVecs = namespace(value=1) %}
|
| 45 |
+
{% for j in range(rank) %}
|
| 46 |
+
{% set countVecs.value = countVecs.value * source.outputShape[j] %}
|
| 47 |
+
{% endfor %}
|
| 48 |
+
{% set countVecs.value = ((countVecs.value / 4) | int) %}
|
| 49 |
+
{% set lastPre = source.pads[rank - 1] %}
|
| 50 |
+
{% set lastPost = source.pads[2 * rank - 1] %}
|
| 51 |
+
{% set lastCrop = (0 - lastPre) if lastPre < 0 else 0 %}
|
| 52 |
+
{% set lastTrim = (0 - lastPost) if lastPost < 0 else 0 %}
|
| 53 |
+
{% set lastSlicedRaw = source.dataShape[rank - 1] - lastCrop - lastTrim %}
|
| 54 |
+
{% set lastSliced = lastSlicedRaw if lastSlicedRaw > 0 else 0 %}
|
| 55 |
+
{% set lastPad = lastPre if lastPre > 0 else 0 %}
|
| 56 |
+
const COUNT: u32 = {{ countVecs.value }}u;
|
| 57 |
+
const WG: u32 = {{ tunables.WORKGROUP_SIZE }}u;
|
| 58 |
+
const OUT_W_VECS: u32 = {{ ((source.outputShape[rank - 1] / 4) | int) }}u;
|
| 59 |
+
const PAD_W: i32 = {{ lastPad }}i;
|
| 60 |
+
const CROP_W: i32 = {{ lastCrop }}i;
|
| 61 |
+
const SLICED_W: i32 = {{ lastSliced }}i;
|
| 62 |
+
|
| 63 |
+
@compute @workgroup_size({{ tunables.WORKGROUP_SIZE }})
|
| 64 |
+
fn main(
|
| 65 |
+
@builtin(global_invocation_id) gid: vec3<u32>,
|
| 66 |
+
@builtin(num_workgroups) nwg: vec3<u32>
|
| 67 |
+
) {
|
| 68 |
+
let fill = {{ scalar }}({{ source.value }});
|
| 69 |
+
let stride = nwg.x * WG;
|
| 70 |
+
for (var v = gid.x; v < COUNT; v += stride) {
|
| 71 |
+
let ow0 = i32((v % OUT_W_VECS) * 4u);
|
| 72 |
+
{% if rank > 1 %}
|
| 73 |
+
var rem = v / OUT_W_VECS;
|
| 74 |
+
{% endif %}
|
| 75 |
+
var srcBase = 0i;
|
| 76 |
+
var outerValid = true;
|
| 77 |
+
{% for axis in range(rank - 1) %}
|
| 78 |
+
{% set ostride = namespace(value=1) %}
|
| 79 |
+
{% for j in range(axis + 1, rank - 1) %}
|
| 80 |
+
{% set ostride.value = ostride.value * source.outputShape[j] %}
|
| 81 |
+
{% endfor %}
|
| 82 |
+
{% set safeOStride = ostride.value %}
|
| 83 |
+
{% set dstride = namespace(value=1) %}
|
| 84 |
+
{% for j in range(axis + 1, rank) %}
|
| 85 |
+
{% set dstride.value = dstride.value * source.dataShape[j] %}
|
| 86 |
+
{% endfor %}
|
| 87 |
+
{% set pre = source.pads[axis] %}
|
| 88 |
+
{% set post = source.pads[axis + rank] %}
|
| 89 |
+
{% set crop = (0 - pre) if pre < 0 else 0 %}
|
| 90 |
+
{% set trim = (0 - post) if post < 0 else 0 %}
|
| 91 |
+
{% set slicedRaw = source.dataShape[axis] - crop - trim %}
|
| 92 |
+
{% set sliced = slicedRaw if slicedRaw > 0 else 0 %}
|
| 93 |
+
{% set padBefore = pre if pre > 0 else 0 %}
|
| 94 |
+
let out_coord{{ axis }} = i32(rem / {{ safeOStride }}u);
|
| 95 |
+
rem = rem % {{ safeOStride }}u;
|
| 96 |
+
let mapped{{ axis }} = map_coord(out_coord{{ axis }} - {{ padBefore }}i, {{ sliced }}i);
|
| 97 |
+
outerValid = outerValid && (mapped{{ axis }} >= 0i);
|
| 98 |
+
srcBase += (mapped{{ axis }} + {{ crop }}i) * {{ dstride.value }}i;
|
| 99 |
+
{% endfor %}
|
| 100 |
+
var result = {{ vectorScalar }}(fill);
|
| 101 |
+
if (outerValid) {
|
| 102 |
+
let m0 = map_coord(ow0 - PAD_W, SLICED_W);
|
| 103 |
+
let m1 = map_coord(ow0 + 1i - PAD_W, SLICED_W);
|
| 104 |
+
let m2 = map_coord(ow0 + 2i - PAD_W, SLICED_W);
|
| 105 |
+
let m3 = map_coord(ow0 + 3i - PAD_W, SLICED_W);
|
| 106 |
+
if (m0 >= 0i) { result.x = data[u32(srcBase + m0 + CROP_W)]; }
|
| 107 |
+
if (m1 >= 0i) { result.y = data[u32(srcBase + m1 + CROP_W)]; }
|
| 108 |
+
if (m2 >= 0i) { result.z = data[u32(srcBase + m2 + CROP_W)]; }
|
| 109 |
+
if (m3 >= 0i) { result.w = data[u32(srcBase + m3 + CROP_W)]; }
|
| 110 |
+
}
|
| 111 |
+
output[v] = result;
|
| 112 |
+
}
|
| 113 |
+
}
|
build/webgpu/pad.wgsl.jinja
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% if usesF16 %}
|
| 2 |
+
enable f16;
|
| 3 |
+
{% endif %}
|
| 4 |
+
{{ env.wgsl.resourceDeclarations }}
|
| 5 |
+
|
| 6 |
+
fn map_coord(coord: i32, dim: i32) -> i32 {
|
| 7 |
+
if (coord >= 0i && coord < dim) {
|
| 8 |
+
return coord;
|
| 9 |
+
}
|
| 10 |
+
{% if mode == "constant" %}
|
| 11 |
+
return -1i;
|
| 12 |
+
{% elif mode == "edge" %}
|
| 13 |
+
if (dim <= 0i) {
|
| 14 |
+
return -1i;
|
| 15 |
+
}
|
| 16 |
+
return min(max(coord, 0i), dim - 1i);
|
| 17 |
+
{% elif mode == "wrap" %}
|
| 18 |
+
if (dim <= 0i) {
|
| 19 |
+
return -1i;
|
| 20 |
+
}
|
| 21 |
+
return ((coord % dim) + dim) % dim;
|
| 22 |
+
{% else %}
|
| 23 |
+
if (dim < 2i) {
|
| 24 |
+
return -1i;
|
| 25 |
+
}
|
| 26 |
+
let period = 2i * dim - 2i;
|
| 27 |
+
let wrapped = ((coord % period) + period) % period;
|
| 28 |
+
if (wrapped < dim) {
|
| 29 |
+
return wrapped;
|
| 30 |
+
}
|
| 31 |
+
return period - wrapped;
|
| 32 |
+
{% endif %}
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
fn data_offset_or_invalid(out_index: u32) -> i32 {
|
| 36 |
+
var rem = out_index;
|
| 37 |
+
var offset = 0i;
|
| 38 |
+
{% for axis in range(source.rank) %}
|
| 39 |
+
{% set out_stride = namespace(value=1) %}
|
| 40 |
+
{% for j in range(axis + 1, source.rank) %}
|
| 41 |
+
{% set out_stride.value = out_stride.value * source.outputShape[j] %}
|
| 42 |
+
{% endfor %}
|
| 43 |
+
{% set out_stride_divisor = out_stride.value if out_stride.value != 0 else 1 %}
|
| 44 |
+
{% set data_stride = namespace(value=1) %}
|
| 45 |
+
{% for j in range(axis + 1, source.rank) %}
|
| 46 |
+
{% set data_stride.value = data_stride.value * source.dataShape[j] %}
|
| 47 |
+
{% endfor %}
|
| 48 |
+
{% set pre = source.pads[axis] %}
|
| 49 |
+
{% set post = source.pads[axis + source.rank] %}
|
| 50 |
+
{% if pre < 0 %}
|
| 51 |
+
{% set crop_start = 0 - pre %}
|
| 52 |
+
{% else %}
|
| 53 |
+
{% set crop_start = 0 %}
|
| 54 |
+
{% endif %}
|
| 55 |
+
{% if post < 0 %}
|
| 56 |
+
{% set crop_end_trim = 0 - post %}
|
| 57 |
+
{% else %}
|
| 58 |
+
{% set crop_end_trim = 0 %}
|
| 59 |
+
{% endif %}
|
| 60 |
+
{% set crop_end = source.dataShape[axis] - crop_end_trim %}
|
| 61 |
+
{% set sliced_dim = crop_end - crop_start %}
|
| 62 |
+
{% if sliced_dim < 0 %}
|
| 63 |
+
{% set sliced_dim = 0 %}
|
| 64 |
+
{% endif %}
|
| 65 |
+
{% if pre > 0 %}
|
| 66 |
+
{% set pad_before = pre %}
|
| 67 |
+
{% else %}
|
| 68 |
+
{% set pad_before = 0 %}
|
| 69 |
+
{% endif %}
|
| 70 |
+
let out_coord{{ axis }} = i32(rem / {{ out_stride_divisor }}u);
|
| 71 |
+
rem = rem % {{ out_stride_divisor }}u;
|
| 72 |
+
let mapped_coord{{ axis }} = map_coord(out_coord{{ axis }} - {{ pad_before }}i, {{ sliced_dim }}i);
|
| 73 |
+
if (mapped_coord{{ axis }} < 0i) {
|
| 74 |
+
return -1i;
|
| 75 |
+
}
|
| 76 |
+
let in_coord{{ axis }} = mapped_coord{{ axis }} + {{ crop_start }}i;
|
| 77 |
+
offset = offset + in_coord{{ axis }} * {{ data_stride.value }}i;
|
| 78 |
+
{% endfor %}
|
| 79 |
+
return offset;
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
@compute @workgroup_size({{ tunables.WORKGROUP_SIZE }})
|
| 83 |
+
fn main(@builtin(global_invocation_id) gid: vec3<u32>, @builtin(num_workgroups) nwg: vec3<u32>) {
|
| 84 |
+
// 2D-folded flat index: gid.y carries the high bits past the
|
| 85 |
+
// maxComputeWorkgroupsPerDimension limit.
|
| 86 |
+
let i = gid.x + gid.y * nwg.x * {{ tunables.WORKGROUP_SIZE }}u;
|
| 87 |
+
if (i >= params.count) {
|
| 88 |
+
return;
|
| 89 |
+
}
|
| 90 |
+
let src = data_offset_or_invalid(i);
|
| 91 |
+
if (src < 0i) {
|
| 92 |
+
{% if valueFromInput %}
|
| 93 |
+
output[i] = padValue[0];
|
| 94 |
+
{% else %}
|
| 95 |
+
output[i] = {{ scalar }}({{ source.value }});
|
| 96 |
+
{% endif %}
|
| 97 |
+
} else {
|
| 98 |
+
output[i] = data[u32(src)];
|
| 99 |
+
}
|
| 100 |
+
}
|
build/webgpu/test.json
ADDED
|
@@ -0,0 +1,1383 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"op": "ai.onnx.Pad",
|
| 3 |
+
"fixtureArrays": {
|
| 4 |
+
"onnx_backend_constant_pad_input_data": [1.764052391052246, 0.40015721321105957, 0.978738009929657, 2.2408931255340576, 1.8675580024719238, -0.9772778749465942, 0.9500884413719177, -0.15135720372200012, -0.10321885347366333, 0.4105985164642334, 0.14404356479644775, 1.4542734622955322, 0.7610377073287964, 0.12167501449584961, 0.44386324286460876, 0.3336743414402008, 1.4940791130065918, -0.2051582634449005, 0.3130677044391632, -0.8540957570075989, -2.5529897212982178, 0.653618574142456, 0.8644362092018127, -0.7421650290489197, 2.269754648208618, -1.4543657302856445, 0.04575851559638977, -0.18718385696411133, 1.5327792167663574, 1.4693588018417358, 0.154947429895401, 0.37816253304481506, -0.8877857327461243, -1.980796456336975, -0.34791216254234314, 0.15634897351264954, 1.2302906513214111, 1.202379822731018, -0.38732680678367615, -0.302302747964859, -1.0485529899597168, -1.420017957687378, -1.7062702178955078, 1.950775384902954, -0.5096521973609924, -0.4380742907524109, -1.2527953386306763, 0.7774903774261475, -1.6138978004455566, -0.21274028718471527, -0.8954665660858154, 0.38690251111984253, -0.5108051300048828, -1.18063223361969, -0.02818222902715206, 0.4283318817615509, 0.06651721894741058, 0.30247190594673157, -0.6343221068382263, -0.3627411723136902]
|
| 5 |
+
},
|
| 6 |
+
"cases": [
|
| 7 |
+
{
|
| 8 |
+
"name": "rank2_constant",
|
| 9 |
+
"attrs": { "pads": [1, 2, 1, 0] },
|
| 10 |
+
"inputs": {
|
| 11 |
+
"data": {
|
| 12 |
+
"dtype": "float32",
|
| 13 |
+
"shape": [2, 3],
|
| 14 |
+
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] }
|
| 15 |
+
},
|
| 16 |
+
"constant_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [-1.0] } }
|
| 17 |
+
},
|
| 18 |
+
"outputs": { "output": { "dtype": "float32", "shape": [4, 5] } }
|
| 19 |
+
},
|
| 20 |
+
{
|
| 21 |
+
"name": "rank4_f16",
|
| 22 |
+
"attrs": { "pads": [0, 0, 1, 1, 0, 0, 1, 1] },
|
| 23 |
+
"inputs": { "data": { "dtype": "float16", "shape": [1, 1, 2, 2] } },
|
| 24 |
+
"outputs": { "output": { "dtype": "float16", "shape": [1, 1, 4, 4] } },
|
| 25 |
+
"tolerance": 0.001
|
| 26 |
+
},
|
| 27 |
+
{
|
| 28 |
+
"name": "ort_value_input_constant_1d",
|
| 29 |
+
"provenance": {
|
| 30 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 31 |
+
"test": "PadOpTest.Pad_Constant_1D",
|
| 32 |
+
"notes": "Uses Pad's optional `constant_value` input. Pads remain the synthesized attrs.pads initializer; the constant_value_input route consumes the `constant_value` tensor directly."
|
| 33 |
+
},
|
| 34 |
+
"attrs": { "mode": "constant", "pads": [1, 2] },
|
| 35 |
+
"inputs": {
|
| 36 |
+
"data": { "dtype": "float32", "shape": [2], "data": { "kind": "values", "values": [1.0, 2.0] } },
|
| 37 |
+
"constant_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [123.0] } }
|
| 38 |
+
},
|
| 39 |
+
"outputs": { "output": { "dtype": "float32", "shape": [5], "tolerance": 0 } }
|
| 40 |
+
},
|
| 41 |
+
{
|
| 42 |
+
"name": "value_input_float16_constant_1d",
|
| 43 |
+
"attrs": { "mode": "constant", "pads": [1, 2] },
|
| 44 |
+
"inputs": {
|
| 45 |
+
"data": { "dtype": "float16", "shape": [2], "data": { "kind": "values", "values": [1.5, -2.0] } },
|
| 46 |
+
"constant_value": { "dtype": "float16", "shape": [], "data": { "kind": "values", "values": [-3.5] } }
|
| 47 |
+
},
|
| 48 |
+
"outputs": {
|
| 49 |
+
"output": {
|
| 50 |
+
"dtype": "float16",
|
| 51 |
+
"shape": [5],
|
| 52 |
+
"tolerance": 0,
|
| 53 |
+
"data": { "kind": "values", "values": [-3.5, 1.5, -2.0, -3.5, -3.5] }
|
| 54 |
+
}
|
| 55 |
+
}
|
| 56 |
+
},
|
| 57 |
+
{
|
| 58 |
+
"name": "value_input_int8_constant_1d",
|
| 59 |
+
"attrs": { "mode": "constant", "pads": [1, 1] },
|
| 60 |
+
"inputs": {
|
| 61 |
+
"data": { "dtype": "int8", "shape": [2], "data": { "kind": "values", "values": [-128, 127] } },
|
| 62 |
+
"constant_value": { "dtype": "int8", "shape": [], "data": { "kind": "values", "values": [-7] } }
|
| 63 |
+
},
|
| 64 |
+
"outputs": {
|
| 65 |
+
"output": {
|
| 66 |
+
"dtype": "int8",
|
| 67 |
+
"shape": [4],
|
| 68 |
+
"tolerance": 0,
|
| 69 |
+
"data": { "kind": "values", "values": [-7, -128, 127, -7] }
|
| 70 |
+
}
|
| 71 |
+
}
|
| 72 |
+
},
|
| 73 |
+
{
|
| 74 |
+
"name": "value_input_uint8_constant_1d",
|
| 75 |
+
"attrs": { "mode": "constant", "pads": [1, 1] },
|
| 76 |
+
"inputs": {
|
| 77 |
+
"data": { "dtype": "uint8", "shape": [2], "data": { "kind": "values", "values": [0, 255] } },
|
| 78 |
+
"constant_value": { "dtype": "uint8", "shape": [], "data": { "kind": "values", "values": [173] } }
|
| 79 |
+
},
|
| 80 |
+
"outputs": {
|
| 81 |
+
"output": {
|
| 82 |
+
"dtype": "uint8",
|
| 83 |
+
"shape": [4],
|
| 84 |
+
"tolerance": 0,
|
| 85 |
+
"data": { "kind": "values", "values": [173, 0, 255, 173] }
|
| 86 |
+
}
|
| 87 |
+
}
|
| 88 |
+
},
|
| 89 |
+
{
|
| 90 |
+
"name": "value_input_bool_constant_1d",
|
| 91 |
+
"attrs": { "mode": "constant", "pads": [1, 1] },
|
| 92 |
+
"inputs": {
|
| 93 |
+
"data": { "dtype": "bool", "shape": [2], "data": { "kind": "values", "values": [0, 1] } },
|
| 94 |
+
"constant_value": { "dtype": "bool", "shape": [], "data": { "kind": "values", "values": [1] } }
|
| 95 |
+
},
|
| 96 |
+
"outputs": {
|
| 97 |
+
"output": {
|
| 98 |
+
"dtype": "bool",
|
| 99 |
+
"shape": [4],
|
| 100 |
+
"tolerance": 0,
|
| 101 |
+
"data": { "kind": "values", "values": [1, 0, 1, 1] }
|
| 102 |
+
}
|
| 103 |
+
}
|
| 104 |
+
},
|
| 105 |
+
{
|
| 106 |
+
"name": "ort_int32_value_input_constant_1d",
|
| 107 |
+
"provenance": {
|
| 108 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 109 |
+
"test": "PadOpTest.Pad_Constant_1D",
|
| 110 |
+
"notes": "Typed ORT int32 case using Pad's optional `constant_value` input. Pads remain attrs.pads; the constant_value_input route consumes the `constant_value` tensor directly."
|
| 111 |
+
},
|
| 112 |
+
"attrs": { "mode": "constant", "pads": [1, 2] },
|
| 113 |
+
"inputs": {
|
| 114 |
+
"data": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [1, 2] } },
|
| 115 |
+
"constant_value": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [123] } }
|
| 116 |
+
},
|
| 117 |
+
"outputs": { "output": { "dtype": "int32", "shape": [5], "tolerance": 0 } }
|
| 118 |
+
},
|
| 119 |
+
{
|
| 120 |
+
"name": "ort_bool_constant_pad_axis1",
|
| 121 |
+
"provenance": { "source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc", "test": "PadOpTest.BoolType" },
|
| 122 |
+
"attrs": { "mode": "constant", "pads": [0, 2, 0, 0] },
|
| 123 |
+
"inputs": {
|
| 124 |
+
"data": { "dtype": "bool", "shape": [3, 2], "data": { "kind": "values", "values": [1, 0, 1, 0, 1, 0] } },
|
| 125 |
+
"constant_value": { "dtype": "bool", "shape": [], "data": { "kind": "values", "values": [1] } }
|
| 126 |
+
},
|
| 127 |
+
"outputs": {
|
| 128 |
+
"output": {
|
| 129 |
+
"dtype": "bool",
|
| 130 |
+
"shape": [3, 4],
|
| 131 |
+
"tolerance": 0,
|
| 132 |
+
"data": { "kind": "values", "values": [1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0] }
|
| 133 |
+
}
|
| 134 |
+
}
|
| 135 |
+
},
|
| 136 |
+
{
|
| 137 |
+
"name": "ort_constant_pad_axes_out_of_order_rank4",
|
| 138 |
+
"provenance": {
|
| 139 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 140 |
+
"test": "PadOpTest.ConstantPadAxesOutOfOrder",
|
| 141 |
+
"notes": "ORT supplies axes=[3,2] with pads=[1,0,1,0]; this framework represents the equivalent full-rank pads attribute."
|
| 142 |
+
},
|
| 143 |
+
"attrs": { "pads": [0, 0, 0, 1, 0, 0, 0, 1] },
|
| 144 |
+
"inputs": {
|
| 145 |
+
"data": {
|
| 146 |
+
"dtype": "float32",
|
| 147 |
+
"shape": [1, 2, 2, 2],
|
| 148 |
+
"data": { "kind": "values", "values": [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] }
|
| 149 |
+
}
|
| 150 |
+
},
|
| 151 |
+
"outputs": {
|
| 152 |
+
"output": {
|
| 153 |
+
"dtype": "float32",
|
| 154 |
+
"shape": [1, 2, 2, 4],
|
| 155 |
+
"tolerance": 0,
|
| 156 |
+
"data": {
|
| 157 |
+
"kind": "values",
|
| 158 |
+
"values": [0.0, 1.0, 1.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 1.0, 1.0, 0.0]
|
| 159 |
+
}
|
| 160 |
+
}
|
| 161 |
+
}
|
| 162 |
+
},
|
| 163 |
+
{
|
| 164 |
+
"name": "ort_constant_pad_axes_int32_axis1_axis3",
|
| 165 |
+
"provenance": {
|
| 166 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 167 |
+
"test": "PadOpTest.ConstantPadAxes",
|
| 168 |
+
"notes": "ORT supplies axes=[1,3] with pads=[0,1,0,1]; this framework represents the equivalent full-rank pads attribute."
|
| 169 |
+
},
|
| 170 |
+
"attrs": { "pads": [0, 0, 0, 1, 0, 0, 0, 1] },
|
| 171 |
+
"inputs": {
|
| 172 |
+
"data": {
|
| 173 |
+
"dtype": "int32",
|
| 174 |
+
"shape": [1, 2, 2, 2],
|
| 175 |
+
"data": { "kind": "values", "values": [1, 1, 1, 1, 1, 1, 1, 1] }
|
| 176 |
+
}
|
| 177 |
+
},
|
| 178 |
+
"outputs": { "output": { "dtype": "int32", "shape": [1, 2, 2, 4], "tolerance": 0 } }
|
| 179 |
+
},
|
| 180 |
+
{
|
| 181 |
+
"name": "ort_constant_pad_axes_last_two_both_sides",
|
| 182 |
+
"provenance": {
|
| 183 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 184 |
+
"test": "PadOpTest.ConstantPadAxesTest2",
|
| 185 |
+
"notes": "ORT supplies axes=[2,3] with pads=[1,1,1,1]; this framework represents the equivalent full-rank pads attribute."
|
| 186 |
+
},
|
| 187 |
+
"attrs": { "pads": [0, 0, 1, 1, 0, 0, 1, 1] },
|
| 188 |
+
"inputs": {
|
| 189 |
+
"data": {
|
| 190 |
+
"dtype": "float32",
|
| 191 |
+
"shape": [1, 2, 2, 2],
|
| 192 |
+
"data": { "kind": "values", "values": [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] }
|
| 193 |
+
}
|
| 194 |
+
},
|
| 195 |
+
"outputs": { "output": { "dtype": "float32", "shape": [1, 2, 4, 4], "tolerance": 0 } }
|
| 196 |
+
},
|
| 197 |
+
{
|
| 198 |
+
"name": "ort_constant_pad_full_rank_without_axes",
|
| 199 |
+
"provenance": {
|
| 200 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 201 |
+
"test": "PadOpTest.ConstantPadAxesTest4",
|
| 202 |
+
"notes": "ORT ConstantPadNegativeAxes, ConstantPadAxesTest1/Test3, and ConstantPadAxesWithOneDimensionSpecified project to this same full-rank pads request."
|
| 203 |
+
},
|
| 204 |
+
"attrs": { "pads": [0, 0, 0, 1, 0, 0, 0, 1] },
|
| 205 |
+
"inputs": {
|
| 206 |
+
"data": {
|
| 207 |
+
"dtype": "float32",
|
| 208 |
+
"shape": [1, 2, 2, 2],
|
| 209 |
+
"data": { "kind": "values", "values": [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] }
|
| 210 |
+
}
|
| 211 |
+
},
|
| 212 |
+
"outputs": { "output": { "dtype": "float32", "shape": [1, 2, 2, 4], "tolerance": 0 } }
|
| 213 |
+
},
|
| 214 |
+
{
|
| 215 |
+
"name": "rank5_constant",
|
| 216 |
+
"attrs": { "pads": [0, 1, 0, 1, 0, 0, 0, 1, 0, 1] },
|
| 217 |
+
"inputs": {
|
| 218 |
+
"data": {
|
| 219 |
+
"dtype": "float32",
|
| 220 |
+
"shape": [1, 2, 1, 2, 1],
|
| 221 |
+
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.19 }
|
| 222 |
+
},
|
| 223 |
+
"constant_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [-2.0] } }
|
| 224 |
+
},
|
| 225 |
+
"outputs": { "output": { "dtype": "float32", "shape": [1, 3, 2, 3, 2], "tolerance": 0.000001 } }
|
| 226 |
+
},
|
| 227 |
+
{
|
| 228 |
+
"name": "rank6_constant",
|
| 229 |
+
"attrs": { "pads": [0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1] },
|
| 230 |
+
"inputs": {
|
| 231 |
+
"data": {
|
| 232 |
+
"dtype": "float32",
|
| 233 |
+
"shape": [1, 2, 1, 2, 1, 2],
|
| 234 |
+
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.19 }
|
| 235 |
+
},
|
| 236 |
+
"constant_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [7.0] } }
|
| 237 |
+
},
|
| 238 |
+
"outputs": { "output": { "dtype": "float32", "shape": [1, 3, 2, 2, 2, 3], "tolerance": 0.000001 } }
|
| 239 |
+
},
|
| 240 |
+
{
|
| 241 |
+
"name": "backend_spec_example_axis1_zero",
|
| 242 |
+
"provenance": {
|
| 243 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 244 |
+
"test": "PadOpTest.Pad_Spec_Example"
|
| 245 |
+
},
|
| 246 |
+
"attrs": { "pads": [0, 2, 0, 0] },
|
| 247 |
+
"inputs": {
|
| 248 |
+
"data": {
|
| 249 |
+
"dtype": "float32",
|
| 250 |
+
"shape": [3, 2],
|
| 251 |
+
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] }
|
| 252 |
+
}
|
| 253 |
+
},
|
| 254 |
+
"outputs": { "output": { "dtype": "float32", "shape": [3, 4], "tolerance": 0.000001 } }
|
| 255 |
+
},
|
| 256 |
+
{
|
| 257 |
+
"name": "ort_constant_1d",
|
| 258 |
+
"provenance": {
|
| 259 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 260 |
+
"test": "PadOpTest.Pad_Constant_1D"
|
| 261 |
+
},
|
| 262 |
+
"attrs": { "pads": [1, 2] },
|
| 263 |
+
"inputs": {
|
| 264 |
+
"data": { "dtype": "float32", "shape": [2], "data": { "kind": "values", "values": [1.0, 2.0] } },
|
| 265 |
+
"constant_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [123.0] } }
|
| 266 |
+
},
|
| 267 |
+
"outputs": { "output": { "dtype": "float32", "shape": [5], "tolerance": 0.000001 } }
|
| 268 |
+
},
|
| 269 |
+
{
|
| 270 |
+
"name": "ort_constant_1d_zero_pads",
|
| 271 |
+
"provenance": {
|
| 272 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 273 |
+
"test": "PadOpTest.Pad_Constant_1D_Zero"
|
| 274 |
+
},
|
| 275 |
+
"attrs": { "pads": [0, 0] },
|
| 276 |
+
"inputs": {
|
| 277 |
+
"data": { "dtype": "float32", "shape": [2], "data": { "kind": "values", "values": [1.0, 2.0] } },
|
| 278 |
+
"constant_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [123.0] } }
|
| 279 |
+
},
|
| 280 |
+
"outputs": { "output": { "dtype": "float32", "shape": [2], "tolerance": 0.000001 } }
|
| 281 |
+
},
|
| 282 |
+
{
|
| 283 |
+
"name": "ort_constant_2d",
|
| 284 |
+
"provenance": {
|
| 285 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 286 |
+
"test": "PadOpTest.Pad_Constant_2D"
|
| 287 |
+
},
|
| 288 |
+
"attrs": { "pads": [1, 2, 1, 2] },
|
| 289 |
+
"inputs": {
|
| 290 |
+
"data": {
|
| 291 |
+
"dtype": "float32",
|
| 292 |
+
"shape": [2, 2],
|
| 293 |
+
"data": { "kind": "values", "values": [11.0, 21.0, 12.0, 22.0] }
|
| 294 |
+
},
|
| 295 |
+
"constant_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [123.0] } }
|
| 296 |
+
},
|
| 297 |
+
"outputs": { "output": { "dtype": "float32", "shape": [4, 6], "tolerance": 0.000001 } }
|
| 298 |
+
},
|
| 299 |
+
{
|
| 300 |
+
"name": "ort_edge_2d_axis1",
|
| 301 |
+
"provenance": { "source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc", "test": "PadOpTest.Pad_Edge_1D" },
|
| 302 |
+
"attrs": { "pads": [0, 2, 0, 1], "mode": "edge" },
|
| 303 |
+
"inputs": {
|
| 304 |
+
"data": {
|
| 305 |
+
"dtype": "float32",
|
| 306 |
+
"shape": [3, 2],
|
| 307 |
+
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] }
|
| 308 |
+
}
|
| 309 |
+
},
|
| 310 |
+
"outputs": { "output": { "dtype": "float32", "shape": [3, 5], "tolerance": 0.000001 } }
|
| 311 |
+
},
|
| 312 |
+
{
|
| 313 |
+
"name": "ort_reflect_2d_axis1",
|
| 314 |
+
"provenance": {
|
| 315 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 316 |
+
"test": "PadOpTest.Pad_Reflect_1D"
|
| 317 |
+
},
|
| 318 |
+
"attrs": { "pads": [0, 1, 0, 1], "mode": "reflect" },
|
| 319 |
+
"inputs": {
|
| 320 |
+
"data": {
|
| 321 |
+
"dtype": "float32",
|
| 322 |
+
"shape": [3, 2],
|
| 323 |
+
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] }
|
| 324 |
+
}
|
| 325 |
+
},
|
| 326 |
+
"outputs": { "output": { "dtype": "float32", "shape": [3, 4], "tolerance": 0.000001 } }
|
| 327 |
+
},
|
| 328 |
+
{
|
| 329 |
+
"name": "ort_wrap_2d_axis1",
|
| 330 |
+
"provenance": { "source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc", "test": "PadOpTest.Pad_Wrap_1D" },
|
| 331 |
+
"attrs": { "pads": [0, 1, 0, 1], "mode": "wrap" },
|
| 332 |
+
"inputs": {
|
| 333 |
+
"data": {
|
| 334 |
+
"dtype": "float32",
|
| 335 |
+
"shape": [3, 2],
|
| 336 |
+
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] }
|
| 337 |
+
}
|
| 338 |
+
},
|
| 339 |
+
"outputs": { "output": { "dtype": "float32", "shape": [3, 4], "tolerance": 0.000001 } }
|
| 340 |
+
},
|
| 341 |
+
{
|
| 342 |
+
"name": "ort_wrap_1d_upper_pad_greater_than_input",
|
| 343 |
+
"provenance": {
|
| 344 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 345 |
+
"test": "PadOpTest.Pad_Wrap_WebGpu_PadGreaterThanInputDimension",
|
| 346 |
+
"notes": "CPU-valid upper-padding projection of ORT's WebGPU regression."
|
| 347 |
+
},
|
| 348 |
+
"attrs": { "pads": [0, 5], "mode": "wrap" },
|
| 349 |
+
"inputs": {
|
| 350 |
+
"data": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [1.0, 2.0, 3.0] } }
|
| 351 |
+
},
|
| 352 |
+
"outputs": {
|
| 353 |
+
"output": {
|
| 354 |
+
"dtype": "float32",
|
| 355 |
+
"shape": [8],
|
| 356 |
+
"tolerance": 0,
|
| 357 |
+
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 1.0, 2.0, 3.0, 1.0, 2.0] }
|
| 358 |
+
}
|
| 359 |
+
}
|
| 360 |
+
},
|
| 361 |
+
{
|
| 362 |
+
"name": "ort_wrap_1d_lower_pad_greater_than_input",
|
| 363 |
+
"provenance": {
|
| 364 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 365 |
+
"test": "PadOpTest.Pad_Wrap_WebGpu_PadGreaterThanInputDimension",
|
| 366 |
+
"notes": "Lower-padding projection of the same ORT WebGPU regression: the negative in-coordinate path of the wrap modulo."
|
| 367 |
+
},
|
| 368 |
+
"attrs": { "pads": [5, 0], "mode": "wrap" },
|
| 369 |
+
"inputs": {
|
| 370 |
+
"data": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [1.0, 2.0, 3.0] } }
|
| 371 |
+
},
|
| 372 |
+
"outputs": {
|
| 373 |
+
"output": {
|
| 374 |
+
"dtype": "float32",
|
| 375 |
+
"shape": [8],
|
| 376 |
+
"tolerance": 0,
|
| 377 |
+
"data": { "kind": "values", "values": [2.0, 3.0, 1.0, 2.0, 3.0, 1.0, 2.0, 3.0] }
|
| 378 |
+
}
|
| 379 |
+
}
|
| 380 |
+
},
|
| 381 |
+
{
|
| 382 |
+
"name": "ort_edge_2d_full_pad",
|
| 383 |
+
"provenance": { "source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc", "test": "PadOpTest.Pad_Edge_2D" },
|
| 384 |
+
"attrs": { "pads": [2, 2, 2, 2], "mode": "edge" },
|
| 385 |
+
"inputs": {
|
| 386 |
+
"data": {
|
| 387 |
+
"dtype": "float32",
|
| 388 |
+
"shape": [2, 3],
|
| 389 |
+
"data": { "kind": "values", "values": [11.0, 21.0, 31.0, 12.0, 22.0, 32.0] }
|
| 390 |
+
}
|
| 391 |
+
},
|
| 392 |
+
"outputs": { "output": { "dtype": "float32", "shape": [6, 7], "tolerance": 0.000001 } }
|
| 393 |
+
},
|
| 394 |
+
{
|
| 395 |
+
"name": "ort_reflect_2d_full_pad",
|
| 396 |
+
"provenance": {
|
| 397 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 398 |
+
"test": "PadOpTest.Pad_Reflect_2D"
|
| 399 |
+
},
|
| 400 |
+
"attrs": { "pads": [2, 2, 2, 2], "mode": "reflect" },
|
| 401 |
+
"inputs": {
|
| 402 |
+
"data": {
|
| 403 |
+
"dtype": "float32",
|
| 404 |
+
"shape": [3, 3],
|
| 405 |
+
"data": { "kind": "values", "values": [11.0, 21.0, 31.0, 12.0, 22.0, 32.0, 13.0, 23.0, 33.0] }
|
| 406 |
+
}
|
| 407 |
+
},
|
| 408 |
+
"outputs": { "output": { "dtype": "float32", "shape": [7, 7], "tolerance": 0.000001 } }
|
| 409 |
+
},
|
| 410 |
+
{
|
| 411 |
+
"name": "ort_wrap_2d_full_pad",
|
| 412 |
+
"provenance": { "source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc", "test": "PadOpTest.Pad_Wrap_2D" },
|
| 413 |
+
"attrs": { "pads": [2, 2, 2, 2], "mode": "wrap" },
|
| 414 |
+
"inputs": {
|
| 415 |
+
"data": {
|
| 416 |
+
"dtype": "float32",
|
| 417 |
+
"shape": [3, 3],
|
| 418 |
+
"data": { "kind": "values", "values": [11.0, 21.0, 31.0, 12.0, 22.0, 32.0, 13.0, 23.0, 33.0] }
|
| 419 |
+
}
|
| 420 |
+
},
|
| 421 |
+
"outputs": { "output": { "dtype": "float32", "shape": [7, 7], "tolerance": 0.000001 } }
|
| 422 |
+
},
|
| 423 |
+
{
|
| 424 |
+
"name": "ort_wrap_negative_front_positive_back",
|
| 425 |
+
"provenance": {
|
| 426 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 427 |
+
"test": "PadOpTest.Pad_Wrap_NegativeFront_PositiveBack"
|
| 428 |
+
},
|
| 429 |
+
"attrs": { "pads": [-3, 3], "mode": "wrap" },
|
| 430 |
+
"inputs": {
|
| 431 |
+
"data": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0] } }
|
| 432 |
+
},
|
| 433 |
+
"outputs": { "output": { "dtype": "float32", "shape": [4], "tolerance": 0 } }
|
| 434 |
+
},
|
| 435 |
+
{
|
| 436 |
+
"name": "ort_reflect_pad_equals_extent_minus_one",
|
| 437 |
+
"provenance": {
|
| 438 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 439 |
+
"test": "PadOpTest.Pad_Reflect_PadEqualsExtentMinus1_Succeeds"
|
| 440 |
+
},
|
| 441 |
+
"attrs": { "pads": [2, 2], "mode": "reflect" },
|
| 442 |
+
"inputs": {
|
| 443 |
+
"data": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [1.0, 2.0, 3.0] } }
|
| 444 |
+
},
|
| 445 |
+
"outputs": { "output": { "dtype": "float32", "shape": [7], "tolerance": 0.000001 } }
|
| 446 |
+
},
|
| 447 |
+
{
|
| 448 |
+
"name": "constant_1d_negative_front_crop_post_pad",
|
| 449 |
+
"attrs": { "pads": [-1, 2] },
|
| 450 |
+
"inputs": {
|
| 451 |
+
"data": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0] } },
|
| 452 |
+
"constant_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [123.0] } }
|
| 453 |
+
},
|
| 454 |
+
"outputs": { "output": { "dtype": "float32", "shape": [5], "tolerance": 0.000001 } }
|
| 455 |
+
},
|
| 456 |
+
{
|
| 457 |
+
"name": "constant_2d_negative_axis0_crop",
|
| 458 |
+
"attrs": { "pads": [-1, 0, -1, 0] },
|
| 459 |
+
"inputs": {
|
| 460 |
+
"data": {
|
| 461 |
+
"dtype": "float32",
|
| 462 |
+
"shape": [3, 3],
|
| 463 |
+
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0] }
|
| 464 |
+
},
|
| 465 |
+
"constant_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [-5.0] } }
|
| 466 |
+
},
|
| 467 |
+
"outputs": { "output": { "dtype": "float32", "shape": [1, 3], "tolerance": 0.000001 } }
|
| 468 |
+
},
|
| 469 |
+
{
|
| 470 |
+
"name": "constant_vec4_negative_trailing_crop_both_axes",
|
| 471 |
+
"provenance": {
|
| 472 |
+
"source": "ONNX Pad-19 specification",
|
| 473 |
+
"test": "negative end pads crop both axes on the packed default-value path"
|
| 474 |
+
},
|
| 475 |
+
"attrs": { "pads": [0, 0, -1, -1] },
|
| 476 |
+
"inputs": {
|
| 477 |
+
"data": {
|
| 478 |
+
"dtype": "float32",
|
| 479 |
+
"shape": [3, 5],
|
| 480 |
+
"data": {
|
| 481 |
+
"kind": "values",
|
| 482 |
+
"values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0]
|
| 483 |
+
}
|
| 484 |
+
}
|
| 485 |
+
},
|
| 486 |
+
"outputs": { "output": { "dtype": "float32", "shape": [2, 4], "tolerance": 0 } }
|
| 487 |
+
},
|
| 488 |
+
{
|
| 489 |
+
"name": "constant_vec4_last_axis_crop_removes_every_column",
|
| 490 |
+
"provenance": {
|
| 491 |
+
"notes": "A positive pad on the innermost axis and a negative one that crops away every source column: the output row is entirely pad value, so the sliced width the vec4 kernel carries is zero. That width has a floor at zero precisely for this shape and no case had ever reached it. The uniform output is the assertion -- no source value may survive."
|
| 492 |
+
},
|
| 493 |
+
"attrs": { "pads": [0, 8, 0, -4] },
|
| 494 |
+
"inputs": {
|
| 495 |
+
"data": {
|
| 496 |
+
"dtype": "float32",
|
| 497 |
+
"shape": [2, 4],
|
| 498 |
+
"data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.31, "scale": 2.0 }
|
| 499 |
+
}
|
| 500 |
+
},
|
| 501 |
+
"outputs": { "output": { "dtype": "float32", "shape": [2, 8], "tolerance": 0 } }
|
| 502 |
+
},
|
| 503 |
+
{
|
| 504 |
+
"name": "ort_constant_2d_negative_back_pad_crop",
|
| 505 |
+
"provenance": {
|
| 506 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 507 |
+
"test": "PadOpTest.Pad_Constant_2D_negative_pads_1"
|
| 508 |
+
},
|
| 509 |
+
"attrs": { "pads": [1, 2, 1, -1] },
|
| 510 |
+
"inputs": {
|
| 511 |
+
"data": {
|
| 512 |
+
"dtype": "float32",
|
| 513 |
+
"shape": [2, 3],
|
| 514 |
+
"data": { "kind": "values", "values": [11.0, 21.0, 31.0, 12.0, 22.0, 32.0] }
|
| 515 |
+
},
|
| 516 |
+
"constant_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [123.0] } }
|
| 517 |
+
},
|
| 518 |
+
"outputs": { "output": { "dtype": "float32", "shape": [4, 4], "tolerance": 0.000001 } }
|
| 519 |
+
},
|
| 520 |
+
{
|
| 521 |
+
"name": "ort_constant_3d_complex",
|
| 522 |
+
"provenance": {
|
| 523 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 524 |
+
"test": "PadOpTest.Pad_3D_complex"
|
| 525 |
+
},
|
| 526 |
+
"attrs": { "pads": [1, 0, 0, -1, 0, 0] },
|
| 527 |
+
"inputs": {
|
| 528 |
+
"data": {
|
| 529 |
+
"dtype": "float32",
|
| 530 |
+
"shape": [2, 2, 2],
|
| 531 |
+
"data": { "kind": "values", "values": [11.0, 12.0, 21.0, 22.0, 111.0, 112.0, 121.0, 122.0] }
|
| 532 |
+
}
|
| 533 |
+
},
|
| 534 |
+
"outputs": { "output": { "dtype": "float32", "shape": [2, 2, 2], "tolerance": 0.000001 } }
|
| 535 |
+
},
|
| 536 |
+
{
|
| 537 |
+
"name": "constant_3d_mixed_signs_crop_and_pad",
|
| 538 |
+
"attrs": { "pads": [0, -1, 1, 0, 1, -2] },
|
| 539 |
+
"inputs": {
|
| 540 |
+
"data": {
|
| 541 |
+
"dtype": "float32",
|
| 542 |
+
"shape": [2, 3, 4],
|
| 543 |
+
"data": {
|
| 544 |
+
"kind": "values",
|
| 545 |
+
"values": [0.0, 1.0, 2.0, 3.0, 10.0, 11.0, 12.0, 13.0, 20.0, 21.0, 22.0, 23.0, 100.0, 101.0, 102.0, 103.0, 110.0, 111.0, 112.0, 113.0, 120.0, 121.0, 122.0, 123.0]
|
| 546 |
+
}
|
| 547 |
+
},
|
| 548 |
+
"constant_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [9.0] } }
|
| 549 |
+
},
|
| 550 |
+
"outputs": { "output": { "dtype": "float32", "shape": [2, 3, 3], "tolerance": 0.000001 } }
|
| 551 |
+
},
|
| 552 |
+
{
|
| 553 |
+
"name": "ort_constant_4d_crop_removes_all_source_values",
|
| 554 |
+
"provenance": {
|
| 555 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 556 |
+
"test": "PadOpTest.ConstantFill_F32_RemovesAllDataOnAxis"
|
| 557 |
+
},
|
| 558 |
+
"attrs": { "pads": [0, 0, -4, 0, 0, 0, 4, 0] },
|
| 559 |
+
"inputs": {
|
| 560 |
+
"data": {
|
| 561 |
+
"dtype": "float32",
|
| 562 |
+
"shape": [1, 1, 4, 4],
|
| 563 |
+
"data": {
|
| 564 |
+
"kind": "values",
|
| 565 |
+
"values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0]
|
| 566 |
+
}
|
| 567 |
+
}
|
| 568 |
+
},
|
| 569 |
+
"outputs": { "output": { "dtype": "float32", "shape": [1, 1, 4, 4], "tolerance": 0 } }
|
| 570 |
+
},
|
| 571 |
+
{
|
| 572 |
+
"name": "ort_constant_3d_innermost_crop_then_post_pad",
|
| 573 |
+
"provenance": {
|
| 574 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 575 |
+
"test": "PadOpTest.ConstantMode_InnermostCropThenPostPad"
|
| 576 |
+
},
|
| 577 |
+
"attrs": { "pads": [1, 3, -2, -1, 0, 1] },
|
| 578 |
+
"inputs": {
|
| 579 |
+
"data": {
|
| 580 |
+
"dtype": "float32",
|
| 581 |
+
"shape": [2, 3, 5],
|
| 582 |
+
"data": {
|
| 583 |
+
"kind": "values",
|
| 584 |
+
"values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0]
|
| 585 |
+
}
|
| 586 |
+
},
|
| 587 |
+
"constant_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [9.0] } }
|
| 588 |
+
},
|
| 589 |
+
"outputs": { "output": { "dtype": "float32", "shape": [2, 6, 4], "tolerance": 0.000001 } }
|
| 590 |
+
},
|
| 591 |
+
{
|
| 592 |
+
"name": "ort_constant_3d_mixed_signs_small",
|
| 593 |
+
"provenance": {
|
| 594 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 595 |
+
"test": "PadOpTest.ConstantMode_MixedSigns_Small"
|
| 596 |
+
},
|
| 597 |
+
"attrs": { "pads": [1, 3, -2, -1, 0, 1] },
|
| 598 |
+
"inputs": {
|
| 599 |
+
"data": {
|
| 600 |
+
"dtype": "float32",
|
| 601 |
+
"shape": [2, 6, 4],
|
| 602 |
+
"data": { "kind": "cycle", "values": [1.0, 2.0, 3.0, 4.0, 5.0] }
|
| 603 |
+
},
|
| 604 |
+
"constant_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [9.0] } }
|
| 605 |
+
},
|
| 606 |
+
"outputs": { "output": { "dtype": "float32", "shape": [2, 9, 3], "tolerance": 0.000001 } }
|
| 607 |
+
},
|
| 608 |
+
{
|
| 609 |
+
"name": "ort_edge_mode_extent_one_after_crop",
|
| 610 |
+
"provenance": {
|
| 611 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 612 |
+
"test": "PadOpTest.EdgeMode_ExtentOne_Valid"
|
| 613 |
+
},
|
| 614 |
+
"attrs": { "pads": [-3, 3], "mode": "edge" },
|
| 615 |
+
"inputs": { "data": { "dtype": "float32", "shape": [4], "data": { "kind": "constant", "value": 1.0 } } },
|
| 616 |
+
"outputs": { "output": { "dtype": "float32", "shape": [4], "tolerance": 0 } }
|
| 617 |
+
},
|
| 618 |
+
{
|
| 619 |
+
"name": "ort_edge_mode_flattened_innermost_axis",
|
| 620 |
+
"provenance": {
|
| 621 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 622 |
+
"test": "PadOpTest.EdgeMode_FlattenedInnermostAxis"
|
| 623 |
+
},
|
| 624 |
+
"attrs": { "pads": [0, 0, 0, 0, 0, 0, 0, 1], "mode": "edge" },
|
| 625 |
+
"inputs": {
|
| 626 |
+
"data": { "dtype": "float32", "shape": [2, 3, 2, 4], "data": { "kind": "linspace", "start": 0.0, "end": 47.0 } }
|
| 627 |
+
},
|
| 628 |
+
"outputs": { "output": { "dtype": "float32", "shape": [2, 3, 2, 5], "tolerance": 0 } }
|
| 629 |
+
},
|
| 630 |
+
{
|
| 631 |
+
"name": "ort_zero_dim_1d_pad_to_nonempty",
|
| 632 |
+
"provenance": {
|
| 633 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 634 |
+
"test": "PadOpTest.Pad_Constant_DimWithZeroInput / 1D"
|
| 635 |
+
},
|
| 636 |
+
"attrs": { "pads": [1, 1] },
|
| 637 |
+
"inputs": {
|
| 638 |
+
"data": { "dtype": "float32", "shape": [0], "data": { "kind": "values", "values": [] } },
|
| 639 |
+
"constant_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [1.0] } }
|
| 640 |
+
},
|
| 641 |
+
"outputs": { "output": { "dtype": "float32", "shape": [2], "tolerance": 0.000001 } }
|
| 642 |
+
},
|
| 643 |
+
{
|
| 644 |
+
"name": "ort_zero_dim_1d_empty_pads",
|
| 645 |
+
"provenance": {
|
| 646 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 647 |
+
"test": "PadOpTest.Pad_Constant_DimWithZeroInput / 1D empty pads"
|
| 648 |
+
},
|
| 649 |
+
"attrs": { "pads": [0, 0] },
|
| 650 |
+
"inputs": {
|
| 651 |
+
"data": { "dtype": "float32", "shape": [0], "data": { "kind": "values", "values": [] } },
|
| 652 |
+
"constant_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [1.0] } }
|
| 653 |
+
},
|
| 654 |
+
"outputs": { "output": { "dtype": "float32", "shape": [0], "tolerance": 0.000001 } }
|
| 655 |
+
},
|
| 656 |
+
{
|
| 657 |
+
"name": "ort_zero_dim_2d_inner_pad_to_nonempty",
|
| 658 |
+
"provenance": {
|
| 659 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 660 |
+
"test": "PadOpTest.Pad_Constant_DimWithZeroInput / 2D"
|
| 661 |
+
},
|
| 662 |
+
"attrs": { "pads": [1, 1, 1, 1] },
|
| 663 |
+
"inputs": {
|
| 664 |
+
"data": { "dtype": "float32", "shape": [2, 0], "data": { "kind": "values", "values": [] } },
|
| 665 |
+
"constant_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [1.0] } }
|
| 666 |
+
},
|
| 667 |
+
"outputs": { "output": { "dtype": "float32", "shape": [4, 2], "tolerance": 0.000001 } }
|
| 668 |
+
},
|
| 669 |
+
{
|
| 670 |
+
"name": "ort_zero_dim_3d_middle_pad_to_nonempty_f16",
|
| 671 |
+
"provenance": {
|
| 672 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 673 |
+
"test": "PadOpTest.Pad_Constant_DimWithZeroInput / 3D"
|
| 674 |
+
},
|
| 675 |
+
"attrs": { "pads": [0, 1, 0, 0, 1, 0] },
|
| 676 |
+
"inputs": {
|
| 677 |
+
"data": { "dtype": "float16", "shape": [2, 0, 2], "data": { "kind": "values", "values": [] } },
|
| 678 |
+
"constant_value": { "dtype": "float16", "shape": [], "data": { "kind": "values", "values": [1.0] } }
|
| 679 |
+
},
|
| 680 |
+
"outputs": { "output": { "dtype": "float16", "shape": [2, 2, 2], "tolerance": 0.001 } }
|
| 681 |
+
},
|
| 682 |
+
{
|
| 683 |
+
"name": "ort_edge_zero_dim_unpadded_axis_stays_empty",
|
| 684 |
+
"provenance": {
|
| 685 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 686 |
+
"test": "PadOpTest.Pad_Edge_DimWithZeroInput",
|
| 687 |
+
"notes": "Valid ORT edge-mode case where the zero-sized axis is not padded, so the output remains empty."
|
| 688 |
+
},
|
| 689 |
+
"attrs": { "mode": "edge", "pads": [1, 0, 1, 0] },
|
| 690 |
+
"inputs": { "data": { "dtype": "float32", "shape": [2, 0], "data": { "kind": "values", "values": [] } } },
|
| 691 |
+
"outputs": { "output": { "dtype": "float32", "shape": [4, 0], "tolerance": 0 } }
|
| 692 |
+
},
|
| 693 |
+
{
|
| 694 |
+
"name": "ort_reflect_zero_dim_unpadded_axis_stays_empty",
|
| 695 |
+
"provenance": {
|
| 696 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 697 |
+
"test": "PadOpTest.Pad_Reflect_DimWithZeroInput",
|
| 698 |
+
"notes": "Valid ORT reflect-mode case where the zero-sized axis is not padded, so the output remains empty."
|
| 699 |
+
},
|
| 700 |
+
"attrs": { "mode": "reflect", "pads": [1, 0, 1, 0] },
|
| 701 |
+
"inputs": { "data": { "dtype": "float32", "shape": [2, 0], "data": { "kind": "values", "values": [] } } },
|
| 702 |
+
"outputs": { "output": { "dtype": "float32", "shape": [4, 0], "tolerance": 0 } }
|
| 703 |
+
},
|
| 704 |
+
{
|
| 705 |
+
"name": "ort_constant_2d_crop_front_axis0",
|
| 706 |
+
"provenance": {
|
| 707 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 708 |
+
"test": "PadOpTest.Pad_Constant_2D_negative_pads_2"
|
| 709 |
+
},
|
| 710 |
+
"attrs": { "pads": [-1, 0, 0, 0], "mode": "constant" },
|
| 711 |
+
"inputs": {
|
| 712 |
+
"data": {
|
| 713 |
+
"dtype": "float32",
|
| 714 |
+
"shape": [2, 3],
|
| 715 |
+
"data": { "kind": "values", "values": [11.0, 21.0, 31.0, 12.0, 22.0, 32.0] }
|
| 716 |
+
},
|
| 717 |
+
"constant_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [123.0] } }
|
| 718 |
+
},
|
| 719 |
+
"outputs": { "output": { "dtype": "float32", "shape": [1, 3], "tolerance": 0 } }
|
| 720 |
+
},
|
| 721 |
+
{
|
| 722 |
+
"name": "ort_constant_3d_crop_both_last_axis",
|
| 723 |
+
"provenance": {
|
| 724 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 725 |
+
"test": "PadOpTest.Pad_Constant_3D_negative_pads"
|
| 726 |
+
},
|
| 727 |
+
"attrs": { "pads": [0, 0, -1, 0, 0, -1], "mode": "constant" },
|
| 728 |
+
"inputs": {
|
| 729 |
+
"data": { "dtype": "float32", "shape": [1, 1, 3], "data": { "kind": "values", "values": [0.0, 1.0, 2.0] } }
|
| 730 |
+
},
|
| 731 |
+
"outputs": { "output": { "dtype": "float32", "shape": [1, 1, 1], "tolerance": 0 } }
|
| 732 |
+
},
|
| 733 |
+
{
|
| 734 |
+
"name": "ort_constant_4d_negative_pads_inner_window",
|
| 735 |
+
"provenance": {
|
| 736 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 737 |
+
"test": "PadOpTest.Pad_Constant_4D_negative_pads"
|
| 738 |
+
},
|
| 739 |
+
"attrs": { "pads": [0, 0, -1, -3, 0, 0, -2, -4], "mode": "constant" },
|
| 740 |
+
"inputs": {
|
| 741 |
+
"data": {
|
| 742 |
+
"dtype": "float32",
|
| 743 |
+
"shape": [1, 1, 10, 10],
|
| 744 |
+
"data": { "kind": "linspace", "start": 0.0, "end": 99.0 }
|
| 745 |
+
}
|
| 746 |
+
},
|
| 747 |
+
"outputs": { "output": { "dtype": "float32", "shape": [1, 1, 7, 3], "tolerance": 0 } }
|
| 748 |
+
},
|
| 749 |
+
{
|
| 750 |
+
"name": "ort_constant_fill_removes_all_data_on_axis",
|
| 751 |
+
"provenance": {
|
| 752 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 753 |
+
"test": "PadOpTest.ConstantFill_F32_RemovesAllDataOnAxis"
|
| 754 |
+
},
|
| 755 |
+
"attrs": { "pads": [0, 0, -4, 0, 0, 0, 4, 0], "mode": "constant" },
|
| 756 |
+
"inputs": {
|
| 757 |
+
"data": { "dtype": "float32", "shape": [1, 1, 4, 4], "data": { "kind": "linspace", "start": 1.0, "end": 16.0 } }
|
| 758 |
+
},
|
| 759 |
+
"outputs": { "output": { "dtype": "float32", "shape": [1, 1, 4, 4], "tolerance": 0 } }
|
| 760 |
+
},
|
| 761 |
+
{
|
| 762 |
+
"name": "ort_constant_large_negative_pad_no_output",
|
| 763 |
+
"provenance": {
|
| 764 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 765 |
+
"test": "PadOpTest.ConstantPadLargeNegativePadNoOutput",
|
| 766 |
+
"notes": "Large positive secondary dimension is paired with a zero leading dimension, so the output has zero elements."
|
| 767 |
+
},
|
| 768 |
+
"attrs": { "pads": [1, 1048576, -2, -3, 0, 1], "mode": "constant" },
|
| 769 |
+
"inputs": {
|
| 770 |
+
"data": {
|
| 771 |
+
"dtype": "float32",
|
| 772 |
+
"shape": [2, 18, 4],
|
| 773 |
+
"data": { "kind": "cycle", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] }
|
| 774 |
+
},
|
| 775 |
+
"constant_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [100.0] } }
|
| 776 |
+
},
|
| 777 |
+
"outputs": { "output": { "dtype": "float32", "shape": [0, 1048594, 3], "tolerance": 0 } }
|
| 778 |
+
},
|
| 779 |
+
{
|
| 780 |
+
"name": "ort_constant_mixed_signs_small",
|
| 781 |
+
"provenance": {
|
| 782 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 783 |
+
"test": "PadOpTest.ConstantMode_MixedSigns_Small"
|
| 784 |
+
},
|
| 785 |
+
"attrs": { "pads": [1, 3, -2, -1, 0, 1], "mode": "constant" },
|
| 786 |
+
"inputs": {
|
| 787 |
+
"data": {
|
| 788 |
+
"dtype": "float32",
|
| 789 |
+
"shape": [2, 6, 4],
|
| 790 |
+
"data": { "kind": "cycle", "values": [1.0, 2.0, 3.0, 4.0, 5.0] }
|
| 791 |
+
},
|
| 792 |
+
"constant_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [9.0] } }
|
| 793 |
+
},
|
| 794 |
+
"outputs": { "output": { "dtype": "float32", "shape": [2, 9, 3], "tolerance": 0 } }
|
| 795 |
+
},
|
| 796 |
+
{
|
| 797 |
+
"name": "ort_constant_innermost_crop_then_post_pad",
|
| 798 |
+
"provenance": {
|
| 799 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 800 |
+
"test": "PadOpTest.ConstantMode_InnermostCropThenPostPad"
|
| 801 |
+
},
|
| 802 |
+
"attrs": { "pads": [1, 3, -2, -1, 0, 1], "mode": "constant" },
|
| 803 |
+
"inputs": {
|
| 804 |
+
"data": { "dtype": "float32", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": 1.0, "end": 30.0 } },
|
| 805 |
+
"constant_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [9.0] } }
|
| 806 |
+
},
|
| 807 |
+
"outputs": { "output": { "dtype": "float32", "shape": [2, 6, 4], "tolerance": 0 } }
|
| 808 |
+
},
|
| 809 |
+
{
|
| 810 |
+
"name": "ort_edge_extent_one_after_crop",
|
| 811 |
+
"provenance": {
|
| 812 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 813 |
+
"test": "PadOpTest.EdgeMode_ExtentOne_Valid"
|
| 814 |
+
},
|
| 815 |
+
"attrs": { "pads": [-3, 3], "mode": "edge" },
|
| 816 |
+
"inputs": {
|
| 817 |
+
"data": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [1.0, 1.0, 1.0, 1.0] } }
|
| 818 |
+
},
|
| 819 |
+
"outputs": { "output": { "dtype": "float32", "shape": [4], "tolerance": 0 } }
|
| 820 |
+
},
|
| 821 |
+
{
|
| 822 |
+
"name": "ort_constant_3d_complex_crop_and_prepad",
|
| 823 |
+
"provenance": {
|
| 824 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 825 |
+
"test": "PadOpTest.Pad_3D_complex"
|
| 826 |
+
},
|
| 827 |
+
"attrs": { "pads": [1, 0, 0, -1, 0, 0] },
|
| 828 |
+
"inputs": {
|
| 829 |
+
"data": {
|
| 830 |
+
"dtype": "float32",
|
| 831 |
+
"shape": [2, 2, 2],
|
| 832 |
+
"data": { "kind": "values", "values": [11.0, 12.0, 21.0, 22.0, 111.0, 112.0, 121.0, 122.0] }
|
| 833 |
+
}
|
| 834 |
+
},
|
| 835 |
+
"outputs": { "output": { "dtype": "float32", "shape": [2, 2, 2], "tolerance": 0 } }
|
| 836 |
+
},
|
| 837 |
+
{
|
| 838 |
+
"name": "ort_reflect_3d_inner_no_padding",
|
| 839 |
+
"provenance": {
|
| 840 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 841 |
+
"test": "PadOpTest.Pad_Reflect_3D_Inner_No_Padding"
|
| 842 |
+
},
|
| 843 |
+
"attrs": { "pads": [1, 1, 0, 1, 1, 0], "mode": "reflect" },
|
| 844 |
+
"inputs": {
|
| 845 |
+
"data": { "dtype": "float32", "shape": [3, 2, 5], "data": { "kind": "linspace", "start": 1.0, "end": 30.0 } }
|
| 846 |
+
},
|
| 847 |
+
"outputs": { "output": { "dtype": "float32", "shape": [5, 4, 5], "tolerance": 0 } }
|
| 848 |
+
},
|
| 849 |
+
{
|
| 850 |
+
"name": "ort_wrap_3d_inner_no_padding",
|
| 851 |
+
"provenance": {
|
| 852 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 853 |
+
"test": "PadOpTest.Pad_wrap_3D_Inner_No_Padding"
|
| 854 |
+
},
|
| 855 |
+
"attrs": { "pads": [1, 1, 0, 1, 1, 0], "mode": "wrap" },
|
| 856 |
+
"inputs": {
|
| 857 |
+
"data": { "dtype": "float32", "shape": [3, 2, 5], "data": { "kind": "linspace", "start": 1.0, "end": 30.0 } }
|
| 858 |
+
},
|
| 859 |
+
"outputs": { "output": { "dtype": "float32", "shape": [5, 4, 5], "tolerance": 0 } }
|
| 860 |
+
},
|
| 861 |
+
{
|
| 862 |
+
"name": "onnx_backend_constant_pad",
|
| 863 |
+
"attrs": { "mode": "constant", "pads": [0, 0, 1, 3, 0, 0, 2, 4] },
|
| 864 |
+
"inputs": {
|
| 865 |
+
"data": {
|
| 866 |
+
"dtype": "float32",
|
| 867 |
+
"shape": [1, 3, 4, 5],
|
| 868 |
+
"data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/onnx_backend_constant_pad_input_data" } }
|
| 869 |
+
},
|
| 870 |
+
"constant_value": {
|
| 871 |
+
"dtype": "float32",
|
| 872 |
+
"shape": [],
|
| 873 |
+
"data": { "kind": "values", "values": [1.2000000476837158] }
|
| 874 |
+
}
|
| 875 |
+
},
|
| 876 |
+
"outputs": { "output": { "dtype": "float32", "shape": [1, 3, 7, 12] } },
|
| 877 |
+
"provenance": {
|
| 878 |
+
"source": "cmake/external/onnx/onnx/backend/test/data/node/test_constant_pad",
|
| 879 |
+
"notes": "ONNX int64 metadata/index tensors use framework int32/uint32 slots where representable. ONNX Pad pads/value inputs represented as framework attributes."
|
| 880 |
+
}
|
| 881 |
+
},
|
| 882 |
+
{
|
| 883 |
+
"name": "onnx_backend_constant_pad_axes",
|
| 884 |
+
"attrs": { "mode": "constant", "pads": [0, 0, 0, 3, 0, 0, 0, 4] },
|
| 885 |
+
"inputs": {
|
| 886 |
+
"data": {
|
| 887 |
+
"dtype": "float32",
|
| 888 |
+
"shape": [1, 3, 4, 5],
|
| 889 |
+
"data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/onnx_backend_constant_pad_input_data" } }
|
| 890 |
+
},
|
| 891 |
+
"constant_value": {
|
| 892 |
+
"dtype": "float32",
|
| 893 |
+
"shape": [],
|
| 894 |
+
"data": { "kind": "values", "values": [1.2000000476837158] }
|
| 895 |
+
}
|
| 896 |
+
},
|
| 897 |
+
"outputs": { "output": { "dtype": "float32", "shape": [1, 3, 4, 12] } },
|
| 898 |
+
"provenance": {
|
| 899 |
+
"source": "cmake/external/onnx/onnx/backend/test/data/node/test_constant_pad_axes",
|
| 900 |
+
"notes": "ONNX int64 metadata uses supported framework storage where representable, and Pad inputs are projected to the full-rank pads attribute. The official test_constant_pad_negative_axes fixture projects to this same request."
|
| 901 |
+
}
|
| 902 |
+
},
|
| 903 |
+
{
|
| 904 |
+
"name": "onnx_backend_edge_pad",
|
| 905 |
+
"attrs": { "mode": "edge", "pads": [0, 0, 1, 1, 0, 0, 1, 1] },
|
| 906 |
+
"inputs": {
|
| 907 |
+
"data": {
|
| 908 |
+
"dtype": "int32",
|
| 909 |
+
"shape": [1, 3, 4, 5],
|
| 910 |
+
"data": {
|
| 911 |
+
"kind": "values",
|
| 912 |
+
"values": [1, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, -2, 0, 0, 0, 2, -1, 0, 0, 1, 1, 0, 0, 0, -1, 0, 0, 1, 1, 0, 0, -1, -1, -1, 1, 0, 0, -1, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0]
|
| 913 |
+
}
|
| 914 |
+
}
|
| 915 |
+
},
|
| 916 |
+
"outputs": { "output": { "dtype": "int32", "shape": [1, 3, 6, 7] } },
|
| 917 |
+
"provenance": {
|
| 918 |
+
"source": "cmake/external/onnx/onnx/backend/test/data/node/test_edge_pad",
|
| 919 |
+
"notes": "ONNX int64 metadata/index tensors use framework int32/uint32 slots where representable. ONNX Pad pads/value inputs represented as framework attributes."
|
| 920 |
+
}
|
| 921 |
+
},
|
| 922 |
+
{
|
| 923 |
+
"name": "onnx_backend_reflect_pad",
|
| 924 |
+
"attrs": { "mode": "reflect", "pads": [0, 0, 1, 1, 0, 0, 1, 1] },
|
| 925 |
+
"inputs": {
|
| 926 |
+
"data": {
|
| 927 |
+
"dtype": "int32",
|
| 928 |
+
"shape": [1, 3, 4, 5],
|
| 929 |
+
"data": {
|
| 930 |
+
"kind": "values",
|
| 931 |
+
"values": [0, 0, 0, -1, 0, 0, -1, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, -1, 1, 1, 1, 0, -1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, -1, -1, 0, -1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0]
|
| 932 |
+
}
|
| 933 |
+
}
|
| 934 |
+
},
|
| 935 |
+
"outputs": { "output": { "dtype": "int32", "shape": [1, 3, 6, 7] } },
|
| 936 |
+
"provenance": {
|
| 937 |
+
"source": "cmake/external/onnx/onnx/backend/test/data/node/test_reflect_pad",
|
| 938 |
+
"notes": "ONNX int64 metadata/index tensors use framework int32/uint32 slots where representable. ONNX Pad pads/value inputs represented as framework attributes."
|
| 939 |
+
}
|
| 940 |
+
},
|
| 941 |
+
{
|
| 942 |
+
"name": "onnx_backend_wrap_pad",
|
| 943 |
+
"attrs": { "mode": "wrap", "pads": [0, 0, 1, 1, 0, 0, 1, 1] },
|
| 944 |
+
"inputs": {
|
| 945 |
+
"data": {
|
| 946 |
+
"dtype": "int32",
|
| 947 |
+
"shape": [1, 3, 4, 5],
|
| 948 |
+
"data": {
|
| 949 |
+
"kind": "values",
|
| 950 |
+
"values": [0, -1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 2, 0, 0, 1, -1, 0, 0, 1, 0, 0, 0, 0, 1, -1, -1, 0, 0, 1, 0, 0, -1, 0, -1, -1, 1, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0]
|
| 951 |
+
}
|
| 952 |
+
}
|
| 953 |
+
},
|
| 954 |
+
"outputs": { "output": { "dtype": "int32", "shape": [1, 3, 6, 7] } },
|
| 955 |
+
"provenance": {
|
| 956 |
+
"source": "cmake/external/onnx/onnx/backend/test/data/node/test_wrap_pad",
|
| 957 |
+
"notes": "ONNX int64 metadata/index tensors use framework int32/uint32 slots where representable. ONNX Pad pads/value inputs represented as framework attributes."
|
| 958 |
+
}
|
| 959 |
+
},
|
| 960 |
+
{
|
| 961 |
+
"name": "ort_edge_3d",
|
| 962 |
+
"provenance": {
|
| 963 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 964 |
+
"test": "PadOpTest.Pad_Edge_3D",
|
| 965 |
+
"notes": "ONNX Pad pads/value inputs represented as framework attributes."
|
| 966 |
+
},
|
| 967 |
+
"attrs": { "mode": "edge", "pads": [1, 2, 2, 1, 2, 2] },
|
| 968 |
+
"inputs": {
|
| 969 |
+
"data": {
|
| 970 |
+
"dtype": "float32",
|
| 971 |
+
"shape": [1, 2, 3],
|
| 972 |
+
"data": { "kind": "values", "values": [11.0, 21.0, 31.0, 12.0, 22.0, 32.0] }
|
| 973 |
+
}
|
| 974 |
+
},
|
| 975 |
+
"outputs": { "output": { "dtype": "float32", "shape": [3, 6, 7], "tolerance": 0 } }
|
| 976 |
+
},
|
| 977 |
+
{
|
| 978 |
+
"name": "ort_constant_3d_inner_no_padding",
|
| 979 |
+
"provenance": {
|
| 980 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 981 |
+
"test": "PadOpTest.Pad_Constant_3D_Inner_No_Padding",
|
| 982 |
+
"notes": "ONNX Pad pads/value inputs represented as framework attributes."
|
| 983 |
+
},
|
| 984 |
+
"attrs": { "mode": "constant", "pads": [1, 1, 0, 1, 1, 0] },
|
| 985 |
+
"inputs": {
|
| 986 |
+
"data": { "dtype": "float32", "shape": [3, 2, 5], "data": { "kind": "linspace", "start": 1.0, "end": 30.0 } },
|
| 987 |
+
"constant_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [31.0] } }
|
| 988 |
+
},
|
| 989 |
+
"outputs": { "output": { "dtype": "float32", "shape": [5, 4, 5], "tolerance": 0 } }
|
| 990 |
+
},
|
| 991 |
+
{
|
| 992 |
+
"name": "ort_edge_3d_inner_no_padding",
|
| 993 |
+
"provenance": {
|
| 994 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 995 |
+
"test": "PadOpTest.Pad_Edge_3D_Inner_No_Padding",
|
| 996 |
+
"notes": "ONNX Pad pads/value inputs represented as framework attributes."
|
| 997 |
+
},
|
| 998 |
+
"attrs": { "mode": "edge", "pads": [1, 1, 0, 1, 1, 0] },
|
| 999 |
+
"inputs": {
|
| 1000 |
+
"data": { "dtype": "float32", "shape": [3, 2, 5], "data": { "kind": "linspace", "start": 1.0, "end": 30.0 } }
|
| 1001 |
+
},
|
| 1002 |
+
"outputs": { "output": { "dtype": "float32", "shape": [5, 4, 5], "tolerance": 0 } }
|
| 1003 |
+
},
|
| 1004 |
+
{
|
| 1005 |
+
"name": "ort_edge_3d_last_pad_slice_inner_no_padding",
|
| 1006 |
+
"provenance": {
|
| 1007 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 1008 |
+
"test": "PadOpTest.Pad_Edge_3D_Last_Pad_Slice_Inner_No_Padding",
|
| 1009 |
+
"notes": "ONNX Pad pads/value inputs represented as framework attributes."
|
| 1010 |
+
},
|
| 1011 |
+
"attrs": { "mode": "edge", "pads": [1, -1, 0, 1, 1, 0] },
|
| 1012 |
+
"inputs": {
|
| 1013 |
+
"data": { "dtype": "float32", "shape": [3, 2, 5], "data": { "kind": "linspace", "start": 1.0, "end": 30.0 } }
|
| 1014 |
+
},
|
| 1015 |
+
"outputs": { "output": { "dtype": "float32", "shape": [5, 2, 5], "tolerance": 0 } }
|
| 1016 |
+
},
|
| 1017 |
+
{
|
| 1018 |
+
"name": "ort_edge_3d_last_slice_inner_no_padding",
|
| 1019 |
+
"provenance": {
|
| 1020 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 1021 |
+
"test": "PadOpTest.Pad_Edge_3D_Last_Slice_Inner_No_Padding",
|
| 1022 |
+
"notes": "ONNX Pad pads/value inputs represented as framework attributes."
|
| 1023 |
+
},
|
| 1024 |
+
"attrs": { "mode": "edge", "pads": [1, -1, 0, 1, 0, 0] },
|
| 1025 |
+
"inputs": {
|
| 1026 |
+
"data": { "dtype": "float32", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": 1.0, "end": 30.0 } }
|
| 1027 |
+
},
|
| 1028 |
+
"outputs": { "output": { "dtype": "float32", "shape": [4, 2, 5], "tolerance": 0 } }
|
| 1029 |
+
},
|
| 1030 |
+
{
|
| 1031 |
+
"name": "ort_reflect_3d_last_pad_slice_inner_no_padding",
|
| 1032 |
+
"provenance": {
|
| 1033 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 1034 |
+
"test": "PadOpTest.Pad_Reflect_3D_Last_Pad_Slice_Inner_No_Padding",
|
| 1035 |
+
"notes": "ONNX Pad pads/value inputs represented as framework attributes."
|
| 1036 |
+
},
|
| 1037 |
+
"attrs": { "mode": "reflect", "pads": [1, -1, 0, 1, 1, 0] },
|
| 1038 |
+
"inputs": {
|
| 1039 |
+
"data": { "dtype": "float32", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": 1.0, "end": 30.0 } }
|
| 1040 |
+
},
|
| 1041 |
+
"outputs": { "output": { "dtype": "float32", "shape": [4, 3, 5], "tolerance": 0 } }
|
| 1042 |
+
},
|
| 1043 |
+
{
|
| 1044 |
+
"name": "ort_reflect_3d_last_slice_inner_no_padding",
|
| 1045 |
+
"provenance": {
|
| 1046 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 1047 |
+
"test": "PadOpTest.Pad_Reflect_3D_Last_Slice_Inner_No_Padding",
|
| 1048 |
+
"notes": "ONNX Pad pads/value inputs represented as framework attributes."
|
| 1049 |
+
},
|
| 1050 |
+
"attrs": { "mode": "reflect", "pads": [1, -1, 0, 1, 0, 0] },
|
| 1051 |
+
"inputs": {
|
| 1052 |
+
"data": { "dtype": "float32", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": 1.0, "end": 30.0 } }
|
| 1053 |
+
},
|
| 1054 |
+
"outputs": { "output": { "dtype": "float32", "shape": [4, 2, 5], "tolerance": 0 } }
|
| 1055 |
+
},
|
| 1056 |
+
{
|
| 1057 |
+
"name": "ort_wrap_3d_inner_no_padding2",
|
| 1058 |
+
"provenance": {
|
| 1059 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 1060 |
+
"test": "PadOpTest.Pad_wrap_3D_Inner_No_Padding2",
|
| 1061 |
+
"notes": "ONNX Pad pads/value inputs represented as framework attributes."
|
| 1062 |
+
},
|
| 1063 |
+
"attrs": { "mode": "wrap", "pads": [1, 2, 0, 1, 2, 0] },
|
| 1064 |
+
"inputs": {
|
| 1065 |
+
"data": { "dtype": "float32", "shape": [3, 2, 5], "data": { "kind": "linspace", "start": 1.0, "end": 30.0 } }
|
| 1066 |
+
},
|
| 1067 |
+
"outputs": { "output": { "dtype": "float32", "shape": [5, 6, 5], "tolerance": 0 } }
|
| 1068 |
+
},
|
| 1069 |
+
{
|
| 1070 |
+
"name": "ort_int8_constant_1d_edge_values",
|
| 1071 |
+
"provenance": {
|
| 1072 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 1073 |
+
"test": "PadOpTest.Pad_Constant_1D",
|
| 1074 |
+
"notes": "Constant 1D padding with logical int8 edge values."
|
| 1075 |
+
},
|
| 1076 |
+
"attrs": { "mode": "constant", "pads": [2, 1] },
|
| 1077 |
+
"inputs": {
|
| 1078 |
+
"data": { "dtype": "int8", "shape": [3], "data": { "kind": "values", "values": [-128, 0, 127] } },
|
| 1079 |
+
"constant_value": { "dtype": "int8", "shape": [], "data": { "kind": "values", "values": [-1] } }
|
| 1080 |
+
},
|
| 1081 |
+
"outputs": { "output": { "dtype": "int8", "shape": [6], "tolerance": 0 } }
|
| 1082 |
+
},
|
| 1083 |
+
{
|
| 1084 |
+
"name": "uint8_constant_crop_then_post_pad",
|
| 1085 |
+
"provenance": {
|
| 1086 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 1087 |
+
"test": "PadOpTest.ConstantMode_InnermostCropThenPostPad",
|
| 1088 |
+
"notes": "Crops the first column, then post-pads with a uint8 edge value."
|
| 1089 |
+
},
|
| 1090 |
+
"attrs": { "mode": "constant", "pads": [0, -1, 0, 2] },
|
| 1091 |
+
"inputs": {
|
| 1092 |
+
"data": { "dtype": "uint8", "shape": [2, 3], "data": { "kind": "values", "values": [0, 1, 2, 253, 254, 255] } },
|
| 1093 |
+
"constant_value": { "dtype": "uint8", "shape": [], "data": { "kind": "values", "values": [255] } }
|
| 1094 |
+
},
|
| 1095 |
+
"outputs": { "output": { "dtype": "uint8", "shape": [2, 4], "tolerance": 0 } }
|
| 1096 |
+
},
|
| 1097 |
+
{
|
| 1098 |
+
"name": "int32_constant_value_exact_below_negative_float24",
|
| 1099 |
+
"provenance": {
|
| 1100 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 1101 |
+
"test": "PadOpTest.Pad_Constant_1D",
|
| 1102 |
+
"notes": "Signed companion for exact integer padding values: -16777217 is representable as int32 but rounds to -16777216 if routed through f32."
|
| 1103 |
+
},
|
| 1104 |
+
"attrs": { "mode": "constant", "pads": [1, 1] },
|
| 1105 |
+
"inputs": {
|
| 1106 |
+
"data": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [-123, 123] } },
|
| 1107 |
+
"constant_value": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [-16777217] } }
|
| 1108 |
+
},
|
| 1109 |
+
"outputs": {
|
| 1110 |
+
"output": {
|
| 1111 |
+
"dtype": "int32",
|
| 1112 |
+
"shape": [4],
|
| 1113 |
+
"tolerance": 0,
|
| 1114 |
+
"data": { "kind": "values", "values": [-16777217, -123, 123, -16777217] }
|
| 1115 |
+
}
|
| 1116 |
+
}
|
| 1117 |
+
},
|
| 1118 |
+
{
|
| 1119 |
+
"name": "constant_two_pass_rank4_border",
|
| 1120 |
+
"attrs": { "mode": "constant", "pads": [0, 0, 1, 2, 0, 0, 1, 2] },
|
| 1121 |
+
"inputs": {
|
| 1122 |
+
"data": {
|
| 1123 |
+
"dtype": "float32",
|
| 1124 |
+
"shape": [1, 2, 6, 8],
|
| 1125 |
+
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.23 }
|
| 1126 |
+
},
|
| 1127 |
+
"constant_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [-1.0] } }
|
| 1128 |
+
},
|
| 1129 |
+
"outputs": { "output": { "dtype": "float32", "shape": [1, 2, 8, 12], "tolerance": 0 } }
|
| 1130 |
+
},
|
| 1131 |
+
{
|
| 1132 |
+
"name": "constant_two_pass_unaligned_interior_tail",
|
| 1133 |
+
"attrs": { "mode": "constant", "pads": [1, 0, 1, 0, 1, 2] },
|
| 1134 |
+
"inputs": {
|
| 1135 |
+
"data": {
|
| 1136 |
+
"dtype": "float32",
|
| 1137 |
+
"shape": [2, 3, 5],
|
| 1138 |
+
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.29 }
|
| 1139 |
+
},
|
| 1140 |
+
"constant_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [9.0] } }
|
| 1141 |
+
},
|
| 1142 |
+
"outputs": { "output": { "dtype": "float32", "shape": [3, 4, 8], "tolerance": 0 } }
|
| 1143 |
+
},
|
| 1144 |
+
{
|
| 1145 |
+
"name": "constant_two_pass_crop_and_pad",
|
| 1146 |
+
"attrs": { "mode": "constant", "pads": [1, 0, -2, 0, 1, -4] },
|
| 1147 |
+
"inputs": {
|
| 1148 |
+
"data": {
|
| 1149 |
+
"dtype": "float32",
|
| 1150 |
+
"shape": [2, 3, 10],
|
| 1151 |
+
"data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.13 }
|
| 1152 |
+
},
|
| 1153 |
+
"constant_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [7.0] } }
|
| 1154 |
+
},
|
| 1155 |
+
"outputs": { "output": { "dtype": "float32", "shape": [3, 4, 4], "tolerance": 0 } }
|
| 1156 |
+
},
|
| 1157 |
+
{
|
| 1158 |
+
"name": "constant_two_pass_rank1_crop_unaligned",
|
| 1159 |
+
"attrs": { "mode": "constant", "pads": [3, -1] },
|
| 1160 |
+
"inputs": {
|
| 1161 |
+
"data": {
|
| 1162 |
+
"dtype": "float32",
|
| 1163 |
+
"shape": [6],
|
| 1164 |
+
"data": { "kind": "fillFloat32", "sinStep": 0.31, "cosStep": 0.07 }
|
| 1165 |
+
},
|
| 1166 |
+
"constant_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [-2.0] } }
|
| 1167 |
+
},
|
| 1168 |
+
"outputs": { "output": { "dtype": "float32", "shape": [8], "tolerance": 0 } }
|
| 1169 |
+
},
|
| 1170 |
+
{
|
| 1171 |
+
"name": "constant_two_pass_f16_border",
|
| 1172 |
+
"attrs": { "mode": "constant", "pads": [0, 0, 1, 1, 0, 0, 1, 1] },
|
| 1173 |
+
"inputs": {
|
| 1174 |
+
"data": { "dtype": "float16", "shape": [1, 1, 3, 6] },
|
| 1175 |
+
"constant_value": { "dtype": "float16", "shape": [], "data": { "kind": "values", "values": [0.5] } }
|
| 1176 |
+
},
|
| 1177 |
+
"outputs": { "output": { "dtype": "float16", "shape": [1, 1, 5, 8] } },
|
| 1178 |
+
"tolerance": 0.001
|
| 1179 |
+
},
|
| 1180 |
+
{
|
| 1181 |
+
"name": "edge_3d_quad_inner_aligned",
|
| 1182 |
+
"attrs": { "mode": "edge", "pads": [1, 1, 1, 1, 1, 1] },
|
| 1183 |
+
"inputs": {
|
| 1184 |
+
"data": {
|
| 1185 |
+
"dtype": "float32",
|
| 1186 |
+
"shape": [2, 3, 6],
|
| 1187 |
+
"data": { "kind": "fillFloat32", "sinStep": 0.21, "cosStep": 0.17 }
|
| 1188 |
+
}
|
| 1189 |
+
},
|
| 1190 |
+
"outputs": { "output": { "dtype": "float32", "shape": [4, 5, 8], "tolerance": 0 } }
|
| 1191 |
+
},
|
| 1192 |
+
{
|
| 1193 |
+
"name": "reflect_3d_quad_inner_aligned",
|
| 1194 |
+
"attrs": { "mode": "reflect", "pads": [1, 1, 3, 1, 1, 3] },
|
| 1195 |
+
"inputs": {
|
| 1196 |
+
"data": {
|
| 1197 |
+
"dtype": "float32",
|
| 1198 |
+
"shape": [2, 3, 6],
|
| 1199 |
+
"data": { "kind": "fillFloat32", "sinStep": 0.27, "cosStep": 0.19 }
|
| 1200 |
+
}
|
| 1201 |
+
},
|
| 1202 |
+
"outputs": { "output": { "dtype": "float32", "shape": [4, 5, 12], "tolerance": 0 } }
|
| 1203 |
+
},
|
| 1204 |
+
{
|
| 1205 |
+
"name": "wrap_3d_quad_inner_aligned",
|
| 1206 |
+
"attrs": { "mode": "wrap", "pads": [1, 1, 4, 1, 1, 2] },
|
| 1207 |
+
"inputs": {
|
| 1208 |
+
"data": {
|
| 1209 |
+
"dtype": "float32",
|
| 1210 |
+
"shape": [2, 3, 6],
|
| 1211 |
+
"data": { "kind": "fillFloat32", "sinStep": 0.33, "cosStep": 0.11 }
|
| 1212 |
+
}
|
| 1213 |
+
},
|
| 1214 |
+
"outputs": { "output": { "dtype": "float32", "shape": [4, 5, 12], "tolerance": 0 } }
|
| 1215 |
+
},
|
| 1216 |
+
{
|
| 1217 |
+
"name": "int32_constant_attr_value_exact_above_float24_scalar_path_unaligned",
|
| 1218 |
+
"provenance": {
|
| 1219 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 1220 |
+
"test": "PadOpTest.Pad_Constant_1D",
|
| 1221 |
+
"notes": "Scalar-path companion to the aligned int32/uint32 large-attribute-value cases. The output's last dimension is 3, which excludes the vec4 path and verifies that exact int32 attribute conversion is preserved by the scalar fallback."
|
| 1222 |
+
},
|
| 1223 |
+
"attrs": { "mode": "constant", "pads": [1, 1] },
|
| 1224 |
+
"inputs": {
|
| 1225 |
+
"data": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [7] } },
|
| 1226 |
+
"constant_value": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [16777217] } }
|
| 1227 |
+
},
|
| 1228 |
+
"outputs": {
|
| 1229 |
+
"output": {
|
| 1230 |
+
"dtype": "int32",
|
| 1231 |
+
"shape": [3],
|
| 1232 |
+
"tolerance": 0,
|
| 1233 |
+
"data": { "kind": "values", "values": [16777217, 7, 16777217] }
|
| 1234 |
+
}
|
| 1235 |
+
}
|
| 1236 |
+
},
|
| 1237 |
+
{
|
| 1238 |
+
"name": "uint32_value_input_exact_above_float24",
|
| 1239 |
+
"provenance": {
|
| 1240 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 1241 |
+
"test": "PadOpTest.Pad_Constant_1D",
|
| 1242 |
+
"notes": "An optional uint32 value input above 2^24 must remain exact rather than round through f32."
|
| 1243 |
+
},
|
| 1244 |
+
"attrs": { "mode": "constant", "pads": [1, 1] },
|
| 1245 |
+
"inputs": {
|
| 1246 |
+
"data": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [4000000001, 17] } },
|
| 1247 |
+
"constant_value": { "dtype": "uint32", "shape": [], "data": { "kind": "values", "values": [16777217] } }
|
| 1248 |
+
},
|
| 1249 |
+
"outputs": {
|
| 1250 |
+
"output": {
|
| 1251 |
+
"dtype": "uint32",
|
| 1252 |
+
"shape": [4],
|
| 1253 |
+
"tolerance": 0,
|
| 1254 |
+
"data": { "kind": "values", "values": [16777217, 4000000001, 17, 16777217] }
|
| 1255 |
+
}
|
| 1256 |
+
}
|
| 1257 |
+
},
|
| 1258 |
+
{
|
| 1259 |
+
"name": "f16_reflect_rank4_inner_aligned",
|
| 1260 |
+
"attrs": { "mode": "reflect", "pads": [0, 0, 2, 2, 0, 0, 2, 2] },
|
| 1261 |
+
"inputs": { "data": { "dtype": "float16", "shape": [1, 16, 4, 8] } },
|
| 1262 |
+
"outputs": { "output": { "dtype": "float16", "shape": [1, 16, 8, 12], "tolerance": 0.003 } }
|
| 1263 |
+
},
|
| 1264 |
+
{
|
| 1265 |
+
"name": "uint8_edge_rank2",
|
| 1266 |
+
"provenance": {
|
| 1267 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 1268 |
+
"test": "PadOpTest.Pad_Edge_2D",
|
| 1269 |
+
"notes": "uint8 with a non-constant (edge) mode was untested; edge/reflect/wrap were only covered for f32/int32. Pure value-copy, exact."
|
| 1270 |
+
},
|
| 1271 |
+
"attrs": { "mode": "edge", "pads": [1, 2, 1, 2] },
|
| 1272 |
+
"inputs": {
|
| 1273 |
+
"data": { "dtype": "uint8", "shape": [2, 3], "data": { "kind": "values", "values": [10, 20, 30, 40, 50, 60] } }
|
| 1274 |
+
},
|
| 1275 |
+
"outputs": { "output": { "dtype": "uint8", "shape": [4, 7], "tolerance": 0 } }
|
| 1276 |
+
},
|
| 1277 |
+
{
|
| 1278 |
+
"name": "value_input_reflect_value_ignored",
|
| 1279 |
+
"provenance": {
|
| 1280 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 1281 |
+
"test": "PadOpTest.Pad_Reflect_1D",
|
| 1282 |
+
"notes": "constant_value_input gates on all 4 modes; for reflect, map_coord never returns -1 so padValue[0] is never read. Supplies a bogus value (999) to confirm the value input is correctly ignored for non-constant modes."
|
| 1283 |
+
},
|
| 1284 |
+
"attrs": { "mode": "reflect", "pads": [0, 1, 0, 1] },
|
| 1285 |
+
"inputs": {
|
| 1286 |
+
"data": {
|
| 1287 |
+
"dtype": "float32",
|
| 1288 |
+
"shape": [3, 2],
|
| 1289 |
+
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] }
|
| 1290 |
+
},
|
| 1291 |
+
"constant_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [999.0] } }
|
| 1292 |
+
},
|
| 1293 |
+
"outputs": { "output": { "dtype": "float32", "shape": [3, 4], "tolerance": 0 } }
|
| 1294 |
+
},
|
| 1295 |
+
{
|
| 1296 |
+
"name": "value_input_empty_data_constant_1d",
|
| 1297 |
+
"attrs": { "mode": "constant", "pads": [1, 2] },
|
| 1298 |
+
"inputs": {
|
| 1299 |
+
"data": { "dtype": "float32", "shape": [0], "data": { "kind": "values", "values": [] } },
|
| 1300 |
+
"constant_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [123.0] } }
|
| 1301 |
+
},
|
| 1302 |
+
"outputs": {
|
| 1303 |
+
"output": {
|
| 1304 |
+
"dtype": "float32",
|
| 1305 |
+
"shape": [3],
|
| 1306 |
+
"tolerance": 0,
|
| 1307 |
+
"data": { "kind": "values", "values": [123.0, 123.0, 123.0] }
|
| 1308 |
+
}
|
| 1309 |
+
}
|
| 1310 |
+
},
|
| 1311 |
+
{
|
| 1312 |
+
"name": "value_input_empty_inner_data_2d_constant",
|
| 1313 |
+
"attrs": { "mode": "constant", "pads": [1, 1, 1, 1] },
|
| 1314 |
+
"inputs": {
|
| 1315 |
+
"data": { "dtype": "float32", "shape": [2, 0], "data": { "kind": "values", "values": [] } },
|
| 1316 |
+
"constant_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [5.0] } }
|
| 1317 |
+
},
|
| 1318 |
+
"outputs": {
|
| 1319 |
+
"output": {
|
| 1320 |
+
"dtype": "float32",
|
| 1321 |
+
"shape": [4, 2],
|
| 1322 |
+
"tolerance": 0,
|
| 1323 |
+
"data": { "kind": "values", "values": [5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0] }
|
| 1324 |
+
}
|
| 1325 |
+
}
|
| 1326 |
+
},
|
| 1327 |
+
{
|
| 1328 |
+
"name": "value_input_scalar_path_2d_fold_last_row",
|
| 1329 |
+
"attrs": { "mode": "constant", "pads": [1, 0, 1, 0] },
|
| 1330 |
+
"inputs": {
|
| 1331 |
+
"data": {
|
| 1332 |
+
"dtype": "float32",
|
| 1333 |
+
"shape": [4094, 512],
|
| 1334 |
+
"data": { "kind": "fillFloat32", "sinStep": 0.017, "cosStep": 0.023 }
|
| 1335 |
+
},
|
| 1336 |
+
"constant_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [-7.0] } }
|
| 1337 |
+
},
|
| 1338 |
+
"outputs": { "output": { "dtype": "float32", "shape": [4096, 512], "tolerance": 0 } }
|
| 1339 |
+
},
|
| 1340 |
+
{
|
| 1341 |
+
"name": "rank3_value_input_scalar_path_perf_compact",
|
| 1342 |
+
"provenance": {
|
| 1343 |
+
"notes": "Compact sibling for the rank-3 value-input Pad benchmark; optional `constant_value` input selects constant_value_input and the unaligned inner extent keeps scalar address handling active."
|
| 1344 |
+
},
|
| 1345 |
+
"attrs": { "mode": "constant", "pads": [1, 0, 2, 1, 0, 2] },
|
| 1346 |
+
"inputs": {
|
| 1347 |
+
"data": {
|
| 1348 |
+
"dtype": "float32",
|
| 1349 |
+
"shape": [4, 16, 31],
|
| 1350 |
+
"data": { "kind": "fillFloat32", "sinStep": 0.017, "cosStep": 0.023 }
|
| 1351 |
+
},
|
| 1352 |
+
"constant_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [-7.0] } }
|
| 1353 |
+
},
|
| 1354 |
+
"outputs": { "output": { "dtype": "float32", "shape": [6, 16, 35], "tolerance": 0 } }
|
| 1355 |
+
},
|
| 1356 |
+
{
|
| 1357 |
+
"name": "rank7_constant_last_axis",
|
| 1358 |
+
"attrs": { "mode": "constant", "pads": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1] },
|
| 1359 |
+
"inputs": {
|
| 1360 |
+
"data": {
|
| 1361 |
+
"dtype": "float32",
|
| 1362 |
+
"shape": [1, 2, 1, 2, 1, 2, 3],
|
| 1363 |
+
"data": { "kind": "linspace", "start": 1.0, "end": 24.0 }
|
| 1364 |
+
},
|
| 1365 |
+
"constant_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [-1.0] } }
|
| 1366 |
+
},
|
| 1367 |
+
"outputs": { "output": { "dtype": "float32", "shape": [1, 2, 1, 2, 1, 2, 4], "tolerance": 0 } }
|
| 1368 |
+
},
|
| 1369 |
+
{
|
| 1370 |
+
"name": "rank8_constant_last_axis",
|
| 1371 |
+
"attrs": { "mode": "constant", "pads": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1] },
|
| 1372 |
+
"inputs": {
|
| 1373 |
+
"data": {
|
| 1374 |
+
"dtype": "float32",
|
| 1375 |
+
"shape": [1, 2, 1, 2, 1, 2, 2, 3],
|
| 1376 |
+
"data": { "kind": "linspace", "start": 1.0, "end": 48.0 }
|
| 1377 |
+
},
|
| 1378 |
+
"constant_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [-1.0] } }
|
| 1379 |
+
},
|
| 1380 |
+
"outputs": { "output": { "dtype": "float32", "shape": [1, 2, 1, 2, 1, 2, 2, 4], "tolerance": 0 } }
|
| 1381 |
+
}
|
| 1382 |
+
]
|
| 1383 |
+
}
|