Xenova HF Staff commited on
Commit
c1d13ab
·
verified ·
1 Parent(s): 0b7653b

sync 2e7068faf55e

Browse files
README.md CHANGED
@@ -1,3 +1,78 @@
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.Slice
10
+
11
+ `ai.onnx` · standard ONNX operator · ONNX opset ≥ 13
12
+
13
+ ## Description
14
+
15
+ Produces a slice of the input tensor along multiple axes, using `starts`, `ends`, `axes`, and `steps` to select a sub-tensor. Negative indices are resolved relative to the dimension size, and out-of-range values are clamped. Omitting `axes` defaults to all axes in order; omitting `steps` defaults to stride 1.
16
+
17
+ See the [ONNX `Slice` spec](https://onnx.ai/onnx/operators/onnx__Slice.html) for the reference semantics.
18
+
19
+ ## Inputs
20
+
21
+ | Name | Bind key | Logical dtype | Rank | Shape | Description | Presence |
22
+ | --- | --- | --- | --- | --- | --- | --- |
23
+ | `data` | `data` | `T` | — | — | Tensor of data to extract slices from. | required |
24
+ | `starts` | `starts` | `S` | `1` | — | 1-D tensor of starting indices for each axis in `axes`. | required |
25
+ | `ends` | `ends` | `S` | `1` | — | 1-D tensor of ending indices (exclusive) for each axis in `axes`. | required |
26
+ | `axes` | `axes` | `S` | `1` | — | Optional 1-D tensor of axes that `starts` and `ends` apply to; defaults to all axes if omitted. | optional |
27
+ | `steps` | `steps` | `S` | `1` | — | Optional 1-D tensor of step sizes per axis; negative steps slice backward, defaults to 1. | optional |
28
+
29
+ ## Outputs
30
+
31
+ | Name | Bind key | Logical dtype | Rank | Shape | Description | Presence |
32
+ | --- | --- | --- | --- | --- | --- | --- |
33
+ | `output` | `output` | `T` | same as `data` | — | Sliced data tensor. | required |
34
+
35
+ ## Type constraints
36
+
37
+ | Variable | Allowed dtypes |
38
+ | --- | --- |
39
+ | `T` | `float32`, `float16`, `uint32`, `int32`, `int16`, `uint8`, `int8`, `bool` |
40
+ | `S` | `int32` |
41
+
42
+ ## Files
43
+
44
+ - [`metadata.json`](build/webgpu/metadata.json) — kernel metadata (id, digests, provenance)
45
+ - [`manifest.json`](build/webgpu/manifest.json) — the op contract (source of truth)
46
+ - [`test.json`](build/webgpu/test.json) — correctness cases
47
+ - [`bench.json`](build/webgpu/bench.json) — benchmark + tuning cases
48
+ - [`datamove-slice-block.wgsl.jinja`](build/webgpu/datamove-slice-block.wgsl.jinja)
49
+ - [`slice-rank2-single-axis-x4.wgsl.jinja`](build/webgpu/slice-rank2-single-axis-x4.wgsl.jinja)
50
+ - [`slice.wgsl.jinja`](build/webgpu/slice.wgsl.jinja)
51
+
52
+ ## Use with `@huggingface/kernels`
53
+
54
+ The loader automatically allocates outputs whose metadata it can derive from the manifest contract and this call.
55
+
56
+ The explicit `outputs` entries provide shape and logical dtype metadata for the results listed below:
57
+
58
+ - `output`
59
+
60
+ Each entry either requests an optional result or supplies metadata that cannot be inferred from the inputs.
61
+
62
+ The `version: 1` option selects the published kernel contract; it is independent of any operator opset, contrib `since_version`, or model version.
63
+
64
+ Replace each `*Data` placeholder with a typed array containing the corresponding input data.
65
+
66
+ ```js
67
+ import { getKernel } from "@huggingface/kernels";
68
+
69
+ const kernel = await getKernel("webgpu-kernels/ai.onnx.Slice", { version: 1 });
70
+ // Explicit destinations request optional results or supply metadata that cannot be inferred.
71
+ const { output } = await kernel({
72
+ data: { data: dataData, shape: [2, 2] },
73
+ starts: { data: startsData, shape: [1] },
74
+ ends: { data: endsData, shape: [1] },
75
+ }, {
76
+ outputs: { output: { shape: [1, 2], dtype: "float32" } },
77
+ });
78
+ ```
build/webgpu/bench.json ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "op": "ai.onnx.Slice",
3
+ "tunableSpace": { "WORKGROUP_SIZE": [64, 128, 256] },
4
+ "cases": [
5
+ {
6
+ "name": "rank3_sequence_window",
7
+ "inputs": {
8
+ "data": { "dtype": "float32", "shape": [1, 128, 768] },
9
+ "starts": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 32 },
10
+ "ends": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 96 },
11
+ "axes": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 1 },
12
+ "steps": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 1 }
13
+ },
14
+ "outputs": { "output": { "dtype": "float32", "shape": [1, 64, 768] } }
15
+ },
16
+ {
17
+ "name": "rank3_end_past_dim",
18
+ "inputs": {
19
+ "data": { "dtype": "float32", "shape": [1, 128, 768] },
20
+ "starts": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 120 },
21
+ "ends": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 999 },
22
+ "axes": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 1 },
23
+ "steps": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 1 }
24
+ },
25
+ "outputs": { "output": { "dtype": "float32", "shape": [1, 8, 768] } }
26
+ },
27
+ {
28
+ "name": "slice-rows-aligned-f32-4096x4096",
29
+ "preset": "smoke",
30
+ "vars": { "outRows": 3584, "cols": 4096 },
31
+ "inputs": {
32
+ "data": { "dtype": "float32", "shape": [4096, 4096], "dist": "normal", "seed": 131, "scale": 0.5 },
33
+ "starts": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 256 },
34
+ "ends": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 3840 },
35
+ "axes": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 0 },
36
+ "steps": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 1 }
37
+ },
38
+ "outputs": { "output": { "dtype": "float32", "shape": [3584, 4096] } },
39
+ "bench": { "primary": true, "metrics": [{ "type": "bandwidth", "value": "args.outRows * args.cols * 4 * 2" }] }
40
+ },
41
+ {
42
+ "name": "slice-inner-misaligned-f32-4096x4100",
43
+ "preset": "smoke",
44
+ "vars": { "rows": 4096, "outCols": 4096 },
45
+ "inputs": {
46
+ "data": { "dtype": "float32", "shape": [4096, 4100], "dist": "normal", "seed": 132, "scale": 0.5 },
47
+ "starts": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 2 },
48
+ "ends": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 4098 },
49
+ "axes": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 1 },
50
+ "steps": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 1 }
51
+ },
52
+ "outputs": { "output": { "dtype": "float32", "shape": [4096, 4096] } },
53
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "args.rows * args.outCols * 4 * 2" }] }
54
+ },
55
+ {
56
+ "name": "slice-rows-aligned-f16-4096x2048",
57
+ "preset": "edge",
58
+ "vars": { "outRows": 3072, "cols": 2048, "dtype": "float16" },
59
+ "inputs": {
60
+ "data": { "dtype": "float16", "shape": [4096, 2048], "dist": "normal", "seed": 133, "scale": 0.5 },
61
+ "starts": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 512 },
62
+ "ends": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 3584 },
63
+ "axes": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 0 },
64
+ "steps": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 1 }
65
+ },
66
+ "outputs": { "output": { "dtype": "float16", "shape": [3072, 2048] } },
67
+ "bench": {
68
+ "metrics": [{ "type": "bandwidth", "value": "args.outRows * args.cols * dtypeBytes(args.dtype) * 2" }]
69
+ }
70
+ },
71
+ {
72
+ "name": "slice-inner-true-misaligned-f32-4096x4097",
73
+ "preset": "edge",
74
+ "vars": { "rows": 4096, "outCols": 4097 },
75
+ "inputs": {
76
+ "data": { "dtype": "float32", "shape": [8192, 4097], "dist": "normal", "seed": 141, "scale": 0.5 },
77
+ "starts": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 2048 },
78
+ "ends": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 6144 },
79
+ "axes": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 0 },
80
+ "steps": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 1 }
81
+ },
82
+ "outputs": { "output": { "dtype": "float32", "shape": [4096, 4097] } },
83
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "args.rows * args.outCols * 4 * 2" }] }
84
+ },
85
+ {
86
+ "name": "slice-no-axes-no-steps-f32-4096x4096",
87
+ "preset": "edge",
88
+ "vars": { "outRows": 3584, "cols": 4096 },
89
+ "inputs": {
90
+ "data": { "dtype": "float32", "shape": [4096, 4096], "dist": "normal", "seed": 142, "scale": 0.5 },
91
+ "starts": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 256 },
92
+ "ends": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 3840 }
93
+ },
94
+ "outputs": { "output": { "dtype": "float32", "shape": [3584, 4096] } },
95
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "args.outRows * args.cols * 4 * 2" }] }
96
+ },
97
+ {
98
+ "name": "slice-inner-vec4-unaligned-reverse-f32-4096x4096",
99
+ "preset": "stress",
100
+ "vars": { "rows": 4096, "cols": 4096 },
101
+ "inputs": {
102
+ "data": { "dtype": "float32", "shape": [4096, 4096], "dist": "normal", "seed": 151, "scale": 0.5 },
103
+ "starts": { "dtype": "int32", "shape": [1], "dist": "constant", "value": -1 },
104
+ "ends": { "dtype": "int32", "shape": [1], "dist": "constant", "value": -2147483648 },
105
+ "axes": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 1 },
106
+ "steps": { "dtype": "int32", "shape": [1], "dist": "constant", "value": -1 }
107
+ },
108
+ "outputs": { "output": { "dtype": "float32", "shape": [4096, 4096], "dist": "empty" } },
109
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "args.rows * args.cols * 4 * 2" }] }
110
+ },
111
+ {
112
+ "name": "slice-rows-aligned-f32-2048x2048",
113
+ "preset": "smoke",
114
+ "vars": { "outRows": 1792, "cols": 2048 },
115
+ "inputs": {
116
+ "data": { "dtype": "float32", "shape": [2048, 2048], "dist": "normal", "seed": 134, "scale": 0.5 },
117
+ "starts": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 128 },
118
+ "ends": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 1920 },
119
+ "axes": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 0 },
120
+ "steps": { "dtype": "int32", "shape": [1], "dist": "constant", "value": 1 }
121
+ },
122
+ "outputs": { "output": { "dtype": "float32", "shape": [1792, 2048] } },
123
+ "bench": { "metrics": [{ "type": "bandwidth", "value": "args.outRows * args.cols * 4 * 2" }] }
124
+ }
125
+ ]
126
+ }
build/webgpu/datamove-slice-block.wgsl.jinja ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Slice with vec4 loads and stores over the innermost axis.
2
+ //
3
+ // The innermost input and output dimensions are multiples of four, and the
4
+ // output is non-empty. Both buffers can therefore bind as vec4<T>, with every
5
+ // output vector contained within one output row.
6
+ //
7
+ // starts, axes, and steps are runtime tensors, so the GPU resolves innermost-
8
+ // axis slicing once per thread. A unit step with a 16-byte-aligned start uses
9
+ // one vec4 load per vec4 store. Strided, reversed, or misaligned slices instead
10
+ // assemble four components through the vec4 binding and still issue one vec4
11
+ // store. Outer-axis offsets use literal strides and remain multiples of four.
12
+ // The normalization and clamping below preserve out-of-bounds starts and
13
+ // negative steps.
14
+ {% if usesF16 %}
15
+ enable f16;
16
+ {% endif %}
17
+ {{ env.wgsl.resourceDeclarations }}
18
+
19
+ const COUNT: u32 = {{ source.count }}u;
20
+ const WG: u32 = {{ tunables.WORKGROUP_SIZE }}u;
21
+ const RANK: u32 = {{ source.rank }}u;
22
+ const SLICE_RANK: u32 = {{ source.sliceRank }}u;
23
+ const INNER_AXIS: u32 = {{ source.rank - 1 }}u;
24
+ const INNER_DIM_DATA: i32 = {{ source.dataShape[source.rank - 1] }};
25
+ const INNER_VECS_OUT: u32 = {{ ((source.outputShape[source.rank - 1] / 4) | int) }}u;
26
+ {% if source.rank != 1 %}
27
+ const DATA_SHAPE: array<i32, {{ source.rank }}> = array<i32, {{ source.rank }}>({% for d in source.dataShape %}{{ d }}{% if not loop.last %}, {% endif %}{% endfor %});
28
+
29
+ {% endif %}
30
+ fn normalized_axis(raw_axis: i32) -> u32 {
31
+ var axis = raw_axis;
32
+ if (axis < 0) {
33
+ axis = axis + i32(RANK);
34
+ }
35
+ return u32(axis);
36
+ }
37
+
38
+ fn normalized_start(raw_start: i32, step: i32, dim: i32) -> i32 {
39
+ var start = raw_start;
40
+ if (start < 0) {
41
+ start = start + dim;
42
+ }
43
+ if (step < 0) {
44
+ return clamp(start, -1, dim - 1);
45
+ }
46
+ return clamp(start, 0, dim);
47
+ }
48
+ {% if source.rank != 1 %}
49
+
50
+ fn data_coord(axis: u32, out_coord: u32) -> u32 {
51
+ {% if source.sliceRank == 1 %}
52
+ if (normalized_axis(i32(axes[0])) == axis) {
53
+ let step = i32(steps[0]);
54
+ let start = normalized_start(i32(starts[0]), step, DATA_SHAPE[axis]);
55
+ return u32(start + i32(out_coord) * step);
56
+ }
57
+ return out_coord;
58
+ {% else %}
59
+ var coord = i32(out_coord);
60
+ for (var i = 0u; i < SLICE_RANK; i = i + 1u) {
61
+ if (normalized_axis(i32(axes[i])) == axis) {
62
+ let step = i32(steps[i]);
63
+ let start = normalized_start(i32(starts[i]), step, DATA_SHAPE[axis]);
64
+ coord = start + i32(out_coord) * step;
65
+ }
66
+ }
67
+ return u32(coord);
68
+ {% endif %}
69
+ }
70
+
71
+ {% endif %}
72
+ // Data offset (in scalars) contributed by the outer axes; always % 4 == 0
73
+ // because every outer data stride is a multiple of the innermost data dim.
74
+ fn outer_data_offset({% if source.rank != 1 %}outer_index: u32{% endif %}) -> u32 {
75
+ {% if source.rank == 1 %}
76
+ return 0u;
77
+ {% else %}
78
+ var rem = outer_index;
79
+ var offset = 0u;
80
+ {% for axis in range(source.rank - 1) %}
81
+ {% set out_stride = namespace(value=1) %}
82
+ {% for j in range(axis + 1, source.rank - 1) %}
83
+ {% set out_stride.value = out_stride.value * source.outputShape[j] %}
84
+ {% endfor %}
85
+ {% set safe_out_stride = out_stride.value %}
86
+ {% set data_stride = namespace(value=1) %}
87
+ {% for j in range(axis + 1, source.rank) %}
88
+ {% set data_stride.value = data_stride.value * source.dataShape[j] %}
89
+ {% endfor %}
90
+ let out_coord{{ axis }} = rem / {{ safe_out_stride }}u;
91
+ rem = rem % {{ safe_out_stride }}u;
92
+ offset = offset + data_coord({{ axis }}u, out_coord{{ axis }}) * {{ data_stride.value }}u;
93
+ {% endfor %}
94
+ return offset;
95
+ {% endif %}
96
+ }
97
+
98
+ @compute @workgroup_size({{ tunables.WORKGROUP_SIZE }})
99
+ fn main(
100
+ @builtin(global_invocation_id) gid: vec3<u32>,
101
+ @builtin(num_workgroups) nwg: vec3<u32>
102
+ ) {
103
+ var inner_step: i32 = 1;
104
+ var inner_start: i32 = 0;
105
+ for (var s = 0u; s < SLICE_RANK; s = s + 1u) {
106
+ if (normalized_axis(i32(axes[s])) == INNER_AXIS) {
107
+ inner_step = i32(steps[s]);
108
+ inner_start = normalized_start(i32(starts[s]), inner_step, INNER_DIM_DATA);
109
+ }
110
+ }
111
+ let aligned = inner_step == 1 && (inner_start % 4) == 0;
112
+ let stride = nwg.x * WG;
113
+ for (var i = gid.x; i < COUNT; i += stride) {
114
+ {% if source.rank != 1 %}
115
+ let outer_idx = i / INNER_VECS_OUT;
116
+ {% endif %}
117
+ let inner_vec = i % INNER_VECS_OUT;
118
+ let base = outer_data_offset({% if source.rank != 1 %}outer_idx{% endif %});
119
+ if (aligned) {
120
+ output[i] = data[base / 4u + u32(inner_start) / 4u + inner_vec];
121
+ } else {
122
+ let c0 = i32(inner_vec) * 4;
123
+ let d0 = base + u32(inner_start + c0 * inner_step);
124
+ let d1 = base + u32(inner_start + (c0 + 1) * inner_step);
125
+ let d2 = base + u32(inner_start + (c0 + 2) * inner_step);
126
+ let d3 = base + u32(inner_start + (c0 + 3) * inner_step);
127
+ output[i] = {{ vectorScalar }}(
128
+ data[d0 / 4u][d0 % 4u],
129
+ data[d1 / 4u][d1 % 4u],
130
+ data[d2 / 4u][d2 % 4u],
131
+ data[d3 / 4u][d3 % 4u]
132
+ );
133
+ }
134
+ }
135
+ }
build/webgpu/manifest.json ADDED
@@ -0,0 +1,409 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "domain": "ai.onnx",
3
+ "name": "Slice",
4
+ "sinceVersion": 13,
5
+ "description": "Produces a slice of the input tensor along multiple axes, using `starts`, `ends`, `axes`, and `steps` to select a sub-tensor. Negative indices are resolved relative to the dimension size, and out-of-range values are clamped. Omitting `axes` defaults to all axes in order; omitting `steps` defaults to stride 1.",
6
+ "inputs": [
7
+ { "role": "data", "dtype": "T", "description": "Tensor of data to extract slices from." },
8
+ {
9
+ "role": "starts",
10
+ "dtype": "S",
11
+ "description": "1-D tensor of starting indices for each axis in `axes`.",
12
+ "rank": 1
13
+ },
14
+ {
15
+ "role": "ends",
16
+ "dtype": "S",
17
+ "description": "1-D tensor of ending indices (exclusive) for each axis in `axes`.",
18
+ "rank": 1
19
+ },
20
+ {
21
+ "role": "axes",
22
+ "dtype": "S",
23
+ "optional": true,
24
+ "description": "Optional 1-D tensor of axes that `starts` and `ends` apply to; defaults to all axes if omitted.",
25
+ "rank": 1
26
+ },
27
+ {
28
+ "role": "steps",
29
+ "dtype": "S",
30
+ "optional": true,
31
+ "description": "Optional 1-D tensor of step sizes per axis; negative steps slice backward, defaults to 1.",
32
+ "rank": 1
33
+ }
34
+ ],
35
+ "outputs": [{ "role": "output", "dtype": "T", "description": "Sliced data tensor.", "rank": "ranks.data" }],
36
+ "typeConstraints": {
37
+ "T": ["float32", "float16", "uint32", "int32", "int16", "uint8", "int8", "bool"],
38
+ "S": ["int32"]
39
+ },
40
+ "args": {
41
+ "data": { "kind": "tensor", "semantic": "data", "role": "input" },
42
+ "starts": { "kind": "tensor", "semantic": "starts", "role": "starts" },
43
+ "ends": { "kind": "tensor", "semantic": "ends", "role": "ends" },
44
+ "axes": { "kind": "tensor", "semantic": "axes", "role": "axes", "required": false },
45
+ "steps": { "kind": "tensor", "semantic": "steps", "role": "steps", "required": false },
46
+ "output": { "kind": "tensor", "semantic": "output", "role": "output" }
47
+ },
48
+ "tunables": { "WORKGROUP_SIZE": 256 },
49
+ "constants": { "indexScalar": "dtypes.S", "usesF16": "dtypes.T == \"f16\"" },
50
+ "variants": [
51
+ {
52
+ "id": "rank2_single_axis_x4",
53
+ "priority": 14,
54
+ "when": ["present.axes", "present.steps", "ranks.data == 2", "ranks.output == 2", "ranks.starts == 1", "ranks.ends == 1", "ranks.axes == 1", "ranks.steps == 1", "dim(shapes.starts, 0) == 1", "dim(shapes.ends, 0) == 1", "dim(shapes.axes, 0) == 1", "dim(shapes.steps, 0) == 1", "dim(shapes.data, 1) == dim(shapes.output, 1)", "dim(shapes.data, 0) != dim(shapes.output, 0)", "dim(shapes.data, 1) % 4 != 0", "numel(shapes.output) > 0", "f16Ok(dtypes.T)"],
55
+ "constants": { "scalar": "dtypes.T" },
56
+ "passes": [
57
+ {
58
+ "id": "main",
59
+ "name": "Slice.rank2SingleAxisX4",
60
+ "source": {
61
+ "shader": "slice-rank2-single-axis-x4.wgsl.jinja",
62
+ "inputs": { "dataShape": "shapes.data", "outputShape": "shapes.output", "count": "numel(shapes.output)" }
63
+ },
64
+ "bindings": [
65
+ {
66
+ "name": "data",
67
+ "arg": "data",
68
+ "semantic": "data",
69
+ "buffer": { "type": "read-only-storage" },
70
+ "elementType": "$scalar"
71
+ },
72
+ {
73
+ "name": "starts",
74
+ "arg": "starts",
75
+ "semantic": "starts",
76
+ "buffer": { "type": "read-only-storage" },
77
+ "elementType": "$indexScalar",
78
+ "length": 1
79
+ },
80
+ {
81
+ "name": "axes",
82
+ "arg": "axes",
83
+ "semantic": "axes",
84
+ "buffer": { "type": "read-only-storage" },
85
+ "elementType": "$indexScalar",
86
+ "length": 1
87
+ },
88
+ {
89
+ "name": "steps",
90
+ "arg": "steps",
91
+ "semantic": "steps",
92
+ "buffer": { "type": "read-only-storage" },
93
+ "elementType": "$indexScalar",
94
+ "length": 1
95
+ },
96
+ {
97
+ "name": "output",
98
+ "arg": "output",
99
+ "semantic": "output",
100
+ "buffer": { "type": "storage" },
101
+ "elementType": "$scalar"
102
+ }
103
+ ],
104
+ "dispatch": { "gridStride": "ceilDiv(numel(shapes.output), 4)", "workgroupSize": "tunables.WORKGROUP_SIZE" }
105
+ }
106
+ ]
107
+ },
108
+ {
109
+ "id": "inner_vec4",
110
+ "priority": 12,
111
+ "when": ["present.axes", "present.steps", "ranks.data >= 1", "ranks.output == ranks.data", "ranks.starts == 1", "ranks.ends == 1", "ranks.axes == 1", "ranks.steps == 1", "dim(shapes.starts, 0) == dim(shapes.ends, 0)", "dim(shapes.starts, 0) == dim(shapes.axes, 0)", "dim(shapes.starts, 0) == dim(shapes.steps, 0)", "dim(shapes.starts, 0) <= ranks.data", "numel(shapes.output) > 0", "dim(shapes.data, ranks.data - 1) % 4 == 0", "dim(shapes.output, ranks.data - 1) % 4 == 0", "f16Ok(dtypes.T)"],
112
+ "constants": { "vectorScalar": "\"vec4<\" ~ dtypes.T ~ \">\"" },
113
+ "passes": [
114
+ {
115
+ "id": "main",
116
+ "name": "Slice.innerVec4",
117
+ "source": {
118
+ "shader": "datamove-slice-block.wgsl.jinja",
119
+ "inputs": {
120
+ "dataShape": "shapes.data",
121
+ "outputShape": "shapes.output",
122
+ "rank": "ranks.data",
123
+ "sliceRank": "dim(shapes.starts, 0)",
124
+ "count": "numel(shapes.output) / 4"
125
+ }
126
+ },
127
+ "bindings": [
128
+ {
129
+ "name": "data",
130
+ "arg": "data",
131
+ "semantic": "data",
132
+ "buffer": { "type": "read-only-storage" },
133
+ "elementType": "$vectorScalar"
134
+ },
135
+ {
136
+ "name": "starts",
137
+ "arg": "starts",
138
+ "semantic": "starts",
139
+ "buffer": { "type": "read-only-storage" },
140
+ "elementType": "$indexScalar"
141
+ },
142
+ {
143
+ "name": "axes",
144
+ "arg": "axes",
145
+ "semantic": "axes",
146
+ "buffer": { "type": "read-only-storage" },
147
+ "elementType": "$indexScalar"
148
+ },
149
+ {
150
+ "name": "steps",
151
+ "arg": "steps",
152
+ "semantic": "steps",
153
+ "buffer": { "type": "read-only-storage" },
154
+ "elementType": "$indexScalar"
155
+ },
156
+ {
157
+ "name": "output",
158
+ "arg": "output",
159
+ "semantic": "output",
160
+ "buffer": { "type": "storage" },
161
+ "elementType": "$vectorScalar"
162
+ }
163
+ ],
164
+ "dispatch": { "gridStride": "numel(shapes.output) / 4", "workgroupSize": "tunables.WORKGROUP_SIZE" }
165
+ }
166
+ ]
167
+ },
168
+ {
169
+ "id": "generic_metadata",
170
+ "when": ["present.axes", "present.steps", "ranks.data >= 1", "ranks.output == ranks.data", "ranks.starts == 1", "ranks.ends == 1", "ranks.axes == 1", "ranks.steps == 1", "dim(shapes.starts, 0) == dim(shapes.ends, 0)", "dim(shapes.starts, 0) == dim(shapes.axes, 0)", "dim(shapes.starts, 0) == dim(shapes.steps, 0)", "dim(shapes.starts, 0) <= ranks.data", "f16Ok(dtypes.T)"],
171
+ "constants": { "scalar": "dtypes.T", "presentAxes": true, "presentSteps": true },
172
+ "passes": [
173
+ {
174
+ "id": "main",
175
+ "name": "Slice",
176
+ "source": {
177
+ "shader": "slice.wgsl.jinja",
178
+ "inputs": {
179
+ "dataShape": "shapes.data",
180
+ "outputShape": "shapes.output",
181
+ "rank": "ranks.data",
182
+ "sliceRank": "dim(shapes.starts, 0)"
183
+ }
184
+ },
185
+ "bindings": [
186
+ {
187
+ "name": "data",
188
+ "arg": "data",
189
+ "semantic": "data",
190
+ "buffer": { "type": "read-only-storage" },
191
+ "elementType": "$scalar"
192
+ },
193
+ {
194
+ "name": "starts",
195
+ "arg": "starts",
196
+ "semantic": "starts",
197
+ "buffer": { "type": "read-only-storage" },
198
+ "elementType": "$indexScalar"
199
+ },
200
+ {
201
+ "name": "axes",
202
+ "arg": "axes",
203
+ "semantic": "axes",
204
+ "buffer": { "type": "read-only-storage" },
205
+ "elementType": "$indexScalar"
206
+ },
207
+ {
208
+ "name": "steps",
209
+ "arg": "steps",
210
+ "semantic": "steps",
211
+ "buffer": { "type": "read-only-storage" },
212
+ "elementType": "$indexScalar"
213
+ },
214
+ {
215
+ "name": "output",
216
+ "arg": "output",
217
+ "semantic": "output",
218
+ "buffer": { "type": "storage" },
219
+ "elementType": "$scalar"
220
+ },
221
+ {
222
+ "name": "params",
223
+ "semantic": "kernel.params",
224
+ "buffer": { "type": "uniform" },
225
+ "struct": {
226
+ "name": "Params",
227
+ "fields": [{ "name": "count", "type": "u32", "value": "numel(shapes.output)" }]
228
+ }
229
+ }
230
+ ],
231
+ "dispatch": { "gridStride": "numel(shapes.output)", "workgroupSize": "tunables.WORKGROUP_SIZE" }
232
+ }
233
+ ]
234
+ },
235
+ {
236
+ "id": "generic_metadata_no_steps",
237
+ "when": ["present.axes", "not present.steps", "ranks.data >= 1", "ranks.output == ranks.data", "ranks.starts == 1", "ranks.ends == 1", "ranks.axes == 1", "dim(shapes.starts, 0) == dim(shapes.ends, 0)", "dim(shapes.starts, 0) == dim(shapes.axes, 0)", "dim(shapes.starts, 0) <= ranks.data", "f16Ok(dtypes.T)"],
238
+ "constants": { "scalar": "dtypes.T", "presentAxes": true, "presentSteps": false },
239
+ "passes": [
240
+ {
241
+ "id": "main",
242
+ "name": "Slice",
243
+ "source": {
244
+ "shader": "slice.wgsl.jinja",
245
+ "inputs": {
246
+ "dataShape": "shapes.data",
247
+ "outputShape": "shapes.output",
248
+ "rank": "ranks.data",
249
+ "sliceRank": "dim(shapes.starts, 0)"
250
+ }
251
+ },
252
+ "bindings": [
253
+ {
254
+ "name": "data",
255
+ "arg": "data",
256
+ "semantic": "data",
257
+ "buffer": { "type": "read-only-storage" },
258
+ "elementType": "$scalar"
259
+ },
260
+ {
261
+ "name": "starts",
262
+ "arg": "starts",
263
+ "semantic": "starts",
264
+ "buffer": { "type": "read-only-storage" },
265
+ "elementType": "$indexScalar"
266
+ },
267
+ {
268
+ "name": "axes",
269
+ "arg": "axes",
270
+ "semantic": "axes",
271
+ "buffer": { "type": "read-only-storage" },
272
+ "elementType": "$indexScalar"
273
+ },
274
+ {
275
+ "name": "output",
276
+ "arg": "output",
277
+ "semantic": "output",
278
+ "buffer": { "type": "storage" },
279
+ "elementType": "$scalar"
280
+ },
281
+ {
282
+ "name": "params",
283
+ "semantic": "kernel.params",
284
+ "buffer": { "type": "uniform" },
285
+ "struct": {
286
+ "name": "Params",
287
+ "fields": [{ "name": "count", "type": "u32", "value": "numel(shapes.output)" }]
288
+ }
289
+ }
290
+ ],
291
+ "dispatch": { "gridStride": "numel(shapes.output)", "workgroupSize": "tunables.WORKGROUP_SIZE" }
292
+ }
293
+ ]
294
+ },
295
+ {
296
+ "id": "generic_metadata_no_axes",
297
+ "when": ["not present.axes", "not present.steps", "ranks.data >= 1", "ranks.output == ranks.data", "ranks.starts == 1", "ranks.ends == 1", "dim(shapes.starts, 0) == dim(shapes.ends, 0)", "dim(shapes.starts, 0) <= ranks.data", "f16Ok(dtypes.T)"],
298
+ "constants": { "scalar": "dtypes.T", "presentAxes": false, "presentSteps": false },
299
+ "passes": [
300
+ {
301
+ "id": "main",
302
+ "name": "Slice",
303
+ "source": {
304
+ "shader": "slice.wgsl.jinja",
305
+ "inputs": {
306
+ "dataShape": "shapes.data",
307
+ "outputShape": "shapes.output",
308
+ "rank": "ranks.data",
309
+ "sliceRank": "dim(shapes.starts, 0)"
310
+ }
311
+ },
312
+ "bindings": [
313
+ {
314
+ "name": "data",
315
+ "arg": "data",
316
+ "semantic": "data",
317
+ "buffer": { "type": "read-only-storage" },
318
+ "elementType": "$scalar"
319
+ },
320
+ {
321
+ "name": "starts",
322
+ "arg": "starts",
323
+ "semantic": "starts",
324
+ "buffer": { "type": "read-only-storage" },
325
+ "elementType": "$indexScalar"
326
+ },
327
+ {
328
+ "name": "output",
329
+ "arg": "output",
330
+ "semantic": "output",
331
+ "buffer": { "type": "storage" },
332
+ "elementType": "$scalar"
333
+ },
334
+ {
335
+ "name": "params",
336
+ "semantic": "kernel.params",
337
+ "buffer": { "type": "uniform" },
338
+ "struct": {
339
+ "name": "Params",
340
+ "fields": [{ "name": "count", "type": "u32", "value": "numel(shapes.output)" }]
341
+ }
342
+ }
343
+ ],
344
+ "dispatch": { "gridStride": "numel(shapes.output)", "workgroupSize": "tunables.WORKGROUP_SIZE" }
345
+ }
346
+ ]
347
+ },
348
+ {
349
+ "id": "generic_metadata_no_axes_steps",
350
+ "when": ["not present.axes", "present.steps", "ranks.data >= 1", "ranks.output == ranks.data", "ranks.starts == 1", "ranks.ends == 1", "ranks.steps == 1", "dim(shapes.starts, 0) == dim(shapes.ends, 0)", "dim(shapes.starts, 0) == dim(shapes.steps, 0)", "dim(shapes.starts, 0) <= ranks.data", "f16Ok(dtypes.T)"],
351
+ "constants": { "scalar": "dtypes.T", "presentAxes": false, "presentSteps": true },
352
+ "passes": [
353
+ {
354
+ "id": "main",
355
+ "name": "Slice",
356
+ "source": {
357
+ "shader": "slice.wgsl.jinja",
358
+ "inputs": {
359
+ "dataShape": "shapes.data",
360
+ "outputShape": "shapes.output",
361
+ "rank": "ranks.data",
362
+ "sliceRank": "dim(shapes.starts, 0)"
363
+ }
364
+ },
365
+ "bindings": [
366
+ {
367
+ "name": "data",
368
+ "arg": "data",
369
+ "semantic": "data",
370
+ "buffer": { "type": "read-only-storage" },
371
+ "elementType": "$scalar"
372
+ },
373
+ {
374
+ "name": "starts",
375
+ "arg": "starts",
376
+ "semantic": "starts",
377
+ "buffer": { "type": "read-only-storage" },
378
+ "elementType": "$indexScalar"
379
+ },
380
+ {
381
+ "name": "steps",
382
+ "arg": "steps",
383
+ "semantic": "steps",
384
+ "buffer": { "type": "read-only-storage" },
385
+ "elementType": "$indexScalar"
386
+ },
387
+ {
388
+ "name": "output",
389
+ "arg": "output",
390
+ "semantic": "output",
391
+ "buffer": { "type": "storage" },
392
+ "elementType": "$scalar"
393
+ },
394
+ {
395
+ "name": "params",
396
+ "semantic": "kernel.params",
397
+ "buffer": { "type": "uniform" },
398
+ "struct": {
399
+ "name": "Params",
400
+ "fields": [{ "name": "count", "type": "u32", "value": "numel(shapes.output)" }]
401
+ }
402
+ }
403
+ ],
404
+ "dispatch": { "gridStride": "numel(shapes.output)", "workgroupSize": "tunables.WORKGROUP_SIZE" }
405
+ }
406
+ ]
407
+ }
408
+ ]
409
+ }
build/webgpu/metadata.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "ai.onnx.Slice",
3
+ "id": "_ai_onnx_slice_webgpu_c87b8e2",
4
+ "version": 1,
5
+ "license": "Apache-2.0",
6
+ "backend": { "type": "webgpu" },
7
+ "digest": {
8
+ "algorithm": "sha256",
9
+ "files": {
10
+ "bench.json": "x9yDnzXstMYgGKR+oNwCljthYvd8NHQrJare/so3wFg=",
11
+ "datamove-slice-block.wgsl.jinja": "xBxRnx+M6qii0SdRIaFx6S1aOpIzUG75wWmlsxxOtRs=",
12
+ "manifest.json": "E5q+nglUrb3bELWEV12AAnrOKoketNHOHOsiBMV97rs=",
13
+ "slice-rank2-single-axis-x4.wgsl.jinja": "ykb8cr+AYZNBrLTdyR59y8vyg2lJzB//Kzss0/73744=",
14
+ "slice.wgsl.jinja": "EPEvvrs04aKI7ZhxJSAie3FC3CFl3iUWBNrNYTd+6YI=",
15
+ "test.json": "xE6Be8yfOVdyB6LcHzbHD4cUYMc6g45IxpYhTUJWJVY="
16
+ }
17
+ },
18
+ "provenance": { "kernel": { "sha": "2e7068faf55e7f43df740015f6d1ee49391a41c5", "dirty": false } },
19
+ "webgpu": { "manifestSpec": "1.0", "specialized": true, "opPath": "ops/ai.onnx.Slice" }
20
+ }
build/webgpu/slice-rank2-single-axis-x4.wgsl.jinja ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {% if usesF16 %}
2
+ enable f16;
3
+ {% endif %}
4
+ {{ env.wgsl.resourceDeclarations }}
5
+
6
+ const COUNT: u32 = {{ source.count }}u;
7
+ const DATA_ROWS: u32 = {{ source.dataShape[0] }}u;
8
+ const DATA_COLS: u32 = {{ source.dataShape[1] }}u;
9
+ const OUT_COLS: u32 = {{ source.outputShape[1] }}u;
10
+ const WG: u32 = {{ tunables.WORKGROUP_SIZE }}u;
11
+
12
+ fn normalize_start(raw: i32, step: i32, dim: i32) -> i32 {
13
+ var start = raw;
14
+ if (start < 0) { start += dim; }
15
+ if (step < 0) { return clamp(start, -1, dim - 1); }
16
+ return clamp(start, 0, dim);
17
+ }
18
+
19
+ fn source_offset(out_index: u32, axis: u32, start: i32, step: i32) -> u32 {
20
+ let row = out_index / OUT_COLS;
21
+ let col = out_index - row * OUT_COLS;
22
+ if (axis == 0u) {
23
+ return u32(start + i32(row) * step) * DATA_COLS + col;
24
+ }
25
+ return row * DATA_COLS + u32(start + i32(col) * step);
26
+ }
27
+
28
+ // Four adjacent scalar elements per lane. For the common row-slice case, almost
29
+ // every block is one contiguous input/output transaction; only the three values
30
+ // around an odd-width row boundary take the fully generic per-element mapping.
31
+ @compute @workgroup_size({{ tunables.WORKGROUP_SIZE }})
32
+ fn main(
33
+ @builtin(global_invocation_id) gid: vec3<u32>,
34
+ @builtin(num_workgroups) nwg: vec3<u32>
35
+ ) {
36
+ let stride = nwg.x * WG;
37
+ var block = gid.x;
38
+ while (block * 4u < COUNT) {
39
+ let out0 = block * 4u;
40
+ let axisRaw = i32(axes[0]);
41
+ let axis = u32(select(axisRaw, axisRaw + 2i, axisRaw < 0));
42
+ let step = i32(steps[0]);
43
+ let dim = select(i32(DATA_COLS), i32(DATA_ROWS), axis == 0u);
44
+ let start = normalize_start(i32(starts[0]), step, dim);
45
+ let col = out0 % OUT_COLS;
46
+
47
+ if (axis == 0u && step == 1i && col + 3u < OUT_COLS && out0 + 3u < COUNT) {
48
+ let src0 = source_offset(out0, axis, start, step);
49
+ output[out0] = data[src0];
50
+ output[out0 + 1u] = data[src0 + 1u];
51
+ output[out0 + 2u] = data[src0 + 2u];
52
+ output[out0 + 3u] = data[src0 + 3u];
53
+ } else {
54
+ for (var lane = 0u; lane < 4u; lane++) {
55
+ let out_index = out0 + lane;
56
+ if (out_index < COUNT) {
57
+ output[out_index] = data[source_offset(out_index, axis, start, step)];
58
+ }
59
+ }
60
+ }
61
+ block += stride;
62
+ }
63
+ }
build/webgpu/slice.wgsl.jinja ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {% if usesF16 %}
2
+ enable f16;
3
+ {% endif %}
4
+ {{ env.wgsl.resourceDeclarations }}
5
+ {% if presentAxes %}
6
+
7
+ const RANK: u32 = {{ source.rank }}u;
8
+ {% endif %}
9
+ const SLICE_RANK: u32 = {{ source.sliceRank }}u;
10
+ const DATA_SHAPE: array<i32, {{ source.rank }}> = array<i32, {{ source.rank }}>({% for d in source.dataShape %}{{ d }}{% if not loop.last %}, {% endif %}{% endfor %});
11
+ {% if presentAxes %}
12
+
13
+ fn normalized_axis(raw_axis: i32) -> u32 {
14
+ var axis = raw_axis;
15
+ if (axis < 0) {
16
+ axis = axis + i32(RANK);
17
+ }
18
+ return u32(axis);
19
+ }
20
+
21
+ {% endif %}
22
+ fn normalized_start(raw_start: i32, step: i32, dim: i32) -> i32 {
23
+ var start = raw_start;
24
+ if (start < 0) {
25
+ start = start + dim;
26
+ }
27
+ if (step < 0) {
28
+ return clamp(start, -1, dim - 1);
29
+ }
30
+ return clamp(start, 0, dim);
31
+ }
32
+
33
+ fn data_coord(axis: u32, out_coord: u32) -> u32 {
34
+ var coord = i32(out_coord);
35
+ for (var i = 0u; i < SLICE_RANK; i = i + 1u) {
36
+ {% if presentAxes %}
37
+ let slice_axis = normalized_axis(i32(axes[i]));
38
+ {% else %}
39
+ // axes omitted -> defaults to [0, 1, ..., sliceRank-1].
40
+ let slice_axis = i;
41
+ {% endif %}
42
+ if (slice_axis == axis) {
43
+ {% if presentSteps %}
44
+ let step = i32(steps[i]);
45
+ {% else %}
46
+ // steps omitted -> defaults to 1.
47
+ let step = 1i;
48
+ {% endif %}
49
+ let start = normalized_start(i32(starts[i]), step, DATA_SHAPE[axis]);
50
+ coord = start + i32(out_coord) * step;
51
+ }
52
+ }
53
+ return u32(coord);
54
+ }
55
+
56
+ fn data_offset(out_index: u32) -> u32 {
57
+ var rem = out_index;
58
+ var offset = 0u;
59
+ {% for axis in range(source.rank) %}
60
+ {% set out_stride = namespace(value=1) %}
61
+ {% for j in range(axis + 1, source.rank) %}
62
+ {% set out_stride.value = out_stride.value * source.outputShape[j] %}
63
+ {% endfor %}
64
+ {% set safe_out_stride = 1 if out_stride.value == 0 else out_stride.value %}
65
+ {% set data_stride = namespace(value=1) %}
66
+ {% for j in range(axis + 1, source.rank) %}
67
+ {% set data_stride.value = data_stride.value * source.dataShape[j] %}
68
+ {% endfor %}
69
+ let out_coord{{ axis }} = rem / {{ safe_out_stride }}u;
70
+ rem = rem % {{ safe_out_stride }}u;
71
+ offset = offset + data_coord({{ axis }}u, out_coord{{ axis }}) * {{ data_stride.value }}u;
72
+ {% endfor %}
73
+ return offset;
74
+ }
75
+
76
+ const WG: u32 = {{ tunables.WORKGROUP_SIZE }}u;
77
+
78
+ // Grid-stride over a dispatch clamped to the device limit, so large outputs
79
+ // remain covered without an invalid one-thread-per-element launch.
80
+ @compute @workgroup_size({{ tunables.WORKGROUP_SIZE }})
81
+ fn main(
82
+ @builtin(global_invocation_id) gid: vec3<u32>,
83
+ @builtin(num_workgroups) nwg: vec3<u32>
84
+ ) {
85
+ let stride = nwg.x * WG;
86
+ for (var i = gid.x; i < params.count; i += stride) {
87
+ output[i] = data[data_offset(i)];
88
+ }
89
+ }
build/webgpu/test.json ADDED
@@ -0,0 +1,1547 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "op": "ai.onnx.Slice",
3
+ "fixtureArrays": {
4
+ "onnx_backend_slice_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, -0.6724604368209839, -0.35955315828323364, -0.8131462931632996, -1.7262825965881348, 0.17742614448070526, -0.4017809331417084, -1.630198359489441, 0.46278226375579834, -0.9072983860969543, 0.05194539576768875, 0.7290905714035034, 0.12898291647434235, 1.1394007205963135, -1.234825849533081, 0.4023416340351105, -0.6848101019859314, -0.8707971572875977, -0.5788496732711792, -0.3115525245666504, 0.056165341287851334, -1.1651498079299927, 0.9008265137672424, 0.4656624495983124, -1.5362436771392822, 1.4882521629333496, 1.895889163017273, 1.1787796020507812, -0.1799248307943344, -1.0707526206970215, 1.0544517040252686, -0.4031769335269928, 1.222445011138916, 0.2082749754190445, 0.9766390323638916, 0.3563663959503174, 0.7065731883049011, 0.01050002034753561, 1.7858705520629883, 0.12691208720207214, 0.4019893705844879, 1.8831506967544556, -1.3477590084075928, -1.2704850435256958, 0.969396710395813, -1.1731233596801758, 1.9436211585998535, -0.4136189818382263, -0.747454822063446, 1.922942042350769, 1.4805147647857666, 1.8675589561462402, 0.9060446619987488, -0.8612256646156311, 1.910064935684204, -0.26800337433815, 0.8024563789367676, 0.9472519755363464, -0.15501008927822113, 0.6140793561935425, 0.922206699848175, 0.37642553448677063, -1.0994007587432861, 0.29823818802833557, 1.3263858556747437, -0.694567859172821, -0.14963454008102417, -0.4351535439491272, 1.8492637872695923, 0.6722947359085083, 0.40746182203292847, -0.7699160575866699, 0.5392491817474365, -0.6743326783180237, 0.0318305566906929, -0.6358460783958435, 0.676433265209198, 0.5765908360481262, -0.20829875767230988, 0.39600670337677, -1.0930615663528442, -1.4912575483322144, 0.43939170241355896, 0.16667349636554718, 0.6350314617156982, 2.3831448554992676, 0.9444794654846191, -0.9128222465515137, 1.117016315460205, -1.31590735912323, -0.46158459782600403, -0.06824160367250443, 1.7133426666259766, -0.7447548508644104, -0.8264385461807251, -0.09845252335071564, -0.6634783148765564, 1.1266359090805054, -1.0799314975738525, -1.1474686861038208, -0.43782004714012146, -0.49803245067596436, 1.9295320510864258, 0.9494208097457886, 0.08755124360322952, -1.225435495376587, 0.8443629741668701, -1.0002152919769287, -1.5447710752487183, 1.1880297660827637, 0.31694260239601135, 0.9208588004112244, 0.31872764229774475, 0.8568305969238281, -0.6510255932807922, -1.034242868423462, 0.6815944910049438, -0.8034096360206604, -0.6895498037338257, -0.4555324912071228, 0.01747915893793106, -0.3539939224720001, -1.3749512434005737, -0.6436184048652649, -2.223403215408325, 0.6252314448356628, -1.602057695388794, -1.1043833494186401, 0.05216507986187935, -0.73956298828125, 1.543014645576477, -1.2928569316864014, 0.2670508623123169, -0.039282817393541336, -1.1680934429168701, 0.523276686668396, -0.1715463250875473, 0.7717905640602112, 0.8235041499137878, 2.163235902786255, 1.336527943611145, -0.3691818416118622, -0.2393791824579239, 1.0996595621109009, 0.6552637219429016, 0.6401315331459045, -1.6169559955596924, -0.024326125159859657, -0.7380309104919434, 0.279924601316452, -0.09815038740634918, 0.9101788997650146, 0.31721821427345276, 0.7863279581069946, -0.4664191007614136, -0.9444462656974792, -0.410049706697464, -0.017020413652062416, 0.37915173172950745, 2.2593090534210205, -0.0422571524977684, -0.9559450149536133, -0.34598177671432495, -0.463595986366272, 0.4814814627170563, -1.5407969951629639, 0.06326199322938919, 0.15650653839111328, 0.23218104243278503, -0.5973160862922668, -0.23792172968387604, -1.4240609407424927, -0.49331986904144287, -0.5428614616394043, 0.4160500466823578, -1.1561824083328247, 0.7811980843544006, 1.494484543800354, -2.0699849128723145, 0.42625874280929565, 0.676908016204834, -0.6374370455741882, -0.3972718119621277, -0.1328805834054947, -0.29779088497161865, -0.3090129792690277, -1.6760038137435913, 1.1523315906524658, 1.0796185731887817, -0.8133642673492432, -1.4664243459701538, 0.5210648775100708, -0.5757879614830017, 0.14195317029953003, -0.3193284273147583, 0.6915387511253357, 0.694749116897583, -0.7255973815917969, -1.383363962173462, -1.5829384326934814, 0.6103793978691101, -1.188859224319458, -0.5068163275718689, -0.596314013004303, -0.05256729573011398, -1.9362797737121582, 0.1887785941362381, 0.523891031742096, 0.08842208981513977, -0.3108861744403839, 0.09740016609430313, 0.3990463316440582, -2.772592782974243, 1.9559123516082764, 0.3900933265686035, -0.6524085998535156, -0.3909533619880676, 0.4937417805194855, -0.11610393971204758, -2.030684471130371, 2.06449294090271, -0.11054065823554993, 1.0201727151870728, -0.6920498609542847, 1.5363770723342896, 0.28634369373321533, 0.6088438630104065, -1.0452533960342407, 1.211145281791687, 0.6898181438446045, 1.3018462657928467, -0.62808758020401, -0.48102712631225586, 2.3039166927337646, -1.0600157976150513, -0.13594970107078552, 1.1368913650512695, 0.09772496670484543, 0.582953691482544, -0.39944902062416077, 0.3700558841228485, -1.3065268993377686, 1.6581306457519531, -0.1181640475988388, -0.6801782250404358, 0.6663830876350403, -0.4607197940349579, -1.3342584371566772, -1.3467174768447876, 0.6937731504440308, -0.15957343578338623, -0.13370156288146973, 1.0777437686920166, -1.1268258094787598, -0.7306777238845825, -0.38487979769706726, 0.09435158967971802, -0.042171452194452286, -0.28688719868659973, -0.06162640079855919, -0.10730527341365814, -0.7196043729782104, -0.8129929900169373, 0.27451634407043457, -0.8909150958061218, -1.1573553085327148, -0.3122922480106354, -0.15766701102256775, 2.256723403930664, -0.7047002911567688, 0.9432607293128967, 0.7471883296966553, -1.188944935798645, 0.7732529640197754, -1.1838806867599487, -2.659172296524048, 0.6063195466995239, -1.7558906078338623, 0.4509344696998596, -0.684010922908783, 1.6595507860183716, 1.0685093402862549, -0.4533858001232147, -0.6878376007080078, -1.214077353477478, -0.4409226179122925, -0.2803554832935333, -0.3646935522556305, 0.1567038595676422, 0.5785214900970459, 0.3496544659137726, -0.7641439437866211, -1.4377914667129517, 1.3645318746566772, -0.6894491910934448, -0.6522936224937439, -0.5211893320083618, -1.8430695533752441, -0.477973997592926, -0.47965580224990845, 0.6203582882881165, 0.6984571218490601, 0.003770889015868306, 0.9318483471870422, 0.33996498584747314, -0.01568211242556572, 0.1609281748533249, -0.1906534880399704, -0.3948495090007782, -0.26773354411125183, -1.1280113458633423, 0.2804417014122009, -0.9931235909461975, 0.841631293296814, -0.24945858120918274, 0.04949498176574707, 0.49383679032325745, 0.6433144807815552, -1.5706233978271484, -0.20690368115901947, 0.8801789283752441, -1.698105812072754, 0.3872804641723633, -2.2555642127990723, -1.022506833076477, 0.03863055258989334, -1.6567151546478271, -0.9855107665061951, -1.4718350172042847, 1.6481349468231201, 0.16422775387763977, 0.5672903060913086, -0.22267509996891022, -0.353431761264801, -1.6164741516113281, -0.2918373644351959, -0.7614921927452087, 0.8579239249229431, 1.1411018371582031, 1.466578722000122, 0.8525519371032715, -0.5986539125442505, -1.1158969402313232, 0.7666631937026978, 0.35629281401634216, -1.768538475036621, 0.3554818034172058, 0.8145198225975037, 0.05892558768391609, -0.18505367636680603, -0.8076484799385071, -1.4465347528457642, 0.8002979755401611, -0.3091144561767578, -0.23346665501594543, 1.732721209526062, 0.6845011115074158, 0.37082499265670776, 0.14206179976463318, 1.519994854927063, 1.719589352607727, 0.9295051097869873, 0.5822246074676514, -2.0946030616760254, 0.12372191250324249, -0.13010695576667786, 0.09395322948694229, 0.9430460929870605, -2.7396771907806396, -0.5693120360374451, 0.26990434527397156, -0.4668455421924591, -1.4169061183929443, 0.8689634799957275, 0.276871919631958, -0.9711045622825623, 0.3148171901702881, 0.8215857148170471, 0.005292646121233702, 0.8005648255348206, 0.07826017588376999, -0.3952289819717407, -1.1594204902648926, -0.08593076467514038, 0.19429293274879456, 0.875832736492157, -0.1151074692606926, 0.4574156105518341, -0.9646120071411133, -0.782629132270813, -0.11038929969072342, -1.0546284914016724, 0.8202478289604187, 0.46313032507896423, 0.27909576892852783, 0.33890411257743835, 2.021043539047241, -0.46886420249938965, -2.2014412879943848, 0.19930019974708557, -0.05060354247689247, -0.5175190567970276, -0.9788298606872559, -0.43918952345848083, 0.18133842945098877, -0.5028166770935059, 2.4124536514282227, -0.9605043530464172, -0.793117344379425, -2.2886199951171875, 0.2514844238758087, -2.016406536102295, -0.5394546389579773, -0.27567052841186523, -0.709727942943573, 1.7388726472854614, 0.9943943619728088, 1.3191368579864502, -0.8824188113212585, 1.1285940408706665, 0.4960009455680847, 0.7714059352874756, 1.029438853263855, -0.9087632298469543, -0.4243176281452179, 0.8625960350036621, -2.6556191444396973, 1.5133280754089355, 0.5531320571899414, -0.045703962445259094, 0.2205076515674591, -1.0299352407455444, -0.3499433696269989, 1.1002843379974365, 1.2980220317840576, 2.6962239742279053, -0.07392466813325882, -0.6585529446601868, -0.5142339468002319, -1.0180418491363525, -0.07785475254058838, 0.38273242115974426, -0.03424227982759476, 1.0963468551635742, -0.23421579599380493, -0.3474506437778473, -0.5812684893608093, -1.6326345205307007, -1.5677677392959595, -1.1791579723358154, 1.3014280796051025, 0.8952602744102478, 1.3749641180038452, -1.3322116136550903, -1.9686247110366821, -0.6600562930107117, 0.17581894993782043, 0.49869027733802795, 1.0479722023010254, 0.2842796742916107, 1.7426687479019165, -0.22260567545890808, -0.9130792021751404, -1.6812182664871216, -0.8889713287353516, 0.2421179562807083, -0.8887202739715576, 0.9367424845695496, 1.4123276472091675, -2.369586944580078, 0.8640522956848145, -2.2396039962768555, 0.40149906277656555, 1.2248705625534058, 0.06485610455274582, -1.2796891927719116, -0.5854312181472778, -0.26164543628692627, -0.18224477767944336, -0.2028968334197998, -0.10988277941942215, 0.21348005533218384, -1.2085736989974976, -0.24201983213424683, 1.518261194229126, -0.3846454322338104, -0.4438360929489136, 1.0781973600387573, -2.5591845512390137, 1.1813786029815674, -0.6319037675857544, 0.1639285683631897, 0.09632135927677155, 0.9424681067466736, -0.26759475469589233, -0.6780257821083069, 1.2978458404541016, -2.3641738891601562, 0.020334182307124138, -1.3479254245758057, -0.7615733742713928, 2.011256694793701, -0.04459542781114578, 0.19506970047950745, -1.7815628051757812, -0.7290446758270264, 0.1965574026107788, 0.354757696390152, 0.616886556148529, 0.00862789899110794, 0.5270041823387146, 0.4537819027900696, -1.8297404050827026, 0.037005722522735596, 0.7679024338722229, 0.5898798108100891, -0.36385881900787354, -0.8056265115737915, -1.118311882019043, -0.13105401396751404, 1.1330798864364624, -1.9518041610717773, -0.6598917245864868, -1.1398024559020996, 0.7849575281143188, -0.554309606552124, -0.47063764929771423, -0.21694956719875336, 0.44539326429367065, -0.3923889994621277, -3.046143054962158, 0.5433118939399719, 0.43904295563697815, -0.2195410281419754, -1.0840365886688232, 0.35178011655807495, 0.37923553586006165, -0.47003287076950073, -0.2167314738035202, -0.9301565289497375, -0.1785890907049179, -1.550429344177246, 0.41731882095336914, -0.9443684816360474, 0.23810315132141113, -1.4059629440307617, -0.5900576710700989, -0.11048940569162369, -1.6606998443603516, 0.11514787375926971, -0.37914755940437317, -1.7423561811447144, -1.303242802619934, 0.605120062828064, 0.8955559730529785, -0.13190864026546478, 0.40476182103157043, 0.2238435596227646, 0.3296229839324951, 1.2859840393066406, -1.5069984197616577, 0.6764607429504395, -0.38200896978378296, -0.2242589294910431, -0.3022497296333313, -0.37514710426330566, -1.2261961698532104, 0.1833391934633255, 1.670943021774292, -0.05613302066922188, -0.0013850427931174636, -0.6872990131378174, -0.11747454851865768, 0.4661664366722107, -0.3702424466609955, -0.45380404591560364, 0.4032645523548126, -0.9180047512054443, 0.2524966299533844, 0.820321798324585, 1.3599485158920288, -0.09038200974464417, 1.367597222328186, 1.0344098806381226, -0.9962126612663269, -1.2179385423660278, -0.3049636483192444, 1.0289355516433716, -0.07228700816631317, -0.60065758228302, 1.5522432327270508, 0.2869044840335846, -2.320594310760498, 0.31716063618659973, 0.5200406312942505, 0.22560866177082062, 0.4497120976448059, -0.06727560609579086, -1.3183958530426025, -0.3707039952278137, -0.9456157684326172, -0.9327409267425537, -1.2630683183670044, 0.45248907804489136, 0.09789614379405975, -0.4481653571128845, -0.6493379473686218, -0.023423105478286743, 1.0791947841644287, -2.004215717315674, 0.3768765330314636, -0.5457119941711426, -1.8845858573913574, -1.9457030296325684, -0.9127835035324097, 0.219509556889534, 0.39306291937828064, -0.9389815926551819, 1.0170209407806396, 1.4229835271835327, 0.39608657360076904, -0.5914026498794556, 1.1244192123413086, 0.7553957104682922, 0.8674074411392212, -0.6564636826515198, -2.834554433822632, 2.116791009902954, -1.610878348350525, -0.03576807305216789, 2.3807454109191895, 0.33057674765586853, 0.9492464661598206, -1.502396583557129, -1.7776669263839722, -0.5327028036117554, 1.090749740600586, -0.34624946117401123, -0.7946363091468811, 0.1979672908782959, 1.081935167312622, -1.444940209388733, -1.2105430364608765, -0.788669228553772, 1.0946383476257324, 0.23482152819633484, 2.1321535110473633, 0.9364457130432129, -0.035095177590847015, 1.265077829360962, 0.2114970088005066, -0.7049213647842407, 0.6799748539924622, -0.6963266730308533, -0.29039710760116577, 1.3277827501296997, -0.10128148645162582, -0.8031414151191711, -0.46433767676353455, 1.021790623664856, -0.55254065990448, -0.3868708610534668, -0.5102927684783936, 0.18392549455165863, -0.3854897618293762, -1.601836085319519, -0.8871809244155884, -0.9327890276908875, 1.2433193922042847, 0.8126740455627441, 0.5872593522071838, -0.5053583383560181, -0.8157915472984314, -0.5075175762176514, -1.051880121231079, 2.4972004890441895, -2.245321750640869, 0.5640085339546204, -1.2845523357391357, -0.1043434888124466, -0.9880019426345825, -1.177628993988037, -1.1401963233947754, 1.7549861669540405, -0.13298842310905457, -0.7657021880149841, 0.5557869672775269, 0.010349314659833908, 0.7200337648391724, -1.8242566585540771, 0.3036039173603058, 0.7726948261260986, -1.6615983247756958, 0.44819527864456177, 1.6961815357208252, -0.014857703819870949, 0.8214059472084045, 0.670570433139801, -0.7075057029724121, 0.03976673632860184, -1.5669946670532227, -0.45130303502082825, 0.2656879723072052, 0.723100483417511, 0.024612125009298325, 0.7199837565422058, -1.1029062271118164, -0.10169727355241776, 0.01927938498556614, 1.8495912551879883, -0.21416665613651276, -0.4990166425704956, 0.021351223811507225, -0.9191134572029114, 0.1927538514137268, -0.3650552034378052, -1.7913275957107544, -0.05858655273914337, -0.317543089389801, -1.6324232816696167, -0.06713415682315826, 1.4893559217453003, 0.5213037729263306, 0.6119272112846375, -1.3414967060089111, 0.4768983721733093, 0.1484495848417282, 0.5290452241897583, 0.42262861132621765, -1.3597806692123413, -0.041400812566280365, -0.7578708529472351, -0.05008409544825554, -0.8974009156227112, 1.3124703168869019, -0.8589723706245422, -0.8989421725273132, 0.0745864063501358, -1.077099084854126, -0.4246633052825928, -0.8299645781517029, 1.4111720323562622, 0.7858038544654846, -0.05746951699256897, -0.39121705293655396, 0.9409176111221313, 0.40520408749580383, 0.4980524182319641, -0.026192236691713333, -1.688230037689209, -0.1124659851193428, -0.5324898958206177, 0.6450552940368652, 1.0118424892425537, -0.6579510569572449, 0.4683852195739746, 1.7358789443969727, -0.6677127480506897, 1.6819217205047607, -0.8525858521461487, 0.0229597557336092, -0.011145612224936485, 0.011498900130391121, -0.8376780152320862, -0.5911831259727478, -0.6677202582359314, 0.32696259021759033, 0.33003512024879456, 2.2259442806243896, 1.3709889650344849, -0.5098432302474976, 0.3248696029186249, 0.9971179962158203, 0.030601823702454567, -0.06964157521724701, 0.0515749417245388, 0.8672766089439392, -0.8483205437660217, -0.32566946744918823, 0.47043314576148987, 0.3114470839500427, 0.23958276212215424, -0.3698011636734009, 0.9725357890129089, 2.1338682174682617, 0.40641549229621887, -0.19317670166492462, 0.7557402849197388, -0.5391326546669006, -0.7496903538703918, 0.03280874714255333, -2.582796573638916, -1.1539503335952759, -0.3479618430137634, -1.3533889055252075, -1.0326430797576904, -0.43674832582473755, -1.642965316772461, -0.4060717821121216, -0.5352701544761658, 0.02540520764887333, 1.1541839838027954, 0.17250441014766693, 0.02106202207505703, 0.09945445507764816, 0.22739277780056, -1.0167386531829834, -0.11477532237768173, 0.30875125527381897, -1.3707599639892578, 0.8656529188156128, 1.081376075744629, -0.6313759684562683, -0.24133779108524323, -0.8781903386116028, 0.6993804574012756, -1.0612223148345947, -0.2224770039319992, -0.8589199185371399, 0.05095427855849266, -1.79422926902771, 1.326461672782898, -0.9646064043045044, 0.059894684702157974, -0.21252304315567017, -0.7621145248413086, -0.8877801299095154, 0.9363985657691956, -0.525640606880188, 0.2711701989173889, -0.8014968633651733, -0.6471814513206482, 0.4722471535205841, 0.9304084777832031, -0.17531640827655792, -1.421919822692871, 1.9979560375213623, -0.8565493226051331, -1.5415873527526855, 2.5944244861602783, -0.40403228998184204, -1.4617327451705933, -0.6834397912025452, 0.36754488945007324, 0.19031155109405518, -0.8517292141914368, 1.822723627090454, -0.5215796828269958, -1.184686541557312, 0.9606934189796448, 1.329062819480896, -0.8174930810928345, -1.401347279548645, 1.0304383039474487, -2.047323703765869, -1.2266216278076172, 0.9674461483955383, -0.05535254627466202, -0.2639373540878296, 0.3528166115283966, -0.15277442336082458, -1.2986867427825928, 1.2760753631591797, 1.3250139951705933, 0.20533256232738495, 0.04513401538133621, 2.3396248817443848, -0.2764328420162201, -0.2595769762992859, 0.36448124051094055, 1.471321940422058, 1.5927706956863403, -0.25857263803482056, 0.3083312511444092, -1.3780834674835205, -0.3119761049747467, -0.840290367603302, -1.0068317651748657, 1.6815767288208008, -0.7922866344451904, -0.5316058993339539, 0.3658487796783447, 1.2978252172470093, 0.4811151325702667, 2.759355068206787, -0.07466797530651093, 0.2587164342403412, 0.2756006717681885, 1.4350494146347046, 0.5072389245033264, -0.11622969806194305, -0.9474886059761047, 0.24444346129894257, 1.4013447761535645, -0.4103817939758301, 0.5289435982704163, 0.2461477816104889, 0.8635196685791016, -0.8047537207603455, 2.346647024154663, -1.2791610956192017, -0.36555108428001404, 0.9380925297737122, 0.29673317074775696, 0.8299861550331116, -0.49610233306884766, -0.07480498403310776, 0.012231983244419098, 1.5692596435546875, 0.6904290318489075, 0.7966721057891846, -0.657926082611084, 0.9688826203346252, 0.22558166086673737, 1.3891453742980957, 2.0140602588653564, -0.30676576495170593, -0.40630313754081726, -0.8640449643135071, -0.14357951283454895, -0.38202545046806335, 0.3595044016838074, -0.14456681907176971, -0.36159926652908325, 1.0645850896835327, -0.9378802180290222, 0.4331079423427582, -0.4059417247772217, 0.7243685126304626, 1.3852615356445312, -0.30309826135635376, 0.44103291630744934, 0.17879286408424377, -0.7994223833084106, 0.24078750610351562, 0.28912049531936646, 0.4128708243370056, -0.1983989030122757, 0.09419230371713638, -1.1476109027862549, -0.3581140637397766],
5
+ "ort_2d_two_axes_negative_end_input_data": [0, 1, 2, 3, 10, 11, 12, 13, 20, 21, 22, 23, 30, 31, 32, 33, 40, 41, 42, 43, 50, 51, 52, 53],
6
+ "ort_3d_positive_and_negative_steps_subset_axes_input_data": [27, 20, 2, 4, 26, 11, 26, 5, 17, 0, 21, 6, 22, 13, 29, 19, 17, 27, 4, 20, 12, 3, 9, 24, 17, 6, 24],
7
+ "ort_5d_subset_axes_offset_input_data": [1, 2, 3, 4, 5, 6, 7, 8, -1, -2, -3, -4, -5, -6, -7, -8],
8
+ "inner_vec4_uint8_aligned_2d_input_data": [0, 1, 2, 3, 4, 5, 6, 7, 248, 249, 250, 251, 252, 253, 254, 255],
9
+ "inner_vec4_bool_aligned_2d_input_data": [1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1]
10
+ },
11
+ "cases": [
12
+ {
13
+ "name": "int16_step2_boundaries",
14
+ "inputs": {
15
+ "data": {
16
+ "dtype": "int16",
17
+ "shape": [6],
18
+ "data": { "kind": "values", "values": [-32768, -1, 0, 1, 32767, -32767] }
19
+ },
20
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } },
21
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [6] } },
22
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
23
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [2] } }
24
+ },
25
+ "outputs": {
26
+ "output": {
27
+ "dtype": "int16",
28
+ "shape": [3],
29
+ "tolerance": 0,
30
+ "data": { "kind": "values", "values": [-1, 1, -32767] }
31
+ }
32
+ }
33
+ },
34
+ {
35
+ "name": "rank2_axis1",
36
+ "inputs": {
37
+ "data": {
38
+ "dtype": "float32",
39
+ "shape": [3, 5],
40
+ "data": {
41
+ "kind": "values",
42
+ "values": [0.0, 1.0, 2.0, 3.0, 4.0, 10.0, 11.0, 12.0, 13.0, 14.0, 20.0, 21.0, 22.0, 23.0, 24.0]
43
+ }
44
+ },
45
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } },
46
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [4] } },
47
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } },
48
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } }
49
+ },
50
+ "outputs": { "output": { "dtype": "float32", "shape": [3, 3] } }
51
+ },
52
+ {
53
+ "name": "rank2_axis0_odd_width_x4",
54
+ "inputs": {
55
+ "data": { "dtype": "float32", "shape": [6, 5], "data": { "kind": "linspace", "start": -1.0, "end": 1.0 } },
56
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } },
57
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [5] } },
58
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
59
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } }
60
+ },
61
+ "outputs": { "output": { "dtype": "float32", "shape": [4, 5], "tolerance": 0 } }
62
+ },
63
+ {
64
+ "name": "rank2_axis0_odd_width_reverse_x4",
65
+ "inputs": {
66
+ "data": { "dtype": "float32", "shape": [6, 5], "data": { "kind": "linspace", "start": -1.0, "end": 1.0 } },
67
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [5] } },
68
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } },
69
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-2] } },
70
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-1] } }
71
+ },
72
+ "outputs": { "output": { "dtype": "float32", "shape": [4, 5], "tolerance": 0 } }
73
+ },
74
+ {
75
+ "name": "end_past_dim_clamped",
76
+ "inputs": {
77
+ "data": {
78
+ "dtype": "float32",
79
+ "shape": [2, 5],
80
+ "data": { "kind": "values", "values": [0.0, 1.0, 2.0, 3.0, 4.0, 10.0, 11.0, 12.0, 13.0, 14.0] }
81
+ },
82
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [3] } },
83
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [999] } },
84
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } },
85
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } }
86
+ },
87
+ "outputs": { "output": { "dtype": "float32", "shape": [2, 2] } }
88
+ },
89
+ {
90
+ "name": "empty_output_start_equals_end",
91
+ "inputs": {
92
+ "data": {
93
+ "dtype": "float32",
94
+ "shape": [6],
95
+ "data": { "kind": "values", "values": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0] }
96
+ },
97
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [2] } },
98
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [2] } },
99
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
100
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } }
101
+ },
102
+ "outputs": { "output": { "dtype": "float32", "shape": [0] } }
103
+ },
104
+ {
105
+ "name": "rank3_axis_step_f16",
106
+ "inputs": {
107
+ "data": { "dtype": "float16", "shape": [2, 3, 4] },
108
+ "starts": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 1] } },
109
+ "ends": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [2, 4] } },
110
+ "axes": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [1, 2] } },
111
+ "steps": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [2, 2] } }
112
+ },
113
+ "outputs": { "output": { "dtype": "float16", "shape": [2, 1, 2] } },
114
+ "tolerance": 0.001
115
+ },
116
+ {
117
+ "name": "rank5_subset_axes_offset",
118
+ "inputs": {
119
+ "data": {
120
+ "dtype": "float32",
121
+ "shape": [1, 2, 2, 2, 2],
122
+ "data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.23 }
123
+ },
124
+ "starts": { "dtype": "int32", "shape": [4], "data": { "kind": "values", "values": [0, 1, 0, 0] } },
125
+ "ends": { "dtype": "int32", "shape": [4], "data": { "kind": "values", "values": [1, 2, 2, 2] } },
126
+ "axes": { "dtype": "int32", "shape": [4], "data": { "kind": "values", "values": [0, 1, 2, 3] } },
127
+ "steps": { "dtype": "int32", "shape": [4], "data": { "kind": "values", "values": [1, 1, 1, 1] } }
128
+ },
129
+ "outputs": { "output": { "dtype": "float32", "shape": [1, 1, 2, 2, 2], "tolerance": 0.000001 } }
130
+ },
131
+ {
132
+ "name": "rank6_last_axis_step",
133
+ "inputs": {
134
+ "data": {
135
+ "dtype": "float32",
136
+ "shape": [1, 2, 1, 2, 1, 4],
137
+ "data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.23 }
138
+ },
139
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } },
140
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [4] } },
141
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [5] } },
142
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [2] } }
143
+ },
144
+ "outputs": { "output": { "dtype": "float32", "shape": [1, 2, 1, 2, 1, 2], "tolerance": 0.000001 } }
145
+ },
146
+ {
147
+ "name": "ort_1d_start_greater_than_end_empty",
148
+ "provenance": {
149
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
150
+ "test": "SliceTest.Slice1D_InvalidStartEndRange"
151
+ },
152
+ "inputs": {
153
+ "data": {
154
+ "dtype": "float32",
155
+ "shape": [6],
156
+ "data": { "kind": "values", "values": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0] }
157
+ },
158
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [3] } },
159
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [2] } },
160
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
161
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } }
162
+ },
163
+ "outputs": { "output": { "dtype": "float32", "shape": [0], "tolerance": 0.000001 } }
164
+ },
165
+ {
166
+ "name": "ort_1d_start_end_out_of_bounds_empty",
167
+ "provenance": {
168
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
169
+ "test": "SliceTest.Slice1D_StartAndEndOutOfBounds"
170
+ },
171
+ "inputs": {
172
+ "data": {
173
+ "dtype": "float32",
174
+ "shape": [6],
175
+ "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] }
176
+ },
177
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1000] } },
178
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1001] } },
179
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
180
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } }
181
+ },
182
+ "outputs": { "output": { "dtype": "float32", "shape": [0], "tolerance": 0.000001 } }
183
+ },
184
+ {
185
+ "name": "ort_2d_start_end_out_of_bounds_empty_axis",
186
+ "provenance": {
187
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
188
+ "test": "SliceTest.Slice2D_StartAndEndOutOfBounds"
189
+ },
190
+ "inputs": {
191
+ "data": {
192
+ "dtype": "float32",
193
+ "shape": [2, 3],
194
+ "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] }
195
+ },
196
+ "starts": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 1000] } },
197
+ "ends": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [10, 1000] } },
198
+ "axes": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 1] } },
199
+ "steps": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [1, 1] } }
200
+ },
201
+ "outputs": { "output": { "dtype": "float32", "shape": [2, 0], "tolerance": 0.000001 } }
202
+ },
203
+ {
204
+ "name": "ort_1d_negative_step_regular",
205
+ "provenance": {
206
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
207
+ "test": "SliceTest.Slice1D_WithNegativeSteps_Regular"
208
+ },
209
+ "inputs": {
210
+ "data": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0] } },
211
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-1] } },
212
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-4] } },
213
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
214
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-1] } }
215
+ },
216
+ "outputs": { "output": { "dtype": "float32", "shape": [3], "tolerance": 0.000001 } }
217
+ },
218
+ {
219
+ "name": "ort_1d_negative_step_start_out_of_bounds",
220
+ "provenance": {
221
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
222
+ "test": "SliceTest.Slice1D_WithNegativeSteps_StartOutOfBounds"
223
+ },
224
+ "inputs": {
225
+ "data": {
226
+ "dtype": "float32",
227
+ "shape": [6],
228
+ "data": { "kind": "values", "values": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0] }
229
+ },
230
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [7] } },
231
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
232
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
233
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-3] } }
234
+ },
235
+ "outputs": { "output": { "dtype": "float32", "shape": [2], "tolerance": 0.000001 } }
236
+ },
237
+ {
238
+ "name": "ort_2d_positive_steps_subset_axes",
239
+ "provenance": {
240
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
241
+ "test": "SliceTest.Slice2D_WithPositiveSteps_1"
242
+ },
243
+ "inputs": {
244
+ "data": {
245
+ "dtype": "float32",
246
+ "shape": [2, 4],
247
+ "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0] }
248
+ },
249
+ "starts": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [1, 0] } },
250
+ "ends": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [2, 3] } },
251
+ "axes": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 1] } },
252
+ "steps": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [1, 2] } }
253
+ },
254
+ "outputs": { "output": { "dtype": "float32", "shape": [1, 2], "tolerance": 0.000001 } }
255
+ },
256
+ {
257
+ "name": "ort_2d_two_axes_negative_end",
258
+ "provenance": {
259
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
260
+ "test": "SliceTest.Slice2D_TwoAxes"
261
+ },
262
+ "inputs": {
263
+ "data": {
264
+ "dtype": "float32",
265
+ "shape": [6, 4],
266
+ "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_2d_two_axes_negative_end_input_data" } }
267
+ },
268
+ "starts": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [2, 3] } },
269
+ "ends": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [1000, -1] } },
270
+ "axes": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [1, 0] } },
271
+ "steps": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [1, 1] } }
272
+ },
273
+ "outputs": { "output": { "dtype": "float32", "shape": [2, 2], "tolerance": 0.000001 } }
274
+ },
275
+ {
276
+ "name": "ort_2d_reverse_all_axes",
277
+ "provenance": {
278
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
279
+ "test": "SliceTest.Slice2D_ReverseAllAxes"
280
+ },
281
+ "inputs": {
282
+ "data": { "dtype": "float32", "shape": [2, 2], "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0] } },
283
+ "starts": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [-1, -1] } },
284
+ "ends": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [-2147483648, -2147483648] } },
285
+ "axes": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 1] } },
286
+ "steps": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [-1, -1] } }
287
+ },
288
+ "outputs": { "output": { "dtype": "float32", "shape": [2, 2], "tolerance": 0.000001 } }
289
+ },
290
+ {
291
+ "name": "ort_2d_reverse_negative_axis",
292
+ "provenance": {
293
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
294
+ "test": "SliceTest.Slice2D_ReverseSubsetOfNegAxes_1"
295
+ },
296
+ "inputs": {
297
+ "data": { "dtype": "float32", "shape": [2, 2], "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0] } },
298
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-1] } },
299
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-2147483648] } },
300
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-1] } },
301
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-1] } }
302
+ },
303
+ "outputs": { "output": { "dtype": "float32", "shape": [2, 2], "tolerance": 0.000001 } }
304
+ },
305
+ {
306
+ "name": "ort_2d_mixed_negative_steps_single_value",
307
+ "provenance": {
308
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
309
+ "test": "SliceTest.Slice2D_WithNegativeSteps_2"
310
+ },
311
+ "inputs": {
312
+ "data": {
313
+ "dtype": "float32",
314
+ "shape": [2, 4],
315
+ "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0] }
316
+ },
317
+ "starts": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [1, 3] } },
318
+ "ends": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 1] } },
319
+ "axes": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 1] } },
320
+ "steps": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [-1, -2] } }
321
+ },
322
+ "outputs": { "output": { "dtype": "float32", "shape": [1, 1], "tolerance": 0.000001 } }
323
+ },
324
+ {
325
+ "name": "ort_3d_positive_and_negative_steps_subset_axes",
326
+ "provenance": {
327
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
328
+ "test": "SliceTest.Slice3D_WithPositiveAndNegativeSteps_SubsetOfAxes_1"
329
+ },
330
+ "inputs": {
331
+ "data": {
332
+ "dtype": "int32",
333
+ "shape": [3, 3, 3],
334
+ "data": {
335
+ "kind": "values",
336
+ "values": { "$ref": "#/fixtureArrays/ort_3d_positive_and_negative_steps_subset_axes_input_data" }
337
+ }
338
+ },
339
+ "starts": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [1, 4] } },
340
+ "ends": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [1000, 1] } },
341
+ "axes": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [1, 2] } },
342
+ "steps": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [3, -2] } }
343
+ },
344
+ "outputs": {
345
+ "output": {
346
+ "dtype": "int32",
347
+ "shape": [3, 1, 1],
348
+ "tolerance": 0,
349
+ "data": { "kind": "values", "values": [11, 29, 24] }
350
+ }
351
+ }
352
+ },
353
+ {
354
+ "name": "ort_3d_positive_and_negative_steps_subset_axes_empty",
355
+ "provenance": {
356
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
357
+ "test": "SliceTest.Slice3D_WithPositiveAndNegativeSteps_SubsetOfAxes_2"
358
+ },
359
+ "inputs": {
360
+ "data": {
361
+ "dtype": "int32",
362
+ "shape": [3, 3, 3],
363
+ "data": {
364
+ "kind": "values",
365
+ "values": { "$ref": "#/fixtureArrays/ort_3d_positive_and_negative_steps_subset_axes_input_data" }
366
+ }
367
+ },
368
+ "starts": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [1, 4] } },
369
+ "ends": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [1000, 2] } },
370
+ "axes": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [1, 2] } },
371
+ "steps": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [3, -2] } }
372
+ },
373
+ "outputs": { "output": { "dtype": "int32", "shape": [3, 1, 0], "tolerance": 0 } }
374
+ },
375
+ {
376
+ "name": "ort_5d_subset_axes_offset",
377
+ "provenance": {
378
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
379
+ "test": "SliceTest.Slice5D_SubsetOfAxes_Flatten2Dims_OffsetInput"
380
+ },
381
+ "inputs": {
382
+ "data": {
383
+ "dtype": "float32",
384
+ "shape": [1, 2, 2, 2, 2],
385
+ "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_5d_subset_axes_offset_input_data" } }
386
+ },
387
+ "starts": { "dtype": "int32", "shape": [4], "data": { "kind": "values", "values": [0, 1, 1, 0] } },
388
+ "ends": { "dtype": "int32", "shape": [4], "data": { "kind": "values", "values": [1, 2, 2147483647, 6] } },
389
+ "axes": { "dtype": "int32", "shape": [4], "data": { "kind": "values", "values": [0, 1, 2, 3] } },
390
+ "steps": { "dtype": "int32", "shape": [4], "data": { "kind": "values", "values": [1, 1, 1, 1] } }
391
+ },
392
+ "outputs": { "output": { "dtype": "float32", "shape": [1, 1, 1, 2, 2], "tolerance": 0.000001 } }
393
+ },
394
+ {
395
+ "name": "ort_5d_large_step",
396
+ "provenance": {
397
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
398
+ "test": "SliceTest.Slice5D_LargeStep"
399
+ },
400
+ "inputs": {
401
+ "data": {
402
+ "dtype": "float32",
403
+ "shape": [1, 2, 2, 2, 2],
404
+ "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_5d_subset_axes_offset_input_data" } }
405
+ },
406
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
407
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } },
408
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } },
409
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [2147483647] } }
410
+ },
411
+ "outputs": { "output": { "dtype": "float32", "shape": [1, 1, 2, 2, 2], "tolerance": 0.000001 } }
412
+ },
413
+ {
414
+ "name": "ort_3d_flatten_innermost_dims_copy",
415
+ "provenance": {
416
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
417
+ "test": "SliceTest.Slice3D_FlattenInnermostDimsIncopy"
418
+ },
419
+ "inputs": {
420
+ "data": {
421
+ "dtype": "int32",
422
+ "shape": [3, 3, 3],
423
+ "data": {
424
+ "kind": "values",
425
+ "values": { "$ref": "#/fixtureArrays/ort_3d_positive_and_negative_steps_subset_axes_input_data" }
426
+ }
427
+ },
428
+ "starts": { "dtype": "int32", "shape": [3], "data": { "kind": "values", "values": [0, 0, 1] } },
429
+ "ends": {
430
+ "dtype": "int32",
431
+ "shape": [3],
432
+ "data": { "kind": "values", "values": [2147483647, 2147483647, 2147483647] }
433
+ },
434
+ "axes": { "dtype": "int32", "shape": [3], "data": { "kind": "values", "values": [2, 1, 0] } },
435
+ "steps": { "dtype": "int32", "shape": [3], "data": { "kind": "values", "values": [1, 1, 2] } }
436
+ },
437
+ "outputs": { "output": { "dtype": "int32", "shape": [1, 3, 3], "tolerance": 0 } }
438
+ },
439
+ {
440
+ "name": "ort_5d_copy_axis2_large_block",
441
+ "provenance": {
442
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
443
+ "test": "SliceTest.Slice5D_CopyAxis2LargeBlock"
444
+ },
445
+ "inputs": {
446
+ "data": {
447
+ "dtype": "float32",
448
+ "shape": [1, 3, 4, 2, 2],
449
+ "data": {
450
+ "kind": "values",
451
+ "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, -1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, -1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, -1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0]
452
+ }
453
+ },
454
+ "starts": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 1] } },
455
+ "ends": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [2, 3] } },
456
+ "axes": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [1, 2] } },
457
+ "steps": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [1, 1] } }
458
+ },
459
+ "outputs": { "output": { "dtype": "float32", "shape": [1, 2, 2, 2, 2], "tolerance": 0 } }
460
+ },
461
+ {
462
+ "name": "ort_coalesce_dims_negative_and_positive_steps",
463
+ "provenance": {
464
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
465
+ "test": "SliceTest.CoalesceDims / negative and positive steps"
466
+ },
467
+ "inputs": {
468
+ "data": {
469
+ "dtype": "float32",
470
+ "shape": [2, 2, 2, 2],
471
+ "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_5d_subset_axes_offset_input_data" } }
472
+ },
473
+ "starts": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [1, 1] } },
474
+ "ends": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 2] } },
475
+ "axes": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 1] } },
476
+ "steps": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [-1, 1] } }
477
+ },
478
+ "outputs": { "output": { "dtype": "float32", "shape": [1, 1, 2, 2], "tolerance": 0 } }
479
+ },
480
+ {
481
+ "name": "ort_coalesce_dims_middle_axis_full_extent",
482
+ "provenance": {
483
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
484
+ "test": "SliceTest.CoalesceDims / middle axis full extent"
485
+ },
486
+ "inputs": {
487
+ "data": {
488
+ "dtype": "float32",
489
+ "shape": [1, 2, 2, 2, 2],
490
+ "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_5d_subset_axes_offset_input_data" } }
491
+ },
492
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } },
493
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [2147483647] } },
494
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [2] } },
495
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } }
496
+ },
497
+ "outputs": { "output": { "dtype": "float32", "shape": [1, 2, 1, 2, 2], "tolerance": 0 } }
498
+ },
499
+ {
500
+ "name": "ort_coalesce_dims_two_subset_axes",
501
+ "provenance": {
502
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
503
+ "test": "SliceTest.CoalesceDims / two subset axes"
504
+ },
505
+ "inputs": {
506
+ "data": {
507
+ "dtype": "float32",
508
+ "shape": [1, 2, 2, 2, 2],
509
+ "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_5d_subset_axes_offset_input_data" } }
510
+ },
511
+ "starts": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [1, 1] } },
512
+ "ends": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [2147483647, 2147483647] } },
513
+ "axes": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [1, 3] } },
514
+ "steps": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [1, 1] } }
515
+ },
516
+ "outputs": { "output": { "dtype": "float32", "shape": [1, 1, 2, 1, 2], "tolerance": 0 } }
517
+ },
518
+ {
519
+ "name": "f16_reverse_last_axis",
520
+ "inputs": {
521
+ "data": {
522
+ "dtype": "float16",
523
+ "shape": [2, 3],
524
+ "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] }
525
+ },
526
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-1] } },
527
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-2147483648] } },
528
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-1] } },
529
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-1] } }
530
+ },
531
+ "outputs": { "output": { "dtype": "float16", "shape": [2, 3], "tolerance": 0.001 } }
532
+ },
533
+ {
534
+ "name": "ort_empty_dim_positive_step",
535
+ "provenance": { "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc", "test": "SliceTest.EmptyDim" },
536
+ "inputs": {
537
+ "data": { "dtype": "float32", "shape": [0, 6], "data": { "kind": "values", "values": [] } },
538
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
539
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } },
540
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
541
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } }
542
+ },
543
+ "outputs": { "output": { "dtype": "float32", "shape": [0, 6], "tolerance": 0.000001 } }
544
+ },
545
+ {
546
+ "name": "ort_empty_dim_negative_step",
547
+ "provenance": { "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc", "test": "SliceTest.EmptyDim" },
548
+ "inputs": {
549
+ "data": { "dtype": "float32", "shape": [0, 6], "data": { "kind": "values", "values": [] } },
550
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } },
551
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
552
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
553
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-1] } }
554
+ },
555
+ "outputs": { "output": { "dtype": "float32", "shape": [0, 6], "tolerance": 0.000001 } }
556
+ },
557
+ {
558
+ "name": "ort_1d_regular_int32_data",
559
+ "provenance": {
560
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
561
+ "test": "SliceTest.Slice1D_Int32"
562
+ },
563
+ "inputs": {
564
+ "data": { "dtype": "int32", "shape": [6], "data": { "kind": "values", "values": [0, 1, 2, 3, 4, 5] } },
565
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [2] } },
566
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [4] } },
567
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
568
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } }
569
+ },
570
+ "outputs": { "output": { "dtype": "int32", "shape": [2], "tolerance": 0 } }
571
+ },
572
+ {
573
+ "name": "onnx_backend_slice",
574
+ "inputs": {
575
+ "data": {
576
+ "dtype": "float32",
577
+ "shape": [20, 10, 5],
578
+ "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/onnx_backend_slice_input_data" } }
579
+ },
580
+ "starts": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 0] } },
581
+ "ends": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [3, 10] } },
582
+ "axes": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 1] } },
583
+ "steps": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [1, 1] } }
584
+ },
585
+ "outputs": { "output": { "dtype": "float32", "shape": [3, 10, 5] } },
586
+ "provenance": {
587
+ "source": "cmake/external/onnx/onnx/backend/test/data/node/test_slice",
588
+ "notes": "ONNX int64 index values are adapted to supported int32 where representable."
589
+ }
590
+ },
591
+ {
592
+ "name": "onnx_backend_slice_default_axes",
593
+ "inputs": {
594
+ "data": {
595
+ "dtype": "float32",
596
+ "shape": [20, 10, 5],
597
+ "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/onnx_backend_slice_input_data" } }
598
+ },
599
+ "starts": { "dtype": "int32", "shape": [3], "data": { "kind": "values", "values": [0, 0, 3] } },
600
+ "ends": { "dtype": "int32", "shape": [3], "data": { "kind": "values", "values": [20, 10, 4] } },
601
+ "axes": { "dtype": "int32", "shape": [3], "data": { "kind": "values", "values": [0, 1, 2] } },
602
+ "steps": { "dtype": "int32", "shape": [3], "data": { "kind": "values", "values": [1, 1, 1] } }
603
+ },
604
+ "outputs": { "output": { "dtype": "float32", "shape": [20, 10, 1] } },
605
+ "provenance": {
606
+ "source": "cmake/external/onnx/onnx/backend/test/data/node/test_slice_default_axes",
607
+ "notes": "ONNX int64 index values use supported int32 storage where representable. Omitted axes and steps use their standard defaults; this also subsumes test_slice_default_steps."
608
+ }
609
+ },
610
+ {
611
+ "name": "onnx_backend_slice_end_out_of_bounds",
612
+ "inputs": {
613
+ "data": {
614
+ "dtype": "float32",
615
+ "shape": [20, 10, 5],
616
+ "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/onnx_backend_slice_input_data" } }
617
+ },
618
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } },
619
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1000] } },
620
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } },
621
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } }
622
+ },
623
+ "outputs": { "output": { "dtype": "float32", "shape": [20, 9, 5] } },
624
+ "provenance": {
625
+ "source": "cmake/external/onnx/onnx/backend/test/data/node/test_slice_end_out_of_bounds",
626
+ "notes": "ONNX int64 index values are adapted to supported int32 where representable."
627
+ }
628
+ },
629
+ {
630
+ "name": "onnx_backend_slice_neg",
631
+ "inputs": {
632
+ "data": {
633
+ "dtype": "float32",
634
+ "shape": [20, 10, 5],
635
+ "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/onnx_backend_slice_input_data" } }
636
+ },
637
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
638
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-1] } },
639
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } },
640
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } }
641
+ },
642
+ "outputs": { "output": { "dtype": "float32", "shape": [20, 9, 5] } },
643
+ "provenance": {
644
+ "source": "cmake/external/onnx/onnx/backend/test/data/node/test_slice_neg",
645
+ "notes": "ONNX int64 index values are adapted to supported int32 where representable."
646
+ }
647
+ },
648
+ {
649
+ "name": "onnx_backend_slice_neg_steps",
650
+ "inputs": {
651
+ "data": {
652
+ "dtype": "float32",
653
+ "shape": [20, 10, 5],
654
+ "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/onnx_backend_slice_input_data" } }
655
+ },
656
+ "starts": { "dtype": "int32", "shape": [3], "data": { "kind": "values", "values": [20, 10, 4] } },
657
+ "ends": { "dtype": "int32", "shape": [3], "data": { "kind": "values", "values": [0, 0, 1] } },
658
+ "axes": { "dtype": "int32", "shape": [3], "data": { "kind": "values", "values": [0, 1, 2] } },
659
+ "steps": { "dtype": "int32", "shape": [3], "data": { "kind": "values", "values": [-1, -3, -2] } }
660
+ },
661
+ "outputs": { "output": { "dtype": "float32", "shape": [19, 3, 2] } },
662
+ "provenance": {
663
+ "source": "cmake/external/onnx/onnx/backend/test/data/node/test_slice_neg_steps",
664
+ "notes": "ONNX int64 index values are adapted to supported int32 where representable."
665
+ }
666
+ },
667
+ {
668
+ "name": "onnx_backend_slice_negative_axes",
669
+ "inputs": {
670
+ "data": {
671
+ "dtype": "float32",
672
+ "shape": [20, 10, 5],
673
+ "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/onnx_backend_slice_input_data" } }
674
+ },
675
+ "starts": { "dtype": "int32", "shape": [3], "data": { "kind": "values", "values": [0, 0, 3] } },
676
+ "ends": { "dtype": "int32", "shape": [3], "data": { "kind": "values", "values": [20, 10, 4] } },
677
+ "axes": { "dtype": "int32", "shape": [3], "data": { "kind": "values", "values": [0, -2, -1] } },
678
+ "steps": { "dtype": "int32", "shape": [3], "data": { "kind": "values", "values": [1, 1, 1] } }
679
+ },
680
+ "outputs": { "output": { "dtype": "float32", "shape": [20, 10, 1] } },
681
+ "provenance": {
682
+ "source": "cmake/external/onnx/onnx/backend/test/data/node/test_slice_negative_axes",
683
+ "notes": "ONNX int64 index values are adapted to supported int32 where representable. ONNX omitted steps input represented with default unit steps."
684
+ }
685
+ },
686
+ {
687
+ "name": "ort_negative_step_regular_1d",
688
+ "provenance": {
689
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
690
+ "test": "SliceTest.Slice1D_WithNegativeSteps_Regular"
691
+ },
692
+ "inputs": {
693
+ "data": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0] } },
694
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-1] } },
695
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-4] } },
696
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
697
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-1] } }
698
+ },
699
+ "outputs": { "output": { "dtype": "float32", "shape": [3], "tolerance": 0 } }
700
+ },
701
+ {
702
+ "name": "ort_negative_step_end_out_of_bounds_1d",
703
+ "provenance": {
704
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
705
+ "test": "SliceTest.Slice1D_WithNegativeSteps_EndOutOfBounds_2"
706
+ },
707
+ "inputs": {
708
+ "data": {
709
+ "dtype": "float32",
710
+ "shape": [6],
711
+ "data": { "kind": "values", "values": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0] }
712
+ },
713
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
714
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-10] } },
715
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
716
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-1] } }
717
+ },
718
+ "outputs": { "output": { "dtype": "float32", "shape": [1], "tolerance": 0 } }
719
+ },
720
+ {
721
+ "name": "ort_negative_step_valid_range_1d",
722
+ "provenance": {
723
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
724
+ "test": "SliceTest.Slice1D_WithNegativeSteps_ValidStartEndRange"
725
+ },
726
+ "inputs": {
727
+ "data": {
728
+ "dtype": "float32",
729
+ "shape": [6],
730
+ "data": { "kind": "values", "values": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0] }
731
+ },
732
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [5] } },
733
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
734
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
735
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-1] } }
736
+ },
737
+ "outputs": { "output": { "dtype": "float32", "shape": [5], "tolerance": 0 } }
738
+ },
739
+ {
740
+ "name": "ort_reverse_subset_axis1",
741
+ "provenance": {
742
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
743
+ "test": "SliceTest.Slice2D_ReverseSubsetOfAxes_1"
744
+ },
745
+ "inputs": {
746
+ "data": { "dtype": "float32", "shape": [2, 2], "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0] } },
747
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-1] } },
748
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-2147483648] } },
749
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } },
750
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-1] } }
751
+ },
752
+ "outputs": { "output": { "dtype": "float32", "shape": [2, 2], "tolerance": 0 } }
753
+ },
754
+ {
755
+ "name": "ort_positive_negative_steps_subset_axes_int32",
756
+ "provenance": {
757
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
758
+ "test": "SliceTest.Slice3D_WithPositiveAndNegativeSteps_SubsetOfAxes_1"
759
+ },
760
+ "inputs": {
761
+ "data": {
762
+ "dtype": "int32",
763
+ "shape": [3, 3, 3],
764
+ "data": {
765
+ "kind": "values",
766
+ "values": { "$ref": "#/fixtureArrays/ort_3d_positive_and_negative_steps_subset_axes_input_data" }
767
+ }
768
+ },
769
+ "starts": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [1, 4] } },
770
+ "ends": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [1000, 1] } },
771
+ "axes": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [1, 2] } },
772
+ "steps": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [3, -2] } }
773
+ },
774
+ "outputs": { "output": { "dtype": "int32", "shape": [3, 1, 1], "tolerance": 0 } }
775
+ },
776
+ {
777
+ "name": "ort_5d_subset_axes_flatten_offset",
778
+ "provenance": {
779
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
780
+ "test": "SliceTest.Slice5D_SubsetOfAxes_Flatten2Dims_OffsetInput"
781
+ },
782
+ "inputs": {
783
+ "data": {
784
+ "dtype": "float32",
785
+ "shape": [1, 2, 2, 2, 2],
786
+ "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_5d_subset_axes_offset_input_data" } }
787
+ },
788
+ "starts": { "dtype": "int32", "shape": [4], "data": { "kind": "values", "values": [0, 1, 1, 0] } },
789
+ "ends": { "dtype": "int32", "shape": [4], "data": { "kind": "values", "values": [1, 2, 2147483647, 6] } },
790
+ "axes": { "dtype": "int32", "shape": [4], "data": { "kind": "values", "values": [0, 1, 2, 3] } },
791
+ "steps": { "dtype": "int32", "shape": [4], "data": { "kind": "values", "values": [1, 1, 1, 1] } }
792
+ },
793
+ "outputs": { "output": { "dtype": "float32", "shape": [1, 1, 1, 2, 2], "tolerance": 0 } }
794
+ },
795
+ {
796
+ "name": "ort_5d_large_step_axis1",
797
+ "provenance": {
798
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
799
+ "test": "SliceTest.Slice5D_LargeStep"
800
+ },
801
+ "inputs": {
802
+ "data": {
803
+ "dtype": "float32",
804
+ "shape": [1, 2, 2, 2, 2],
805
+ "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_5d_subset_axes_offset_input_data" } }
806
+ },
807
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
808
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } },
809
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } },
810
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [2147483647] } }
811
+ },
812
+ "outputs": { "output": { "dtype": "float32", "shape": [1, 1, 2, 2, 2], "tolerance": 0 } }
813
+ },
814
+ {
815
+ "name": "onnx_backend_slice_start_out_of_bounds",
816
+ "inputs": {
817
+ "data": {
818
+ "dtype": "float32",
819
+ "shape": [20, 10, 5],
820
+ "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/onnx_backend_slice_input_data" } }
821
+ },
822
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1000] } },
823
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1000] } },
824
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } },
825
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } }
826
+ },
827
+ "outputs": { "output": { "dtype": "float32", "shape": [20, 0, 5] } },
828
+ "provenance": {
829
+ "source": "cmake/external/onnx/onnx/backend/test/data/node/test_slice_start_out_of_bounds",
830
+ "notes": "ONNX int64 index values are adapted to supported int32 where representable."
831
+ }
832
+ },
833
+ {
834
+ "name": "ort_1d_positive_step_every_other",
835
+ "provenance": {
836
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
837
+ "test": "SliceTest.Slice1D_WithPositiveSteps"
838
+ },
839
+ "inputs": {
840
+ "data": {
841
+ "dtype": "float32",
842
+ "shape": [6],
843
+ "data": { "kind": "values", "values": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0] }
844
+ },
845
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
846
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [6] } },
847
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
848
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [2] } }
849
+ },
850
+ "outputs": {
851
+ "output": {
852
+ "dtype": "float32",
853
+ "shape": [3],
854
+ "tolerance": 0,
855
+ "data": { "kind": "values", "values": [0.0, 2.0, 4.0] }
856
+ }
857
+ }
858
+ },
859
+ {
860
+ "name": "ort_1d_reverse_all_axes_end_int32_max",
861
+ "provenance": {
862
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
863
+ "test": "SliceTest.Slice1D_ReverseAllAxes_1",
864
+ "notes": "Uses int32 max as the framework-representable sentinel for the ONNX int64 max end."
865
+ },
866
+ "inputs": {
867
+ "data": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0] } },
868
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-1] } },
869
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [2147483647] } },
870
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
871
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-1] } }
872
+ },
873
+ "outputs": {
874
+ "output": {
875
+ "dtype": "float32",
876
+ "shape": [4],
877
+ "tolerance": 0,
878
+ "data": { "kind": "values", "values": [4.0, 3.0, 2.0, 1.0] }
879
+ }
880
+ }
881
+ },
882
+ {
883
+ "name": "ort_1d_reverse_all_axes_end_int32_min",
884
+ "provenance": {
885
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
886
+ "test": "SliceTest.Slice1D_ReverseAllAxes_2",
887
+ "notes": "Uses int32 min as the framework-representable sentinel for the ONNX int64 min end."
888
+ },
889
+ "inputs": {
890
+ "data": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0] } },
891
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-1] } },
892
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-2147483648] } },
893
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
894
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-1] } }
895
+ },
896
+ "outputs": {
897
+ "output": {
898
+ "dtype": "float32",
899
+ "shape": [4],
900
+ "tolerance": 0,
901
+ "data": { "kind": "values", "values": [4.0, 3.0, 2.0, 1.0] }
902
+ }
903
+ }
904
+ },
905
+ {
906
+ "name": "ort_1d_reverse_all_axes_end_before_negative_dim",
907
+ "provenance": {
908
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
909
+ "test": "SliceTest.Slice1D_ReverseAllAxes_3"
910
+ },
911
+ "inputs": {
912
+ "data": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0] } },
913
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-1] } },
914
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-5] } },
915
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
916
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-1] } }
917
+ },
918
+ "outputs": {
919
+ "output": {
920
+ "dtype": "float32",
921
+ "shape": [4],
922
+ "tolerance": 0,
923
+ "data": { "kind": "values", "values": [4.0, 3.0, 2.0, 1.0] }
924
+ }
925
+ }
926
+ },
927
+ {
928
+ "name": "ort_2d_reverse_subset_axis0",
929
+ "provenance": {
930
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
931
+ "test": "SliceTest.Slice2D_ReverseSubsetOfAxes_2",
932
+ "notes": "Uses int32 min as the framework-representable sentinel for the ONNX int64 min end."
933
+ },
934
+ "inputs": {
935
+ "data": { "dtype": "float32", "shape": [2, 2], "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0] } },
936
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-1] } },
937
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-2147483648] } },
938
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
939
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-1] } }
940
+ },
941
+ "outputs": {
942
+ "output": {
943
+ "dtype": "float32",
944
+ "shape": [2, 2],
945
+ "tolerance": 0,
946
+ "data": { "kind": "values", "values": [3.0, 4.0, 1.0, 2.0] }
947
+ }
948
+ }
949
+ },
950
+ {
951
+ "name": "ort_2d_implicit_full_axis_copy",
952
+ "provenance": {
953
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
954
+ "test": "SliceTest.Slice2D_ImplicitCopyBySlicingADimensionFully",
955
+ "notes": "Uses int32 max as the framework-representable oversized positive end."
956
+ },
957
+ "inputs": {
958
+ "data": { "dtype": "float32", "shape": [2, 2], "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0] } },
959
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
960
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [2147483647] } },
961
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } },
962
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } }
963
+ },
964
+ "outputs": {
965
+ "output": {
966
+ "dtype": "float32",
967
+ "shape": [2, 2],
968
+ "tolerance": 0,
969
+ "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0] }
970
+ }
971
+ }
972
+ },
973
+ {
974
+ "name": "ort_int8_reverse_all_axes_end_int32_min",
975
+ "provenance": {
976
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
977
+ "test": "SliceTest.Slice1D_ReverseAllAxes_2",
978
+ "notes": "Reverse-slice sentinel case with logical int8 edge values."
979
+ },
980
+ "inputs": {
981
+ "data": { "dtype": "int8", "shape": [4], "data": { "kind": "values", "values": [-128, -1, 0, 127] } },
982
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-1] } },
983
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-2147483648] } },
984
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
985
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-1] } }
986
+ },
987
+ "outputs": {
988
+ "output": {
989
+ "dtype": "int8",
990
+ "shape": [4],
991
+ "tolerance": 0,
992
+ "data": { "kind": "values", "values": [127, 0, -1, -128] }
993
+ }
994
+ }
995
+ },
996
+ {
997
+ "name": "uint8_positive_step_every_other_edge_values",
998
+ "provenance": {
999
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
1000
+ "test": "SliceTest.Slice1D_WithPositiveSteps",
1001
+ "notes": "Positive-step slice with logical uint8 edge values."
1002
+ },
1003
+ "inputs": {
1004
+ "data": { "dtype": "uint8", "shape": [6], "data": { "kind": "values", "values": [0, 1, 127, 128, 254, 255] } },
1005
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
1006
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [6] } },
1007
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
1008
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [2] } }
1009
+ },
1010
+ "outputs": {
1011
+ "output": {
1012
+ "dtype": "uint8",
1013
+ "shape": [3],
1014
+ "tolerance": 0,
1015
+ "data": { "kind": "values", "values": [0, 127, 254] }
1016
+ }
1017
+ }
1018
+ },
1019
+ {
1020
+ "name": "inner_vec4_step1_aligned_2d_f32",
1021
+ "inputs": {
1022
+ "data": {
1023
+ "dtype": "float32",
1024
+ "shape": [6, 16],
1025
+ "data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.23 }
1026
+ },
1027
+ "starts": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [2, 4] } },
1028
+ "ends": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [6, 16] } },
1029
+ "axes": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 1] } },
1030
+ "steps": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [1, 1] } }
1031
+ },
1032
+ "outputs": { "output": { "dtype": "float32", "shape": [4, 12], "tolerance": 0 } }
1033
+ },
1034
+ {
1035
+ "name": "inner_vec4_step1_misaligned_start_2d_f32",
1036
+ "inputs": {
1037
+ "data": {
1038
+ "dtype": "float32",
1039
+ "shape": [4, 12],
1040
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29 }
1041
+ },
1042
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [2] } },
1043
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [10] } },
1044
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } },
1045
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } }
1046
+ },
1047
+ "outputs": { "output": { "dtype": "float32", "shape": [4, 8], "tolerance": 0 } }
1048
+ },
1049
+ {
1050
+ "name": "inner_vec4_reverse_inner_2d_f32",
1051
+ "inputs": {
1052
+ "data": {
1053
+ "dtype": "float32",
1054
+ "shape": [2, 8],
1055
+ "data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.11 }
1056
+ },
1057
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-1] } },
1058
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-2147483648] } },
1059
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-1] } },
1060
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-1] } }
1061
+ },
1062
+ "outputs": { "output": { "dtype": "float32", "shape": [2, 8], "tolerance": 0 } }
1063
+ },
1064
+ {
1065
+ "name": "inner_vec4_outer_slice_rank3_f16",
1066
+ "inputs": {
1067
+ "data": { "dtype": "float16", "shape": [3, 5, 8] },
1068
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } },
1069
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [5] } },
1070
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } },
1071
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } }
1072
+ },
1073
+ "outputs": { "output": { "dtype": "float16", "shape": [3, 4, 8], "tolerance": 0.001 } }
1074
+ },
1075
+ {
1076
+ "name": "inner_vec4_inner_step2_f16",
1077
+ "inputs": {
1078
+ "data": { "dtype": "float16", "shape": [2, 16] },
1079
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
1080
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [16] } },
1081
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } },
1082
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [2] } }
1083
+ },
1084
+ "outputs": { "output": { "dtype": "float16", "shape": [2, 8], "tolerance": 0.001 } }
1085
+ },
1086
+ {
1087
+ "name": "inner_vec4_outer_slice_u32",
1088
+ "inputs": {
1089
+ "data": {
1090
+ "dtype": "uint32",
1091
+ "shape": [8, 4],
1092
+ "data": {
1093
+ "kind": "values",
1094
+ "values": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31]
1095
+ }
1096
+ },
1097
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } },
1098
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [8] } },
1099
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
1100
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } }
1101
+ },
1102
+ "outputs": {
1103
+ "output": {
1104
+ "dtype": "uint32",
1105
+ "shape": [7, 4],
1106
+ "tolerance": 0,
1107
+ "data": {
1108
+ "kind": "values",
1109
+ "values": [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31]
1110
+ }
1111
+ }
1112
+ }
1113
+ },
1114
+ {
1115
+ "name": "inner_vec4_rank1_tail_f32",
1116
+ "inputs": {
1117
+ "data": {
1118
+ "dtype": "float32",
1119
+ "shape": [8],
1120
+ "data": { "kind": "values", "values": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] }
1121
+ },
1122
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [4] } },
1123
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [8] } },
1124
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
1125
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } }
1126
+ },
1127
+ "outputs": {
1128
+ "output": {
1129
+ "dtype": "float32",
1130
+ "shape": [4],
1131
+ "tolerance": 0,
1132
+ "data": { "kind": "values", "values": [4.0, 5.0, 6.0, 7.0] }
1133
+ }
1134
+ }
1135
+ },
1136
+ {
1137
+ "name": "ort_1d_regular",
1138
+ "provenance": {
1139
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
1140
+ "test": "SliceTest.Slice1D_Regular"
1141
+ },
1142
+ "inputs": {
1143
+ "data": {
1144
+ "dtype": "float32",
1145
+ "shape": [6],
1146
+ "data": { "kind": "values", "values": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0] }
1147
+ },
1148
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [2] } },
1149
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [4] } },
1150
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
1151
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } }
1152
+ },
1153
+ "outputs": {
1154
+ "output": {
1155
+ "dtype": "float32",
1156
+ "shape": [2],
1157
+ "tolerance": 0,
1158
+ "data": { "kind": "values", "values": [2.0, 3.0] }
1159
+ }
1160
+ }
1161
+ },
1162
+ {
1163
+ "name": "ort_1d_end_out_of_bounds_full_copy",
1164
+ "provenance": {
1165
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
1166
+ "test": "SliceTest.Slice1D_EndOutOfBounds"
1167
+ },
1168
+ "inputs": {
1169
+ "data": {
1170
+ "dtype": "float32",
1171
+ "shape": [6],
1172
+ "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] }
1173
+ },
1174
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
1175
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [10] } },
1176
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
1177
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } }
1178
+ },
1179
+ "outputs": {
1180
+ "output": {
1181
+ "dtype": "float32",
1182
+ "shape": [6],
1183
+ "tolerance": 0,
1184
+ "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] }
1185
+ }
1186
+ }
1187
+ },
1188
+ {
1189
+ "name": "ort_2d_one_axis_axis0",
1190
+ "provenance": {
1191
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
1192
+ "test": "SliceTest.Slice2D_OneAxis"
1193
+ },
1194
+ "inputs": {
1195
+ "data": {
1196
+ "dtype": "float32",
1197
+ "shape": [6, 4],
1198
+ "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_2d_two_axes_negative_end_input_data" } }
1199
+ },
1200
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } },
1201
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [3] } },
1202
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
1203
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } }
1204
+ },
1205
+ "outputs": {
1206
+ "output": {
1207
+ "dtype": "float32",
1208
+ "shape": [2, 4],
1209
+ "tolerance": 0,
1210
+ "data": { "kind": "values", "values": [10.0, 11.0, 12.0, 13.0, 20.0, 21.0, 22.0, 23.0] }
1211
+ }
1212
+ }
1213
+ },
1214
+ {
1215
+ "name": "ort_2d_one_axis_default_steps",
1216
+ "provenance": {
1217
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
1218
+ "test": "SliceTest.Slice2D_OneAxis",
1219
+ "notes": "ORT omits the optional steps input here; ONNX defaults it to unit steps."
1220
+ },
1221
+ "inputs": {
1222
+ "data": {
1223
+ "dtype": "float32",
1224
+ "shape": [6, 4],
1225
+ "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_2d_two_axes_negative_end_input_data" } }
1226
+ },
1227
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } },
1228
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [3] } },
1229
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } }
1230
+ },
1231
+ "outputs": {
1232
+ "output": {
1233
+ "dtype": "float32",
1234
+ "shape": [2, 4],
1235
+ "tolerance": 0,
1236
+ "data": { "kind": "values", "values": [10.0, 11.0, 12.0, 13.0, 20.0, 21.0, 22.0, 23.0] }
1237
+ }
1238
+ }
1239
+ },
1240
+ {
1241
+ "name": "ort_2d_default_axes_and_steps",
1242
+ "provenance": {
1243
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
1244
+ "test": "SliceTest.Slice2D_DefaultAxes",
1245
+ "notes": "ORT omits optional axes and steps; ONNX defaults axes to [0] and steps to [1]."
1246
+ },
1247
+ "inputs": {
1248
+ "data": { "dtype": "float32", "shape": [2, 2], "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0] } },
1249
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
1250
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } }
1251
+ },
1252
+ "outputs": {
1253
+ "output": {
1254
+ "dtype": "float32",
1255
+ "shape": [1, 2],
1256
+ "tolerance": 0,
1257
+ "data": { "kind": "values", "values": [1.0, 2.0] }
1258
+ }
1259
+ }
1260
+ },
1261
+ {
1262
+ "name": "ort_3d_clamped_multi_axis",
1263
+ "provenance": { "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc", "test": "SliceTest.Slice3D" },
1264
+ "inputs": {
1265
+ "data": {
1266
+ "dtype": "float32",
1267
+ "shape": [3, 3, 3],
1268
+ "data": {
1269
+ "kind": "values",
1270
+ "values": [111.0, 112.0, 113.0, 121.0, 122.0, 123.0, 131.0, 132.0, 133.0, 211.0, 212.0, 213.0, 221.0, 222.0, 223.0, 231.0, 232.0, 233.0, 311.0, 312.0, 313.0, 321.0, 322.0, 323.0, 331.0, 332.0, 333.0]
1271
+ }
1272
+ },
1273
+ "starts": { "dtype": "int32", "shape": [3], "data": { "kind": "values", "values": [0, 1, 1] } },
1274
+ "ends": { "dtype": "int32", "shape": [3], "data": { "kind": "values", "values": [1000, 1000, 1000] } },
1275
+ "axes": { "dtype": "int32", "shape": [3], "data": { "kind": "values", "values": [0, 1, 2] } },
1276
+ "steps": { "dtype": "int32", "shape": [3], "data": { "kind": "values", "values": [1, 1, 1] } }
1277
+ },
1278
+ "outputs": {
1279
+ "output": {
1280
+ "dtype": "float32",
1281
+ "shape": [3, 2, 2],
1282
+ "tolerance": 0,
1283
+ "data": {
1284
+ "kind": "values",
1285
+ "values": [122.0, 123.0, 132.0, 133.0, 222.0, 223.0, 232.0, 233.0, 322.0, 323.0, 332.0, 333.0]
1286
+ }
1287
+ }
1288
+ }
1289
+ },
1290
+ {
1291
+ "name": "ort_bool_reverse_subset_axis1",
1292
+ "provenance": {
1293
+ "source": "onnxruntime/test/providers/cpu/tensor/slice_op.test.cc",
1294
+ "test": "SliceTest.Slice2D_ReverseSubsetOfAxes_1",
1295
+ "notes": "Same reverse-subset slice behavior with a bool payload."
1296
+ },
1297
+ "inputs": {
1298
+ "data": { "dtype": "bool", "shape": [2, 2], "data": { "kind": "values", "values": [1, 0, 0, 1] } },
1299
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-1] } },
1300
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-2147483648] } },
1301
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } },
1302
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-1] } }
1303
+ },
1304
+ "outputs": {
1305
+ "output": {
1306
+ "dtype": "bool",
1307
+ "shape": [2, 2],
1308
+ "tolerance": 0,
1309
+ "data": { "kind": "values", "values": [0, 1, 1, 0] }
1310
+ }
1311
+ }
1312
+ },
1313
+ {
1314
+ "name": "ort_caseB_empty",
1315
+ "inputs": {
1316
+ "data": {
1317
+ "dtype": "float32",
1318
+ "shape": [3, 5],
1319
+ "data": {
1320
+ "kind": "values",
1321
+ "values": [0.0, 1.0, 2.0, 3.0, 4.0, 10.0, 11.0, 12.0, 13.0, 14.0, 20.0, 21.0, 22.0, 23.0, 24.0]
1322
+ }
1323
+ },
1324
+ "starts": { "dtype": "int32", "shape": [0], "data": { "kind": "values", "values": [] } },
1325
+ "ends": { "dtype": "int32", "shape": [0], "data": { "kind": "values", "values": [] } },
1326
+ "axes": { "dtype": "int32", "shape": [0], "data": { "kind": "values", "values": [] } },
1327
+ "steps": { "dtype": "int32", "shape": [0], "data": { "kind": "values", "values": [] } }
1328
+ },
1329
+ "outputs": {
1330
+ "output": {
1331
+ "dtype": "float32",
1332
+ "shape": [3, 5],
1333
+ "data": {
1334
+ "kind": "values",
1335
+ "values": [0.0, 1.0, 2.0, 3.0, 4.0, 10.0, 11.0, 12.0, 13.0, 14.0, 20.0, 21.0, 22.0, 23.0, 24.0]
1336
+ },
1337
+ "tolerance": 0.001
1338
+ }
1339
+ }
1340
+ },
1341
+ {
1342
+ "name": "inner_vec4_int8_aligned_2d",
1343
+ "provenance": {
1344
+ "notes": "int8 aligned inner_vec4 store (step=1, inner_start=0 %4==0, data/out last dim 8 %4==0). int8 maps to i32 storage so binding is vec4<i32>. Previously only an int8 reverse case existed, which hits the per-component branch, leaving the aligned vec4<i8> store path GPU-unvalidated."
1345
+ },
1346
+ "inputs": {
1347
+ "data": {
1348
+ "dtype": "int8",
1349
+ "shape": [2, 8],
1350
+ "data": { "kind": "values", "values": [-128, -1, 0, 1, 2, 3, 4, 127, 10, 20, 30, 40, 50, 60, 70, 80] }
1351
+ },
1352
+ "starts": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [1, 0] } },
1353
+ "ends": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [2, 8] } },
1354
+ "axes": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 1] } },
1355
+ "steps": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [1, 1] } }
1356
+ },
1357
+ "outputs": {
1358
+ "output": {
1359
+ "dtype": "int8",
1360
+ "shape": [1, 8],
1361
+ "tolerance": 0,
1362
+ "data": { "kind": "values", "values": [10, 20, 30, 40, 50, 60, 70, 80] }
1363
+ }
1364
+ }
1365
+ },
1366
+ {
1367
+ "name": "inner_vec4_uint8_aligned_2d",
1368
+ "provenance": {
1369
+ "notes": "uint8 aligned inner_vec4 full-copy store (step=1, start=0, last dim 8 %4==0). uint8 maps to u32 storage -> binding vec4<u32>. Edge values 0..255 to catch any narrowing."
1370
+ },
1371
+ "inputs": {
1372
+ "data": {
1373
+ "dtype": "uint8",
1374
+ "shape": [2, 8],
1375
+ "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/inner_vec4_uint8_aligned_2d_input_data" } }
1376
+ },
1377
+ "starts": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 0] } },
1378
+ "ends": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [2, 8] } },
1379
+ "axes": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 1] } },
1380
+ "steps": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [1, 1] } }
1381
+ },
1382
+ "outputs": {
1383
+ "output": {
1384
+ "dtype": "uint8",
1385
+ "shape": [2, 8],
1386
+ "tolerance": 0,
1387
+ "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/inner_vec4_uint8_aligned_2d_input_data" } }
1388
+ }
1389
+ }
1390
+ },
1391
+ {
1392
+ "name": "inner_vec4_bool_aligned_2d",
1393
+ "provenance": {
1394
+ "notes": "bool aligned inner_vec4 store (step=1, start=0, last dim 8 %4==0). bool maps to u32 storage -> binding vec4<u32>. ORT computes bool Slice. The only prior bool case is _gpu_gap-named so render coverage skips it, leaving bool Slice GPU-unvalidated; this case exercises bool through the aligned vec4 store on a non-skipped name."
1395
+ },
1396
+ "inputs": {
1397
+ "data": {
1398
+ "dtype": "bool",
1399
+ "shape": [2, 8],
1400
+ "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/inner_vec4_bool_aligned_2d_input_data" } }
1401
+ },
1402
+ "starts": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 0] } },
1403
+ "ends": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [2, 8] } },
1404
+ "axes": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 1] } },
1405
+ "steps": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [1, 1] } }
1406
+ },
1407
+ "outputs": {
1408
+ "output": {
1409
+ "dtype": "bool",
1410
+ "shape": [2, 8],
1411
+ "tolerance": 0,
1412
+ "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/inner_vec4_bool_aligned_2d_input_data" } }
1413
+ }
1414
+ }
1415
+ },
1416
+ {
1417
+ "name": "inner_vec4_reversed_axes_order_rank2",
1418
+ "inputs": {
1419
+ "data": {
1420
+ "dtype": "float32",
1421
+ "shape": [6, 16],
1422
+ "data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.23 }
1423
+ },
1424
+ "starts": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [4, 1] } },
1425
+ "ends": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [16, 5] } },
1426
+ "axes": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [1, 0] } },
1427
+ "steps": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [1, 1] } }
1428
+ },
1429
+ "outputs": { "output": { "dtype": "float32", "shape": [4, 12], "tolerance": 0 } }
1430
+ },
1431
+ {
1432
+ "name": "inner_vec4_negative_inner_axis_step2_rank3",
1433
+ "inputs": {
1434
+ "data": {
1435
+ "dtype": "float32",
1436
+ "shape": [3, 5, 16],
1437
+ "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.17 }
1438
+ },
1439
+ "starts": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [1, 0] } },
1440
+ "ends": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [3, 16] } },
1441
+ "axes": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [1, -1] } },
1442
+ "steps": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [1, 2] } }
1443
+ },
1444
+ "outputs": { "output": { "dtype": "float32", "shape": [3, 2, 8], "tolerance": 0 } }
1445
+ },
1446
+ {
1447
+ "name": "generic_metadata_negative_axis_rank4",
1448
+ "inputs": {
1449
+ "data": {
1450
+ "dtype": "float32",
1451
+ "shape": [2, 3, 4, 5],
1452
+ "data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.19 }
1453
+ },
1454
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } },
1455
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [3] } },
1456
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-2] } },
1457
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } }
1458
+ },
1459
+ "outputs": { "output": { "dtype": "float32", "shape": [2, 3, 2, 5], "tolerance": 0 } }
1460
+ },
1461
+ {
1462
+ "name": "generic_metadata_no_axes_rank3_negative_start",
1463
+ "inputs": {
1464
+ "data": {
1465
+ "dtype": "float32",
1466
+ "shape": [4, 6, 5],
1467
+ "data": { "kind": "fillFloat32", "sinStep": 0.09, "cosStep": 0.21 }
1468
+ },
1469
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-2] } },
1470
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [4] } }
1471
+ },
1472
+ "outputs": { "output": { "dtype": "float32", "shape": [2, 6, 5], "tolerance": 0 } }
1473
+ },
1474
+ {
1475
+ "name": "steps_without_axes_reverse_stride2",
1476
+ "provenance": {
1477
+ "notes": "Pins the independent optional-input combination in which steps is supplied while axes is omitted. Implicit axis 0 with a negative stride of magnitude two must select rows 4 and 2, so neither silently defaulting steps nor requiring axes can pass."
1478
+ },
1479
+ "inputs": {
1480
+ "data": {
1481
+ "dtype": "float32",
1482
+ "shape": [5, 3],
1483
+ "data": {
1484
+ "kind": "values",
1485
+ "values": [0.0, 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]
1486
+ }
1487
+ },
1488
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [4] } },
1489
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
1490
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-2] } }
1491
+ },
1492
+ "outputs": {
1493
+ "output": {
1494
+ "dtype": "float32",
1495
+ "shape": [2, 3],
1496
+ "tolerance": 0,
1497
+ "data": { "kind": "values", "values": [12.0, 13.0, 14.0, 6.0, 7.0, 8.0] }
1498
+ }
1499
+ }
1500
+ },
1501
+ {
1502
+ "name": "rank7_last_axis",
1503
+ "inputs": {
1504
+ "data": {
1505
+ "dtype": "float32",
1506
+ "shape": [2, 1, 2, 1, 2, 1, 4],
1507
+ "data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.29 }
1508
+ },
1509
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } },
1510
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [4] } },
1511
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [6] } },
1512
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } }
1513
+ },
1514
+ "outputs": { "output": { "dtype": "float32", "shape": [2, 1, 2, 1, 2, 1, 3], "tolerance": 0 } }
1515
+ },
1516
+ {
1517
+ "name": "rank8_last_axis",
1518
+ "attrs": {},
1519
+ "inputs": {
1520
+ "data": {
1521
+ "dtype": "float32",
1522
+ "shape": [2, 1, 2, 1, 2, 1, 2, 4],
1523
+ "data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.29 }
1524
+ },
1525
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } },
1526
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [4] } },
1527
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [7] } },
1528
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } }
1529
+ },
1530
+ "outputs": { "output": { "dtype": "float32", "shape": [2, 1, 2, 1, 2, 1, 2, 3], "tolerance": 0 } }
1531
+ },
1532
+ {
1533
+ "name": "rank2_axis0_odd_width_x4_f16",
1534
+ "provenance": {
1535
+ "notes": "A float16 odd-width x4 row slice checks half-precision storage and its guarded final group. Slice is a copy, so the tolerance remains zero."
1536
+ },
1537
+ "inputs": {
1538
+ "data": { "dtype": "float16", "shape": [6, 5], "data": { "kind": "linspace", "start": -1.0, "end": 1.0 } },
1539
+ "starts": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } },
1540
+ "ends": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [5] } },
1541
+ "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } },
1542
+ "steps": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } }
1543
+ },
1544
+ "outputs": { "output": { "dtype": "float16", "shape": [4, 5], "tolerance": 0 } }
1545
+ }
1546
+ ]
1547
+ }