sync 6fdf6301e2bb
Browse files- README.md +3 -3
- build/webgpu/bench.json +3 -3
- build/webgpu/manifest.json +12 -29
- build/webgpu/metadata.json +8 -8
- build/webgpu/pad-quad-vec4.wgsl.jinja +0 -2
- build/webgpu/pad.wgsl.jinja +3 -6
- build/webgpu/test.json +103 -0
README.md
CHANGED
|
@@ -42,21 +42,21 @@ Attributes and default values (overridable per request):
|
|
| 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, per-variant templates, 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
|
| 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 |
```sh
|
| 59 |
-
npm install --save-exact @huggingface/kernels@0.0.1-preview.
|
| 60 |
```
|
| 61 |
|
| 62 |
Outputs with inferable metadata are allocated automatically. Explicit `outputs` entries request optional results or provide metadata that cannot be inferred from the supplied inputs and attributes.
|
|
|
|
| 42 |
|
| 43 |
| Variable | Allowed dtypes |
|
| 44 |
| --- | --- |
|
| 45 |
+
| `T` | `float32`, `float16`, `uint32`, `int32`, `uint8`, `int8`, `bool`, `int64` |
|
| 46 |
|
| 47 |
## Files
|
| 48 |
|
| 49 |
- [`metadata.json`](build/webgpu/metadata.json) — kernel metadata (id, digests, per-variant templates, 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 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 |
```sh
|
| 59 |
+
npm install --save-exact @huggingface/kernels@0.0.1-preview.3
|
| 60 |
```
|
| 61 |
|
| 62 |
Outputs with inferable metadata are allocated automatically. Explicit `outputs` entries request optional results or provide metadata that cannot be inferred from the supplied inputs and attributes.
|
build/webgpu/bench.json
CHANGED
|
@@ -77,7 +77,7 @@
|
|
| 77 |
"bench": { "metrics": [{ "type": "bandwidth", "value": "(numel(shapes.data) + numel(shapes.output)) * 2" }] }
|
| 78 |
},
|
| 79 |
{
|
| 80 |
-
"name": "
|
| 81 |
"preset": "stress",
|
| 82 |
"attrs": { "mode": "constant", "pads": [0, 0, 0, 0, 64, 0] },
|
| 83 |
"inputs": {
|
|
@@ -91,7 +91,7 @@
|
|
| 91 |
}
|
| 92 |
},
|
| 93 |
{
|
| 94 |
-
"name": "
|
| 95 |
"preset": "stress",
|
| 96 |
"attrs": { "mode": "edge", "pads": [0, 0, 1, 1, 0, 0, 1, 1] },
|
| 97 |
"inputs": { "data": { "dtype": "float32", "shape": [1, 64, 127, 127], "dist": "normal", "seed": 12, "scale": 2 } },
|
|
@@ -99,7 +99,7 @@
|
|
| 99 |
"bench": { "metrics": [{ "type": "bandwidth", "value": "(numel(shapes.data) + numel(shapes.output)) * 4" }] }
|
| 100 |
},
|
| 101 |
{
|
| 102 |
-
"name": "
|
| 103 |
"preset": "stress",
|
| 104 |
"attrs": { "mode": "constant", "pads": [1, 1, 1, 0] },
|
| 105 |
"inputs": {
|
|
|
|
| 77 |
"bench": { "metrics": [{ "type": "bandwidth", "value": "(numel(shapes.data) + numel(shapes.output)) * 2" }] }
|
| 78 |
},
|
| 79 |
{
|
| 80 |
+
"name": "rank3_value_input_scalar_path_large",
|
| 81 |
"preset": "stress",
|
| 82 |
"attrs": { "mode": "constant", "pads": [0, 0, 0, 0, 64, 0] },
|
| 83 |
"inputs": {
|
|
|
|
| 91 |
}
|
| 92 |
},
|
| 93 |
{
|
| 94 |
+
"name": "rank4_edge_inner_unaligned_scalar_path",
|
| 95 |
"preset": "stress",
|
| 96 |
"attrs": { "mode": "edge", "pads": [0, 0, 1, 1, 0, 0, 1, 1] },
|
| 97 |
"inputs": { "data": { "dtype": "float32", "shape": [1, 64, 127, 127], "dist": "normal", "seed": 12, "scale": 2 } },
|
|
|
|
| 99 |
"bench": { "metrics": [{ "type": "bandwidth", "value": "(numel(shapes.data) + numel(shapes.output)) * 4" }] }
|
| 100 |
},
|
| 101 |
{
|
| 102 |
+
"name": "rank2_constant_inner_unaligned_scalar_path",
|
| 103 |
"preset": "stress",
|
| 104 |
"attrs": { "mode": "constant", "pads": [1, 1, 1, 0] },
|
| 105 |
"inputs": {
|
build/webgpu/manifest.json
CHANGED
|
@@ -9,18 +9,21 @@
|
|
| 9 |
"pads": { "required": true },
|
| 10 |
"mode": { "values": ["constant", "reflect", "edge", "wrap"] }
|
| 11 |
},
|
| 12 |
-
"typeConstraints": { "T": ["float32", "float16", "uint32", "int32", "uint8", "int8", "bool"] },
|
| 13 |
"tunables": { "WORKGROUP_SIZE": { "default": 256 } },
|
| 14 |
"derive": {
|
| 15 |
"shapeContract": "ranks.data == ranks.output and ranks.output >= 1",
|
| 16 |
"defaultValueContract": "not present.constant_value and shapeContract and f16Ok(dtypes.T)",
|
| 17 |
"vec4Contract": "defaultValueContract and numel(shapes.output) > 0 and dim(shapes.output, ranks.output - 1) % 4 == 0",
|
| 18 |
"scalar": "dtypes.T",
|
| 19 |
-
"mode": "attrs.mode"
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
"
|
|
|
|
|
|
|
| 23 |
},
|
|
|
|
| 24 |
"variants": [
|
| 25 |
{
|
| 26 |
"id": "constant_value_input",
|
|
@@ -32,13 +35,6 @@
|
|
| 32 |
"id": "main",
|
| 33 |
"name": "Pad",
|
| 34 |
"shader": "pad.wgsl.jinja",
|
| 35 |
-
"derive": {
|
| 36 |
-
"dataShape": "shapes.data",
|
| 37 |
-
"outputShape": "shapes.output",
|
| 38 |
-
"rank": "ranks.output",
|
| 39 |
-
"pads": "attrs.pads",
|
| 40 |
-
"itemsPerInvocation": 4
|
| 41 |
-
},
|
| 42 |
"bindings": [
|
| 43 |
"data",
|
| 44 |
{ "arg": "constant_value", "name": "padValue", "elementType": "$scalar", "length": 1 },
|
|
@@ -56,20 +52,14 @@
|
|
| 56 |
{
|
| 57 |
"id": "quad_vec4",
|
| 58 |
"priority": 11,
|
| 59 |
-
"when": ["vec4Contract"],
|
| 60 |
"derive": { "outputElement": "\"vec4<\" ~ dtypes.T ~ \">\"", "vectorScalar": "\"vec4<\" ~ dtypes.T ~ \">\"" },
|
| 61 |
"passes": [
|
| 62 |
{
|
| 63 |
"id": "main",
|
| 64 |
-
"name": "Pad.
|
| 65 |
"shader": "pad-quad-vec4.wgsl.jinja",
|
| 66 |
-
"derive": {
|
| 67 |
-
"dataShape": "shapes.data",
|
| 68 |
-
"outputShape": "shapes.output",
|
| 69 |
-
"rank": "ranks.output",
|
| 70 |
-
"pads": "attrs.pads",
|
| 71 |
-
"value": 0
|
| 72 |
-
},
|
| 73 |
"bindings": ["data", { "arg": "output", "elementType": "$outputElement" }],
|
| 74 |
"dispatch": {
|
| 75 |
"x": "min(ceilDiv((numel(shapes.output) / 4), (tunables.WORKGROUP_SIZE)), min(device.limits.maxComputeWorkgroupsPerDimension, 65535))",
|
|
@@ -88,14 +78,7 @@
|
|
| 88 |
"id": "main",
|
| 89 |
"name": "Pad",
|
| 90 |
"shader": "pad.wgsl.jinja",
|
| 91 |
-
"derive": {
|
| 92 |
-
"dataShape": "shapes.data",
|
| 93 |
-
"outputShape": "shapes.output",
|
| 94 |
-
"rank": "ranks.output",
|
| 95 |
-
"pads": "attrs.pads",
|
| 96 |
-
"value": 0,
|
| 97 |
-
"itemsPerInvocation": 4
|
| 98 |
-
},
|
| 99 |
"bindings": ["data", "output", "params"],
|
| 100 |
"dispatch": {
|
| 101 |
"x": "min(ceilDiv((ceilDiv(numel(shapes.output), 4)), (tunables.WORKGROUP_SIZE)), 65535)",
|
|
|
|
| 9 |
"pads": { "required": true },
|
| 10 |
"mode": { "values": ["constant", "reflect", "edge", "wrap"] }
|
| 11 |
},
|
| 12 |
+
"typeConstraints": { "T": ["float32", "float16", "uint32", "int32", "uint8", "int8", "bool", "int64"] },
|
| 13 |
"tunables": { "WORKGROUP_SIZE": { "default": 256 } },
|
| 14 |
"derive": {
|
| 15 |
"shapeContract": "ranks.data == ranks.output and ranks.output >= 1",
|
| 16 |
"defaultValueContract": "not present.constant_value and shapeContract and f16Ok(dtypes.T)",
|
| 17 |
"vec4Contract": "defaultValueContract and numel(shapes.output) > 0 and dim(shapes.output, ranks.output - 1) % 4 == 0",
|
| 18 |
"scalar": "dtypes.T",
|
| 19 |
+
"mode": "attrs.mode",
|
| 20 |
+
"dataShape": "shapes.data",
|
| 21 |
+
"outputShape": "shapes.output",
|
| 22 |
+
"rank": "ranks.output",
|
| 23 |
+
"pads": "attrs.pads",
|
| 24 |
+
"itemsPerInvocation": 4
|
| 25 |
},
|
| 26 |
+
"bindings": { "params": { "struct": [{ "name": "count", "type": "u32", "value": "numel(shapes.output)" }] } },
|
| 27 |
"variants": [
|
| 28 |
{
|
| 29 |
"id": "constant_value_input",
|
|
|
|
| 35 |
"id": "main",
|
| 36 |
"name": "Pad",
|
| 37 |
"shader": "pad.wgsl.jinja",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
"bindings": [
|
| 39 |
"data",
|
| 40 |
{ "arg": "constant_value", "name": "padValue", "elementType": "$scalar", "length": 1 },
|
|
|
|
| 52 |
{
|
| 53 |
"id": "quad_vec4",
|
| 54 |
"priority": 11,
|
| 55 |
+
"when": ["dtypes.T != \"vec2<u32>\"", "vec4Contract"],
|
| 56 |
"derive": { "outputElement": "\"vec4<\" ~ dtypes.T ~ \">\"", "vectorScalar": "\"vec4<\" ~ dtypes.T ~ \">\"" },
|
| 57 |
"passes": [
|
| 58 |
{
|
| 59 |
"id": "main",
|
| 60 |
+
"name": "Pad.QuadVec4",
|
| 61 |
"shader": "pad-quad-vec4.wgsl.jinja",
|
| 62 |
+
"derive": { "value": 0 },
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
"bindings": ["data", { "arg": "output", "elementType": "$outputElement" }],
|
| 64 |
"dispatch": {
|
| 65 |
"x": "min(ceilDiv((numel(shapes.output) / 4), (tunables.WORKGROUP_SIZE)), min(device.limits.maxComputeWorkgroupsPerDimension, 65535))",
|
|
|
|
| 78 |
"id": "main",
|
| 79 |
"name": "Pad",
|
| 80 |
"shader": "pad.wgsl.jinja",
|
| 81 |
+
"derive": { "value": 0 },
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
"bindings": ["data", "output", "params"],
|
| 83 |
"dispatch": {
|
| 84 |
"x": "min(ceilDiv((ceilDiv(numel(shapes.output), 4)), (tunables.WORKGROUP_SIZE)), 65535)",
|
build/webgpu/metadata.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
| 1 |
{
|
| 2 |
"name": "ai.onnx.Pad",
|
| 3 |
-
"id": "
|
| 4 |
"version": 1,
|
| 5 |
"license": "Apache-2.0",
|
| 6 |
"backend": { "type": "webgpu" },
|
| 7 |
"digest": {
|
| 8 |
"algorithm": "sha256",
|
| 9 |
"files": {
|
| 10 |
-
"bench.json": "
|
| 11 |
-
"manifest.json": "
|
| 12 |
-
"pad-quad-vec4.wgsl.jinja": "
|
| 13 |
-
"pad.wgsl.jinja": "
|
| 14 |
-
"test.json": "
|
| 15 |
}
|
| 16 |
},
|
| 17 |
-
"provenance": { "kernel": { "sha": "
|
| 18 |
"webgpu": {
|
| 19 |
-
"manifestSpec": "2.
|
| 20 |
"variants": {
|
| 21 |
"constant_value_input": ["pad.wgsl.jinja"],
|
| 22 |
"quad_vec4": ["pad-quad-vec4.wgsl.jinja"],
|
|
|
|
| 1 |
{
|
| 2 |
"name": "ai.onnx.Pad",
|
| 3 |
+
"id": "_ai_onnx_pad_webgpu_f6b74c2",
|
| 4 |
"version": 1,
|
| 5 |
"license": "Apache-2.0",
|
| 6 |
"backend": { "type": "webgpu" },
|
| 7 |
"digest": {
|
| 8 |
"algorithm": "sha256",
|
| 9 |
"files": {
|
| 10 |
+
"bench.json": "UTHQCS/ec5z6S0xAS0MTjeXNVOdoMNrZl0ucq2NtMB8=",
|
| 11 |
+
"manifest.json": "bLjZA68bmGDgk9+7gG8Pgax+tfEag6hXtZuz84wxwh8=",
|
| 12 |
+
"pad-quad-vec4.wgsl.jinja": "p5a1bip066TyzgzmqEPY2T3HhvWviGjm/xvpNODTII4=",
|
| 13 |
+
"pad.wgsl.jinja": "Jhj/0J43kh7fQPKnCIdRD3aybTq0koRB8GGGmRZ8plE=",
|
| 14 |
+
"test.json": "9PTxHWGE1cnwGEiI0w5XTIsJlRK1lHpxQL1arNL4qxo="
|
| 15 |
}
|
| 16 |
},
|
| 17 |
+
"provenance": { "kernel": { "sha": "6fdf6301e2bbcc2f03bf1eaf493b7ad55ef33afc", "dirty": false } },
|
| 18 |
"webgpu": {
|
| 19 |
+
"manifestSpec": "2.1",
|
| 20 |
"variants": {
|
| 21 |
"constant_value_input": ["pad.wgsl.jinja"],
|
| 22 |
"quad_vec4": ["pad-quad-vec4.wgsl.jinja"],
|
build/webgpu/pad-quad-vec4.wgsl.jinja
CHANGED
|
@@ -8,7 +8,6 @@
|
|
| 8 |
// coordinate mapping.
|
| 9 |
{{ env.wgsl.resourceDeclarations }}
|
| 10 |
|
| 11 |
-
{% set rank = rank %}
|
| 12 |
fn map_coord(coord: i32, dim: i32) -> i32 {
|
| 13 |
if (coord >= 0i && coord < dim) {
|
| 14 |
return coord;
|
|
@@ -37,7 +36,6 @@ fn map_coord(coord: i32, dim: i32) -> i32 {
|
|
| 37 |
return period - wrapped;
|
| 38 |
{% endif %}
|
| 39 |
}
|
| 40 |
-
|
| 41 |
{% set countVecs = namespace(value=1) %}
|
| 42 |
{% for j in range(rank) %}
|
| 43 |
{% set countVecs.value = countVecs.value * outputShape[j] %}
|
|
|
|
| 8 |
// coordinate mapping.
|
| 9 |
{{ env.wgsl.resourceDeclarations }}
|
| 10 |
|
|
|
|
| 11 |
fn map_coord(coord: i32, dim: i32) -> i32 {
|
| 12 |
if (coord >= 0i && coord < dim) {
|
| 13 |
return coord;
|
|
|
|
| 36 |
return period - wrapped;
|
| 37 |
{% endif %}
|
| 38 |
}
|
|
|
|
| 39 |
{% set countVecs = namespace(value=1) %}
|
| 40 |
{% for j in range(rank) %}
|
| 41 |
{% set countVecs.value = countVecs.value * outputShape[j] %}
|
build/webgpu/pad.wgsl.jinja
CHANGED
|
@@ -12,9 +12,7 @@ fn main(@builtin(global_invocation_id) gid: vec3<u32>) {
|
|
| 12 |
for (var i = begin; i < end; i = i + 1u) {
|
| 13 |
{%- endmacro %}
|
| 14 |
{% macro flat_tail_close() %}
|
| 15 |
-
}
|
| 16 |
-
{% endmacro %}
|
| 17 |
-
|
| 18 |
{{ env.wgsl.resourceDeclarations }}
|
| 19 |
|
| 20 |
fn map_coord(coord: i32, dim: i32) -> i32 {
|
|
@@ -45,7 +43,6 @@ fn map_coord(coord: i32, dim: i32) -> i32 {
|
|
| 45 |
return period - wrapped;
|
| 46 |
{% endif %}
|
| 47 |
}
|
| 48 |
-
|
| 49 |
fn data_offset_or_invalid(out_index: u32) -> i32 {
|
| 50 |
var rem = out_index;
|
| 51 |
var offset = 0i;
|
|
@@ -99,10 +96,10 @@ fn data_offset_or_invalid(out_index: u32) -> i32 {
|
|
| 99 |
{% if valueFromInput %}
|
| 100 |
output[i] = padValue[0];
|
| 101 |
{% else %}
|
| 102 |
-
output[i] = {{ scalar }}({{ value }});
|
| 103 |
{% endif %}
|
| 104 |
} else {
|
| 105 |
output[i] = data[u32(src)];
|
| 106 |
}
|
| 107 |
-
{{ flat_tail_close()
|
| 108 |
}
|
|
|
|
| 12 |
for (var i = begin; i < end; i = i + 1u) {
|
| 13 |
{%- endmacro %}
|
| 14 |
{% macro flat_tail_close() %}
|
| 15 |
+
}{% endmacro %}
|
|
|
|
|
|
|
| 16 |
{{ env.wgsl.resourceDeclarations }}
|
| 17 |
|
| 18 |
fn map_coord(coord: i32, dim: i32) -> i32 {
|
|
|
|
| 43 |
return period - wrapped;
|
| 44 |
{% endif %}
|
| 45 |
}
|
|
|
|
| 46 |
fn data_offset_or_invalid(out_index: u32) -> i32 {
|
| 47 |
var rem = out_index;
|
| 48 |
var offset = 0i;
|
|
|
|
| 96 |
{% if valueFromInput %}
|
| 97 |
output[i] = padValue[0];
|
| 98 |
{% else %}
|
| 99 |
+
output[i] = {{ scalar }}({% if scalar == "vec2<u32>" %}0u{% else %}{{ value }}{% endif %});
|
| 100 |
{% endif %}
|
| 101 |
} else {
|
| 102 |
output[i] = data[u32(src)];
|
| 103 |
}
|
| 104 |
+
{{ flat_tail_close() }}
|
| 105 |
}
|
build/webgpu/test.json
CHANGED
|
@@ -1371,6 +1371,109 @@
|
|
| 1371 |
"constant_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [-1.0] } }
|
| 1372 |
},
|
| 1373 |
"outputs": { "output": { "dtype": "float32", "shape": [1, 2, 1, 2, 1, 2, 2, 4], "tolerance": 0 } }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1374 |
}
|
| 1375 |
]
|
| 1376 |
}
|
|
|
|
| 1371 |
"constant_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [-1.0] } }
|
| 1372 |
},
|
| 1373 |
"outputs": { "output": { "dtype": "float32", "shape": [1, 2, 1, 2, 1, 2, 2, 4], "tolerance": 0 } }
|
| 1374 |
+
},
|
| 1375 |
+
{
|
| 1376 |
+
"name": "int64_full_range_rank2_constant",
|
| 1377 |
+
"attrs": { "pads": [1, 2, 1, 0] },
|
| 1378 |
+
"inputs": {
|
| 1379 |
+
"data": {
|
| 1380 |
+
"dtype": "int64",
|
| 1381 |
+
"shape": [2, 3],
|
| 1382 |
+
"data": {
|
| 1383 |
+
"kind": "cycle",
|
| 1384 |
+
"values": ["0", "4294967296", "8589934593", "-4294967297", "9223372036854775807", "-9223372036854775808", "9223372036854775806", "-1"]
|
| 1385 |
+
}
|
| 1386 |
+
},
|
| 1387 |
+
"constant_value": {
|
| 1388 |
+
"dtype": "int64",
|
| 1389 |
+
"shape": [],
|
| 1390 |
+
"data": {
|
| 1391 |
+
"kind": "cycle",
|
| 1392 |
+
"values": ["0", "4294967296", "8589934593", "-4294967297", "9223372036854775807", "-9223372036854775808", "9223372036854775806", "-1"]
|
| 1393 |
+
}
|
| 1394 |
+
}
|
| 1395 |
+
},
|
| 1396 |
+
"outputs": { "output": { "dtype": "int64", "shape": [4, 5], "tolerance": 0, "relTolerance": 0 } },
|
| 1397 |
+
"tolerance": 0,
|
| 1398 |
+
"relTolerance": 0
|
| 1399 |
+
},
|
| 1400 |
+
{
|
| 1401 |
+
"name": "int64_full_range_ort_value_input_constant_1d",
|
| 1402 |
+
"provenance": {
|
| 1403 |
+
"source": "onnxruntime/test/providers/cpu/tensor/pad_test.cc",
|
| 1404 |
+
"test": "PadOpTest.Pad_Constant_1D",
|
| 1405 |
+
"notes": "Uses Pad's optional `constant_value` input. Pads remain supplied by the `pads` attribute, while the fill value comes directly from the input tensor."
|
| 1406 |
+
},
|
| 1407 |
+
"attrs": { "mode": "constant", "pads": [1, 2] },
|
| 1408 |
+
"inputs": {
|
| 1409 |
+
"data": {
|
| 1410 |
+
"dtype": "int64",
|
| 1411 |
+
"shape": [2],
|
| 1412 |
+
"data": {
|
| 1413 |
+
"kind": "cycle",
|
| 1414 |
+
"values": ["4294967296", "8589934593", "-4294967297", "9223372036854775807", "-9223372036854775808", "9223372036854775806", "-1", "0"]
|
| 1415 |
+
}
|
| 1416 |
+
},
|
| 1417 |
+
"constant_value": {
|
| 1418 |
+
"dtype": "int64",
|
| 1419 |
+
"shape": [],
|
| 1420 |
+
"data": {
|
| 1421 |
+
"kind": "cycle",
|
| 1422 |
+
"values": ["4294967296", "8589934593", "-4294967297", "9223372036854775807", "-9223372036854775808", "9223372036854775806", "-1", "0"]
|
| 1423 |
+
}
|
| 1424 |
+
}
|
| 1425 |
+
},
|
| 1426 |
+
"outputs": { "output": { "dtype": "int64", "shape": [5], "tolerance": 0, "relTolerance": 0 } },
|
| 1427 |
+
"tolerance": 0,
|
| 1428 |
+
"relTolerance": 0
|
| 1429 |
+
},
|
| 1430 |
+
{
|
| 1431 |
+
"name": "int64_default_zero",
|
| 1432 |
+
"inputs": {
|
| 1433 |
+
"data": {
|
| 1434 |
+
"dtype": "int64",
|
| 1435 |
+
"shape": [2],
|
| 1436 |
+
"data": { "kind": "values", "values": ["-9223372036854775808", "9223372036854775807"] }
|
| 1437 |
+
}
|
| 1438 |
+
},
|
| 1439 |
+
"outputs": { "output": { "dtype": "int64", "shape": [5], "tolerance": 0, "relTolerance": 0 } },
|
| 1440 |
+
"attrs": { "pads": [1, 2] }
|
| 1441 |
+
},
|
| 1442 |
+
{
|
| 1443 |
+
"name": "int64_padding_edge",
|
| 1444 |
+
"inputs": {
|
| 1445 |
+
"data": {
|
| 1446 |
+
"dtype": "int64",
|
| 1447 |
+
"shape": [3],
|
| 1448 |
+
"data": { "kind": "values", "values": ["-9223372036854775808", "9223372036854775807", "4294967296"] }
|
| 1449 |
+
}
|
| 1450 |
+
},
|
| 1451 |
+
"outputs": { "output": { "dtype": "int64", "shape": [6], "tolerance": 0, "relTolerance": 0 } },
|
| 1452 |
+
"attrs": { "pads": [1, 2], "mode": "edge" }
|
| 1453 |
+
},
|
| 1454 |
+
{
|
| 1455 |
+
"name": "int64_padding_reflect",
|
| 1456 |
+
"inputs": {
|
| 1457 |
+
"data": {
|
| 1458 |
+
"dtype": "int64",
|
| 1459 |
+
"shape": [3],
|
| 1460 |
+
"data": { "kind": "values", "values": ["-9223372036854775808", "9223372036854775807", "4294967296"] }
|
| 1461 |
+
}
|
| 1462 |
+
},
|
| 1463 |
+
"outputs": { "output": { "dtype": "int64", "shape": [6], "tolerance": 0, "relTolerance": 0 } },
|
| 1464 |
+
"attrs": { "pads": [1, 2], "mode": "reflect" }
|
| 1465 |
+
},
|
| 1466 |
+
{
|
| 1467 |
+
"name": "int64_padding_wrap",
|
| 1468 |
+
"inputs": {
|
| 1469 |
+
"data": {
|
| 1470 |
+
"dtype": "int64",
|
| 1471 |
+
"shape": [3],
|
| 1472 |
+
"data": { "kind": "values", "values": ["-9223372036854775808", "9223372036854775807", "4294967296"] }
|
| 1473 |
+
}
|
| 1474 |
+
},
|
| 1475 |
+
"outputs": { "output": { "dtype": "int64", "shape": [6], "tolerance": 0, "relTolerance": 0 } },
|
| 1476 |
+
"attrs": { "pads": [1, 2], "mode": "wrap" }
|
| 1477 |
}
|
| 1478 |
]
|
| 1479 |
}
|