| { |
| "op": "ai.onnx.Scatter", |
| "cases": [ |
| { |
| "name": "dispatch_cliff_axis0_updates_over_16m_f32", |
| "attrs": { "axis": 0 }, |
| "inputs": { |
| "data": { "dtype": "float32", "shape": [1, 16777216], "data": { "kind": "constant", "value": 0.0 } }, |
| "indices": { "dtype": "int32", "shape": [1, 16777216], "data": { "kind": "constant", "value": 0 } }, |
| "updates": { |
| "dtype": "float32", |
| "shape": [1, 16777216], |
| "data": { "kind": "linspace", "start": -1.0, "end": 1.0 } |
| } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [1, 16777216], "tolerance": 0 } } |
| }, |
| { |
| "name": "axis0_3x3_f32", |
| "attrs": { "axis": 0 }, |
| "inputs": { |
| "data": { "dtype": "float32", "shape": [3, 3], "data": { "kind": "constant", "value": 0.0 } }, |
| "indices": { "dtype": "int32", "shape": [2, 3], "data": { "kind": "values", "values": [1, 0, 2, 0, 2, 1] } }, |
| "updates": { |
| "dtype": "float32", |
| "shape": [2, 3], |
| "data": { "kind": "values", "values": [1.0, 1.1, 1.2, 2.0, 2.1, 2.2] } |
| } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [3, 3], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "axis1_row_f32", |
| "attrs": { "axis": 1 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [1, 5], |
| "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0] } |
| }, |
| "indices": { "dtype": "int32", "shape": [1, 2], "data": { "kind": "values", "values": [1, 3] } }, |
| "updates": { "dtype": "float32", "shape": [1, 2], "data": { "kind": "values", "values": [1.1, 2.1] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [1, 5], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "negative_axis_minus1_f32", |
| "attrs": { "axis": -1 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [2, 4], |
| "data": { "kind": "values", "values": [10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0] } |
| }, |
| "indices": { "dtype": "int32", "shape": [2, 2], "data": { "kind": "values", "values": [0, 3, 2, 1] } }, |
| "updates": { |
| "dtype": "float32", |
| "shape": [2, 2], |
| "data": { "kind": "values", "values": [-1.0, -2.0, -3.0, -4.0] } |
| } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [2, 4], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "axis0_3x3_f16", |
| "attrs": { "axis": 0 }, |
| "inputs": { |
| "data": { "dtype": "float16", "shape": [3, 3], "data": { "kind": "constant", "value": 0.0 } }, |
| "indices": { "dtype": "int32", "shape": [2, 3], "data": { "kind": "values", "values": [1, 0, 2, 0, 2, 1] } }, |
| "updates": { |
| "dtype": "float16", |
| "shape": [2, 3], |
| "data": { "kind": "values", "values": [1.0, 1.5, 2.0, 2.5, 3.0, 3.5] } |
| } |
| }, |
| "outputs": { "output": { "dtype": "float16", "shape": [3, 3], "tolerance": 0.001 } } |
| }, |
| { |
| "name": "ort_signed_negative_indices_axis1", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/scatter_op_test.cc", |
| "test": "Scatter.RunTestWrapper<float>" |
| }, |
| "attrs": { "axis": 1 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [2, 3], |
| "data": { "kind": "values", "values": [0.0, 1.0, 2.0, 10.0, 11.0, 12.0] } |
| }, |
| "indices": { "dtype": "int32", "shape": [2, 2], "data": { "kind": "values", "values": [-1, 0, -2, -1] } }, |
| "updates": { |
| "dtype": "float32", |
| "shape": [2, 2], |
| "data": { "kind": "values", "values": [100.0, 101.0, 200.0, 201.0] } |
| } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [2, 3], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "ort_signed_negative_indices_last_axis_rank3", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/scatter_op_test.cc", |
| "test": "Scatter.RunTestWrapper<float>" |
| }, |
| "attrs": { "axis": -1 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [2, 2, 4], |
| "data": { |
| "kind": "values", |
| "values": [0.0, 1.0, 2.0, 3.0, 10.0, 11.0, 12.0, 13.0, 100.0, 101.0, 102.0, 103.0, 110.0, 111.0, 112.0, 113.0] |
| } |
| }, |
| "indices": { |
| "dtype": "int32", |
| "shape": [2, 2, 2], |
| "data": { "kind": "values", "values": [-1, 0, -2, -3, 0, -1, -4, 2] } |
| }, |
| "updates": { |
| "dtype": "float32", |
| "shape": [2, 2, 2], |
| "data": { "kind": "values", "values": [-1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0] } |
| } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [2, 2, 4], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "ort_rank5_default_axis_deterministic_subset", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/scatter_op_test.cc", |
| "test": "Scatter.RunTestWrapper<float>", |
| "notes": "Deterministic high-rank projection of ORT's default-axis Scatter coverage." |
| }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [2, 2, 1, 3, 1], |
| "data": { |
| "kind": "values", |
| "values": [0.0, 1.0, 2.0, 10.0, 11.0, 12.0, 100.0, 101.0, 102.0, 110.0, 111.0, 112.0] |
| } |
| }, |
| "indices": { |
| "dtype": "int32", |
| "shape": [2, 2, 1, 2, 1], |
| "data": { "kind": "values", "values": [0, 0, 0, 0, 1, 1, 1, 1] } |
| }, |
| "updates": { |
| "dtype": "float32", |
| "shape": [2, 2, 1, 2, 1], |
| "data": { "kind": "values", "values": [-10.0, -11.0, -12.0, -13.0, 200.0, 201.0, 202.0, 203.0] } |
| } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [2, 2, 1, 3, 1], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "ort_rank4_negative_last_axis_deterministic_subset", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/scatter_op_test.cc", |
| "test": "Scatter.RunTestWrapper<float>", |
| "notes": "Deterministic projection of ORT's negative-axis ScatterElements-style cases." |
| }, |
| "attrs": { "axis": -1 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [2, 2, 3, 2], |
| "data": { |
| "kind": "values", |
| "values": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 100.0, 101.0, 102.0, 103.0, 104.0, 105.0, 110.0, 111.0, 112.0, 113.0, 114.0, 115.0] |
| } |
| }, |
| "indices": { |
| "dtype": "int32", |
| "shape": [2, 2, 2, 2], |
| "data": { "kind": "values", "values": [0, -1, -1, 0, 0, -1, -1, 0, 0, -1, -1, 0, 0, -1, -1, 0] } |
| }, |
| "updates": { |
| "dtype": "float32", |
| "shape": [2, 2, 2, 2], |
| "data": { |
| "kind": "values", |
| "values": [-1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0, -9.0, -10.0, -11.0, -12.0, -13.0, -14.0, -15.0, -16.0] |
| } |
| } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [2, 2, 3, 2], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "onnx_backend_scatter_with_axis", |
| "attrs": { "axis": 1 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [1, 5], |
| "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0] } |
| }, |
| "indices": { "dtype": "int32", "shape": [1, 2], "data": { "kind": "values", "values": [1, 3] } }, |
| "updates": { |
| "dtype": "float32", |
| "shape": [1, 2], |
| "data": { "kind": "values", "values": [1.100000023841858, 2.0999999046325684] } |
| } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [1, 5] } }, |
| "provenance": { |
| "source": "cmake/external/onnx/onnx/backend/test/data/node/test_scatter_with_axis", |
| "notes": "ONNX int64 index values are adapted to supported int32 where representable." |
| } |
| }, |
| { |
| "name": "onnx_backend_scatter_without_axis", |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [3, 3], |
| "data": { "kind": "values", "values": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] } |
| }, |
| "indices": { "dtype": "int32", "shape": [2, 3], "data": { "kind": "values", "values": [1, 0, 2, 0, 2, 1] } }, |
| "updates": { |
| "dtype": "float32", |
| "shape": [2, 3], |
| "data": { |
| "kind": "values", |
| "values": [1.0, 1.100000023841858, 1.2000000476837158, 2.0, 2.0999999046325684, 2.200000047683716] |
| } |
| } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [3, 3] } }, |
| "provenance": { |
| "source": "cmake/external/onnx/onnx/backend/test/data/node/test_scatter_without_axis", |
| "notes": "ONNX int64 index values are adapted to supported int32 where representable." |
| } |
| }, |
| { |
| "name": "ort_int32_payload_axis1_exact_above_float24", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/scatter_op_test.cc", |
| "test": "Scatter.int32_t", |
| "notes": "Deterministic projection of ORT's int32 Scatter coverage using values above f32's exact integer range." |
| }, |
| "attrs": { "axis": 1 }, |
| "inputs": { |
| "data": { |
| "dtype": "int32", |
| "shape": [2, 3], |
| "data": { "kind": "values", "values": [16777217, -16777217, 42, 100, 200, -300] } |
| }, |
| "indices": { "dtype": "int32", "shape": [2, 2], "data": { "kind": "values", "values": [-1, 0, -2, -1] } }, |
| "updates": { |
| "dtype": "int32", |
| "shape": [2, 2], |
| "data": { "kind": "values", "values": [20000001, -20000001, 30000003, -30000003] } |
| } |
| }, |
| "outputs": { "output": { "dtype": "int32", "shape": [2, 3] } } |
| }, |
| { |
| "name": "ort_int16_axis1_replacement", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/scatter_op_test.cc", |
| "test": "Scatter.int16_t", |
| "notes": "Deterministic axis-1 replacement adapted from ORT's randomized int16 Scatter coverage." |
| }, |
| "attrs": { "axis": 1 }, |
| "inputs": { |
| "data": { "dtype": "int16", "shape": [2, 2], "data": { "kind": "values", "values": [0, 1, 2, 3] } }, |
| "indices": { "dtype": "int32", "shape": [2, 2], "data": { "kind": "values", "values": [1, 0, 0, 1] } }, |
| "updates": { "dtype": "int16", "shape": [2, 2], "data": { "kind": "values", "values": [9, 8, 7, 6] } } |
| }, |
| "outputs": { "output": { "dtype": "int16", "shape": [2, 2], "tolerance": 0 } } |
| }, |
| { |
| "name": "empty_updates_axis1_noop", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/scatter_nd_op_test.cc", |
| "test": "ScatterNDOpTest.ScatterND_empty_indices", |
| "notes": "Analogous Scatter no-op case: empty indices and updates leave data unchanged." |
| }, |
| "attrs": { "axis": 1 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [2, 3], |
| "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] } |
| }, |
| "indices": { "dtype": "int32", "shape": [2, 0], "data": { "kind": "values", "values": [] } }, |
| "updates": { "dtype": "float32", "shape": [2, 0], "data": { "kind": "values", "values": [] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [2, 3] } } |
| }, |
| { |
| "name": "axis1_multirow_f32_copy_update_path", |
| "attrs": { "axis": 1 }, |
| "provenance": { |
| "notes": "Compact sibling of the large axis-1 Scatter benchmark: many independent rows update a subset of columns while the untouched columns are copied through the generic replacement kernel. Indices are unique within each row to avoid duplicate-write ambiguity." |
| }, |
| "inputs": { |
| "data": { "dtype": "float32", "shape": [8, 16], "data": { "kind": "linspace", "start": -1.0, "end": 1.0 } }, |
| "indices": { |
| "dtype": "int32", |
| "shape": [8, 5], |
| "data": { |
| "kind": "values", |
| "values": [0, 3, 7, 11, 15, 1, 4, 8, 12, 14, 2, 5, 9, 13, 0, 3, 6, 10, 15, 1, 4, 7, 11, 14, 2, 5, 8, 12, 0, 3, 6, 9, 13, 15, 1, 4, 10, 12, 14, 2] |
| } |
| }, |
| "updates": { "dtype": "float32", "shape": [8, 5], "data": { "kind": "linspace", "start": 10.0, "end": 20.0 } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [8, 16], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "ort_bool_axis1_updates", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/scatter_op_test.cc", |
| "test": "Scatter.BoolInputWithAxis" |
| }, |
| "attrs": { "axis": 1 }, |
| "inputs": { |
| "data": { "dtype": "bool", "shape": [1, 5], "data": { "kind": "values", "values": [0, 0, 0, 1, 0] } }, |
| "indices": { "dtype": "int32", "shape": [1, 2], "data": { "kind": "values", "values": [1, 3] } }, |
| "updates": { "dtype": "bool", "shape": [1, 2], "data": { "kind": "values", "values": [1, 0] } } |
| }, |
| "outputs": { |
| "output": { "dtype": "bool", "shape": [1, 5], "data": { "kind": "values", "values": [0, 1, 0, 0, 0] } } |
| } |
| }, |
| { |
| "name": "bool_vec4_copy_axis1_numel_divisible_by_4", |
| "attrs": { "axis": 1 }, |
| "inputs": { |
| "data": { "dtype": "bool", "shape": [2, 4], "data": { "kind": "values", "values": [0, 1, 0, 1, 1, 0, 1, 0] } }, |
| "indices": { "dtype": "int32", "shape": [2, 2], "data": { "kind": "values", "values": [0, 3, 2, 1] } }, |
| "updates": { "dtype": "bool", "shape": [2, 2], "data": { "kind": "values", "values": [1, 0, 0, 1] } } |
| }, |
| "outputs": { |
| "output": { "dtype": "bool", "shape": [2, 4], "data": { "kind": "values", "values": [1, 1, 0, 0, 1, 1, 0, 0] } } |
| } |
| }, |
| { |
| "name": "int32_axis0_negative_index_boundary_axisDim1", |
| "attrs": { "axis": 0 }, |
| "inputs": { |
| "data": { "dtype": "int32", "shape": [1, 3], "data": { "kind": "values", "values": [10, 20, 30] } }, |
| "indices": { |
| "dtype": "int32", |
| "shape": [3, 3], |
| "data": { "kind": "values", "values": [-1, -2, -2, -2, -1, -2, -2, -2, -1] } |
| }, |
| "updates": { |
| "dtype": "int32", |
| "shape": [3, 3], |
| "data": { "kind": "values", "values": [99, 0, 0, 0, 44, 0, 0, 0, 66] } |
| } |
| }, |
| "outputs": { |
| "output": { "dtype": "int32", "shape": [1, 3], "data": { "kind": "values", "values": [99, 44, 66] } } |
| } |
| }, |
| { |
| "name": "rank8_default_axis_deterministic_subset", |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [2, 2, 1, 3, 1, 1, 2, 1], |
| "data": { "kind": "linspace", "start": 1.0, "end": 24.0 } |
| }, |
| "indices": { |
| "dtype": "int32", |
| "shape": [2, 2, 1, 2, 1, 1, 2, 1], |
| "data": { "kind": "values", "values": [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] } |
| }, |
| "updates": { |
| "dtype": "float32", |
| "shape": [2, 2, 1, 2, 1, 1, 2, 1], |
| "data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.29 } |
| } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [2, 2, 1, 3, 1, 1, 2, 1], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "ort_standard_int8_axis1_extremes", |
| "provenance": { |
| "source": "onnxruntime/core/providers/cpu/tensor/scatter.cc", |
| "notes": "Scatter-11 overwrite semantics are validated through ScatterElements; signed extrema guard the widened i32 payload route." |
| }, |
| "attrs": { "axis": 1 }, |
| "inputs": { |
| "data": { "dtype": "int8", "shape": [1, 4], "data": { "kind": "values", "values": [-128, -1, 127, 42] } }, |
| "indices": { "dtype": "int32", "shape": [1, 2], "data": { "kind": "values", "values": [1, 3] } }, |
| "updates": { "dtype": "int8", "shape": [1, 2], "data": { "kind": "values", "values": [64, -64] } } |
| }, |
| "outputs": { "output": { "dtype": "int8", "shape": [1, 4], "tolerance": 0 } } |
| }, |
| { |
| "name": "ort_standard_uint32_axis1_extremes", |
| "provenance": { |
| "source": "onnxruntime/core/providers/cpu/tensor/scatter.cc", |
| "notes": "Scatter-11 overwrite semantics are validated through ScatterElements; UINT32_MAX and values across the signed boundary lock exact u32 movement." |
| }, |
| "attrs": { "axis": 1 }, |
| "inputs": { |
| "data": { |
| "dtype": "uint32", |
| "shape": [1, 4], |
| "data": { "kind": "values", "values": [0, 4294967295, 16777217, 2147483648] } |
| }, |
| "indices": { "dtype": "int32", "shape": [1, 2], "data": { "kind": "values", "values": [1, 3] } }, |
| "updates": { "dtype": "uint32", "shape": [1, 2], "data": { "kind": "values", "values": [4000000000, 42] } } |
| }, |
| "outputs": { "output": { "dtype": "uint32", "shape": [1, 4], "tolerance": 0 } } |
| }, |
| { |
| "name": "ort_standard_uint8_axis1_extremes", |
| "provenance": { |
| "source": "onnxruntime/core/providers/cpu/tensor/scatter.cc", |
| "notes": "Scatter-11 overwrite semantics are validated through ScatterElements; UINT8_MAX and the signed boundary guard widened u32 storage." |
| }, |
| "attrs": { "axis": 1 }, |
| "inputs": { |
| "data": { "dtype": "uint8", "shape": [1, 4], "data": { "kind": "values", "values": [0, 255, 127, 128] } }, |
| "indices": { "dtype": "int32", "shape": [1, 2], "data": { "kind": "values", "values": [1, 3] } }, |
| "updates": { "dtype": "uint8", "shape": [1, 2], "data": { "kind": "values", "values": [254, 1] } } |
| }, |
| "outputs": { "output": { "dtype": "uint8", "shape": [1, 4], "tolerance": 0 } } |
| } |
| ] |
| } |
|
|