{ "op": "ai.onnx.Unique", "fixtureArrays": { "ort_axis1_unsorted_f32_input_x": [1, 1, 0, 1, 2, 1, 0, 1, 1, 1, 0, 1, 2, 1, 0, 1], "serial_sorted_dense_duplicates_int32_input_x": [37, -5, 12, 99, -73, 0, 41, 8, -21, 64, 3, -90, 55, 17, -2, 76, 29, -48, 83, 6, -33, 92, 14, -67, 50, 22, -9, 70, 35, -58, 88, 1, -26, 95, 19, -81, 46, 27, -14, 61, 33, -44, 79, 10, -39, 53, 24, -86], "axis0_f32_hash_sorted_duplicate_rows_input_x": [27.25, 46, -4.125, -24, 13.5, 27.5, -13.375, -32.125, 61.125, 25, -18.125, 21.625, 62.25, -35.75, -48.375, 47.125, -45, 13.25, 54.125, 37.875, 41.25, 4, -63.5, 50.75, -0.5, 12.125, -27.375, -7.75, -49.75, 20.25, 42.625, -59, 40.125, -40.25, -19.25, 6.25, 48.25, 28.625, 58.875, -61.25, -28.5, 20.5, -52, 15.75, 30.875, -56.5, -15.875, -0.75, -54.25, -31, 19.125, -42.5, -62.375, 44.875, -3, -42.75, -41.375, 6.5, -55.375, 2.875, -57.875, -46.125, -14.5, -6.375, -33.25, 35.625, -21.75, -8.875, -1.875, -36.875, 9.875, 55.25, -20.375, 5.125, 26.125, -25.125, 56.625, 63.625, 57.75, -49.5, -21.5, 11, -38, -60.125, -35.5, 14.625, -50.875, -47.25, -56.75, -14.75, 48.5, -28.75, -43.875, 60, 16.875, -29.875, -10, -34.375, 0.625, -22.875, 53, 49.625, 29.75, 34.25, -17, 39, 55.5, 18, 33.125, 43.75, -11.125, 32, 8.75, 23.875, 41.5, 36.75, 34.5, 7.625, -7.5, -53.125, 22.75, -5.25, -26.25, 1.75, 51.875, -39.125, 62.5, -12.25] }, "cases": [ { "name": "sorted_int32", "inputs": { "x": { "dtype": "int32", "shape": [8], "data": { "kind": "values", "values": [3, 1, 3, 2, 1, -1, 2, 4] } } }, "outputs": { "y": { "dtype": "int32", "shape": [5] } } }, { "name": "first_seen_uint8_overflow", "attrs": { "sorted": 0 }, "inputs": { "x": { "dtype": "uint8", "shape": [7], "data": { "kind": "values", "values": [5, 6, 5, 7, 8, 9, 10] } } }, "outputs": { "y": { "dtype": "uint8", "shape": [6] } } }, { "name": "sorted_f32", "inputs": { "x": { "dtype": "float32", "shape": [6], "data": { "kind": "values", "values": [2.5, -1.0, 2.5, 0.0, -1.0, 4.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [4] } } }, { "name": "f32_subnormal_distinct_from_zero", "provenance": { "source": "onnxruntime/test/providers/cpu/tensor/unique_op_test.cc", "test": "Unique.Flatten_Unsorted", "notes": "Subnormal finite values are distinct from zero and preserve first-seen order when sorted=0." }, "attrs": { "sorted": 0 }, "inputs": { "x": { "dtype": "float32", "shape": [5], "data": { "kind": "values", "values": [0.0, 1e-40, 0.0, -1e-40, 1e-40] } } }, "outputs": { "y": { "dtype": "float32", "shape": [3], "tolerance": 0, "data": { "kind": "values", "values": [0.0, 1e-40, -1e-40] } } } }, { "name": "f32_sorted_subnormal_distinct_from_zero", "provenance": { "source": "onnxruntime/test/providers/cpu/tensor/unique_op_test.cc", "test": "Unique.Flatten_Sorted", "notes": "Sorted Unique must keep negative subnormal, zero, and positive subnormal as distinct ordered buckets." }, "attrs": { "sorted": 1 }, "inputs": { "x": { "dtype": "float32", "shape": [5], "data": { "kind": "values", "values": [0.0, 1e-40, -1e-40, 0.0, 1e-40] } } }, "outputs": { "y": { "dtype": "float32", "shape": [3], "tolerance": 0, "data": { "kind": "values", "values": [-1e-40, 0.0, 1e-40] } } } }, { "name": "ort_unsorted_nan_equivalence", "provenance": { "source": "onnxruntime/test/providers/cpu/tensor/unique_op_test.cc", "test": "Unique.Flatten_Unsorted", "notes": "Additional ORT CPU probe: ordered-map lower_bound makes NaN comparator-equivalent to its candidate bucket at insertion, so later finite values still deduplicate normally." }, "attrs": { "sorted": 0 }, "inputs": { "x": { "dtype": "float32", "shape": [5], "data": { "kind": "values", "values": [2.0, "NaN", 2.0, "NaN", 3.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [2], "tolerance": 0, "data": { "kind": "values", "values": [2.0, 3.0] } } } }, { "name": "ort_backend_unsorted_first_seen_f32", "provenance": { "source": "onnxruntime/test/providers/cpu/tensor/unique_op_test.cc", "test": "Unique.Flatten_Unsorted_MatchOnnxTest" }, "attrs": { "sorted": 0 }, "inputs": { "x": { "dtype": "float32", "shape": [6], "data": { "kind": "values", "values": [2.0, 1.0, 1.0, 3.0, 4.0, 3.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [4], "tolerance": 0 } } }, { "name": "ort_flatten_unsorted_f32", "provenance": { "source": "onnxruntime/test/providers/cpu/tensor/unique_op_test.cc", "test": "Unique.Flatten_Unsorted" }, "attrs": { "sorted": 0 }, "inputs": { "x": { "dtype": "float32", "shape": [6], "data": { "kind": "values", "values": [1.0, 4.0, 1.0, 2.0, 2.0, 0.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [4], "tolerance": 0 } } }, { "name": "ort_flatten_sorted_f32", "provenance": { "source": "onnxruntime/test/providers/cpu/tensor/unique_op_test.cc", "test": "Unique.Flatten_Sorted" }, "attrs": { "sorted": 1 }, "inputs": { "x": { "dtype": "float32", "shape": [6], "data": { "kind": "values", "values": [1.0, 4.0, 1.0, 2.0, 2.0, 0.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [4], "tolerance": 0 } } }, { "name": "ort_empty_input_f32", "provenance": { "source": "onnxruntime/test/providers/cpu/tensor/unique_op_test.cc", "test": "Unique.EmptyInput" }, "inputs": { "x": { "dtype": "float32", "shape": [0], "data": { "kind": "values", "values": [] } } }, "outputs": { "y": { "dtype": "float32", "shape": [0], "tolerance": 0 } } }, { "name": "length1_f32_backend", "inputs": { "x": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [1], "tolerance": 0 } } }, { "name": "all_duplicates_exact_output", "attrs": { "sorted": 0 }, "inputs": { "x": { "dtype": "float32", "shape": [5], "data": { "kind": "values", "values": [-7.0, -7.0, -7.0, -7.0, -7.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [1], "tolerance": 0 } } }, { "name": "int8_signed_sorted_order", "inputs": { "x": { "dtype": "int8", "shape": [8], "data": { "kind": "values", "values": [3, -1, -128, 3, 127, -1, 0, -128] } } }, "outputs": { "y": { "dtype": "int8", "shape": [5], "tolerance": 0 } } }, { "name": "ort_no_optional_output_int8_sorted", "provenance": { "source": "onnxruntime/test/providers/cpu/tensor/unique_op_test.cc", "test": "Unique.NoOptionalOutput", "notes": "The fixture requests only Y, the standard required output, with its exact data-dependent shape." }, "inputs": { "x": { "dtype": "int8", "shape": [8], "data": { "kind": "values", "values": [1, 4, -1, 2, 2, 0, -1, 4] } } }, "outputs": { "y": { "dtype": "int8", "shape": [5], "tolerance": 0 } } }, { "name": "ort_axis0_unsorted_f32", "provenance": { "source": "onnxruntime/test/providers/cpu/tensor/unique_op_test.cc", "test": "Unique.Axis0_Unsorted", "notes": "The fixture supplies the exact data-dependent Y shape and requests no optional metadata outputs." }, "attrs": { "axis": 0, "sorted": 0 }, "inputs": { "x": { "dtype": "float32", "shape": [4, 2], "data": { "kind": "values", "values": [0.0, 1.0, 1.0, 1.0, 0.0, 1.0, 1.0, 0.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [3, 2], "tolerance": 0, "data": { "kind": "values", "values": [0.0, 1.0, 1.0, 1.0, 1.0, 0.0] } } } }, { "name": "ort_axis0_sorted_f32", "provenance": { "source": "onnxruntime/test/providers/cpu/tensor/unique_op_test.cc", "test": "Unique.Axis0_Sorted", "notes": "The fixture supplies the exact data-dependent Y shape and requests no optional metadata outputs." }, "attrs": { "axis": 0, "sorted": 1 }, "inputs": { "x": { "dtype": "float32", "shape": [4, 2], "data": { "kind": "values", "values": [0.0, 1.0, 1.0, 1.0, 0.0, 1.0, 1.0, 0.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [3, 2], "tolerance": 0, "data": { "kind": "values", "values": [0.0, 1.0, 1.0, 0.0, 1.0, 1.0] } } } }, { "name": "ort_axis1_unsorted_f32", "provenance": { "source": "onnxruntime/test/providers/cpu/tensor/unique_op_test.cc", "test": "Unique.Axis1_Unsorted", "notes": "The fixture supplies the exact data-dependent Y shape and requests no optional metadata outputs." }, "attrs": { "axis": 1, "sorted": 0 }, "inputs": { "x": { "dtype": "float32", "shape": [2, 4, 2], "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_axis1_unsorted_f32_input_x" } } } }, "outputs": { "y": { "dtype": "float32", "shape": [2, 3, 2], "tolerance": 0, "data": { "kind": "values", "values": [1.0, 1.0, 0.0, 1.0, 2.0, 1.0, 1.0, 1.0, 0.0, 1.0, 2.0, 1.0] } } } }, { "name": "ort_axis1_sorted_f32", "provenance": { "source": "onnxruntime/test/providers/cpu/tensor/unique_op_test.cc", "test": "Unique.Axis1_Sorted", "notes": "The fixture supplies the exact data-dependent Y shape and requests no optional metadata outputs." }, "attrs": { "axis": 1, "sorted": 1 }, "inputs": { "x": { "dtype": "float32", "shape": [2, 4, 2], "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_axis1_unsorted_f32_input_x" } } } }, "outputs": { "y": { "dtype": "float32", "shape": [2, 3, 2], "tolerance": 0, "data": { "kind": "values", "values": [0.0, 1.0, 1.0, 1.0, 2.0, 1.0, 0.0, 1.0, 1.0, 1.0, 2.0, 1.0] } } } }, { "name": "ort_axis2_unsorted_f32", "provenance": { "source": "onnxruntime/test/providers/cpu/tensor/unique_op_test.cc", "test": "Unique.Axis2_Unsorted", "notes": "The fixture supplies the exact data-dependent Y shape and requests no optional metadata outputs." }, "attrs": { "axis": 2, "sorted": 0 }, "inputs": { "x": { "dtype": "float32", "shape": [2, 2, 4], "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_axis1_unsorted_f32_input_x" } } } }, "outputs": { "y": { "dtype": "float32", "shape": [2, 2, 3], "tolerance": 0, "data": { "kind": "values", "values": [1.0, 1.0, 0.0, 2.0, 1.0, 0.0, 1.0, 1.0, 0.0, 2.0, 1.0, 0.0] } } } }, { "name": "ort_axis2_sorted_f32", "provenance": { "source": "onnxruntime/test/providers/cpu/tensor/unique_op_test.cc", "test": "Unique.Axis2_Sorted", "notes": "The fixture supplies the exact data-dependent Y shape and requests no optional metadata outputs." }, "attrs": { "axis": 2, "sorted": 1 }, "inputs": { "x": { "dtype": "float32", "shape": [2, 2, 4], "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_axis1_unsorted_f32_input_x" } } } }, "outputs": { "y": { "dtype": "float32", "shape": [2, 2, 3], "tolerance": 0, "data": { "kind": "values", "values": [0.0, 1.0, 1.0, 0.0, 1.0, 2.0, 0.0, 1.0, 1.0, 0.0, 1.0, 2.0] } } } }, { "name": "ort_negative_axis_last_sorted_f32", "provenance": { "source": "onnxruntime/test/providers/cpu/tensor/unique_op_test.cc", "test": "Unique.Axis2_Sorted", "notes": "Same semantic case as ORT's positive axis=2 coverage, expressed with the ONNX-valid negative last-axis spelling and an exact data-dependent Y shape." }, "attrs": { "axis": -1, "sorted": 1 }, "inputs": { "x": { "dtype": "float32", "shape": [2, 2, 4], "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_axis1_unsorted_f32_input_x" } } } }, "outputs": { "y": { "dtype": "float32", "shape": [2, 2, 3], "tolerance": 0, "data": { "kind": "values", "values": [0.0, 1.0, 1.0, 0.0, 1.0, 2.0, 0.0, 1.0, 1.0, 0.0, 1.0, 2.0] } } } }, { "name": "onnx_backend_unique_length_1", "attrs": { "sorted": 1 }, "inputs": { "x": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } } }, "outputs": { "y": { "dtype": "int32", "shape": [1] } }, "provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_unique_length_1", "notes": "The fixture supplies the exact data-dependent Y shape. Optional ONNX int64 metadata outputs are omitted here; requested metadata is represented as uint32 where values are representable." } }, { "name": "onnx_backend_unique_not_sorted_without_axis", "attrs": { "sorted": 0 }, "inputs": { "x": { "dtype": "float32", "shape": [6], "data": { "kind": "values", "values": [2.0, 1.0, 1.0, 3.0, 4.0, 3.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [4] } }, "provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_unique_not_sorted_without_axis", "notes": "The fixture supplies the exact data-dependent Y shape. Optional ONNX int64 metadata outputs are omitted here; requested metadata is represented as uint32 where values are representable." } }, { "name": "onnx_backend_unique_sorted_without_axis", "attrs": { "sorted": 1 }, "inputs": { "x": { "dtype": "float32", "shape": [6], "data": { "kind": "values", "values": [2.0, 1.0, 1.0, 3.0, 4.0, 3.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [4] } }, "provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_unique_sorted_without_axis", "notes": "The fixture supplies the exact data-dependent Y shape. Optional ONNX int64 metadata outputs are omitted here; requested metadata is represented as uint32 where values are representable." } }, { "name": "serial_sorted_dense_duplicates_int32", "provenance": { "notes": "2048 elements cycling 48 distinct values exercise the deduplication early exit and sorted exchange sort with an exact 48-element result." }, "inputs": { "x": { "dtype": "int32", "shape": [2048], "data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/serial_sorted_dense_duplicates_int32_input_x" } } } }, "outputs": { "y": { "dtype": "int32", "shape": [48], "tolerance": 0 } } }, { "name": "serial_first_seen_order_f32_1024", "attrs": { "sorted": 0 }, "provenance": { "notes": "First-seen order is preserved over 1024 elements with 32 distinct values and an exact 32-element result." }, "inputs": { "x": { "dtype": "float32", "shape": [1024], "data": { "kind": "cycle", "values": [0.5, -1.25, 3.0, 7.75, -0.5, 2.25, 9.0, -4.5, 1.5, 6.25, -8.0, 0.25, 5.5, -2.75, 4.0, 8.5, -6.25, 1.75, 7.25, -3.5, 2.5, 9.75, -0.75, 5.25, -7.5, 3.25, 6.75, -1.5, 4.75, 8.25, -5.75, 0.75] } } }, "outputs": { "y": { "dtype": "float32", "shape": [32], "tolerance": 0 } } }, { "name": "serial_f32_subnormal_distinct_from_zero", "attrs": { "sorted": 0 }, "provenance": { "source": "onnxruntime/test/providers/cpu/tensor/unique_op_test.cc", "test": "Unique.Flatten_Unsorted", "notes": "Large-input companion to the scalar subnormal case: the exact serial float comparator keeps finite subnormal values distinct from zero and emits three first-seen buckets." }, "inputs": { "x": { "dtype": "float32", "shape": [4096], "data": { "kind": "cycle", "values": [0.0, 1e-40, 0.0, -1e-40] } } }, "outputs": { "y": { "dtype": "float32", "shape": [3], "tolerance": 0, "data": { "kind": "values", "values": [0.0, 1e-40, -1e-40] } } } }, { "name": "serial_sorted_f32_32k_subnormal", "attrs": { "sorted": 1 }, "provenance": { "notes": "32768 f32 elements cycling six distinct values, including positive and negative subnormals, exercise the exact ordered-map float path at scale. Subnormals remain bit-distinct from zero and from each other, and sorted output uses the IEEE total-order key." }, "inputs": { "x": { "dtype": "float32", "shape": [32768], "data": { "kind": "cycle", "values": [0.0, 1e-40, -1e-40, 2.5, -3.5, 7.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [6], "tolerance": 0 } } }, { "name": "serial_unsorted_first_seen_f32_32k_subnormal", "attrs": { "sorted": 0 }, "provenance": { "notes": "First-seen-order companion for the exact serial float path: comparator-order buckets are reordered by representative input index for sorted=0." }, "inputs": { "x": { "dtype": "float32", "shape": [32768], "data": { "kind": "cycle", "values": [0.0, 1e-40, -1e-40, 2.5, -3.5, 7.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [6], "tolerance": 0 } } }, { "name": "serial_f32_32k_nan_lower_bound", "attrs": { "sorted": 0 }, "provenance": { "source": "onnxruntime/test/providers/cpu/tensor/unique_op_test.cc", "test": "Unique.Flatten_Unsorted", "notes": "NaN equivalence on the exact ordered-map float path at large input size: each NaN resolves to the lower-bound bucket headed by 2 and forms no new bucket." }, "inputs": { "x": { "dtype": "float32", "shape": [32768], "data": { "kind": "cycle", "values": [2.0, "NaN", 3.0, "NaN", 5.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [3], "tolerance": 0, "data": { "kind": "values", "values": [2.0, 3.0, 5.0] } } } }, { "name": "hash_sorted_int32_32k", "attrs": { "sorted": 1 }, "provenance": { "notes": "32768 int32 elements cycling 48 distinct values: exercises the hash-set parallel dedup (numel >= 32768 floor) for the sorted flatten path. Bit-exact vs the CPU reference." }, "inputs": { "x": { "dtype": "int32", "shape": [32768], "data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/serial_sorted_dense_duplicates_int32_input_x" } } } }, "outputs": { "y": { "dtype": "int32", "shape": [48], "tolerance": 0 } } }, { "name": "hash_unsorted_first_seen_int32_32k", "attrs": { "sorted": 0 }, "provenance": { "notes": "32768 int32 elements cycling 48 distinct values, first-seen order: the hash dedup folds in atomicMin(index), so the compacted order matches the appearance order of the parallel/serial paths exactly." }, "inputs": { "x": { "dtype": "int32", "shape": [32768], "data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/serial_sorted_dense_duplicates_int32_input_x" } } } }, "outputs": { "y": { "dtype": "int32", "shape": [48], "tolerance": 0 } } }, { "name": "hash_sentinel_value_minus_one_int32_64k", "attrs": { "sorted": 1 }, "provenance": { "notes": "65536 int32 elements whose distinct set includes -1 (bitcast == 0xffffffff, the hash table's EMPTY sentinel). Exercises the dedicated `special` min-index slot the hash dedup uses for the one value that cannot be a hash key." }, "inputs": { "x": { "dtype": "int32", "shape": [65536], "data": { "kind": "cycle", "values": [-1, 7, -1, 3, 100, -50, -1, 42, 7, 3, -2147483648, 2147483647, 0, -1, 13, 100] } } }, "outputs": { "y": { "dtype": "int32", "shape": [10], "tolerance": 0 } } }, { "name": "hash_uint8_sorted_32k", "attrs": { "sorted": 1 }, "provenance": { "notes": "32768 uint8 elements cycling 12 distinct values: exercises the hash dedup's unsigned-key path (dtypes.T == u32 carried width) at the >= 32768 floor." }, "inputs": { "x": { "dtype": "uint8", "shape": [32768], "data": { "kind": "cycle", "values": [5, 200, 17, 5, 255, 0, 128, 17, 64, 200, 3, 250, 0, 5] } } }, "outputs": { "y": { "dtype": "uint8", "shape": [9], "tolerance": 0 } } }, { "name": "hash_uint32_few_distinct_64k", "attrs": { "sorted": 1 }, "provenance": { "notes": "65536 uint32 elements with only 6 distinct values (heavy duplicates) including 0xffffffff (the EMPTY sentinel): few-distinct stress for the hash dedup atomicMin contention plus the unsigned special-slot path." }, "inputs": { "x": { "dtype": "uint32", "shape": [65536], "data": { "kind": "cycle", "values": [4294967295, 0, 7, 4294967295, 1000000, 42, 7, 0] } } }, "outputs": { "y": { "dtype": "uint32", "shape": [5], "tolerance": 0 } } }, { "name": "axis0_f32_subnormal_collapse_unsorted", "attrs": { "axis": 0, "sorted": 0 }, "provenance": { "notes": "Spec-valid axis-mode deduplication over a [N,2] tensor. Raw-bit float comparisons keep finite subnormals distinct from zero even on FTZ GPUs; the pinned output is cross-checked with ORT." }, "inputs": { "x": { "dtype": "float32", "shape": [5, 2], "data": { "kind": "values", "values": [0.0, 5.0, 1e-40, 5.0, -1e-40, 5.0, 0.0, 5.0, 2.0, 7.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [4, 2], "tolerance": 0, "data": { "kind": "values", "values": [0.0, 5.0, 1e-40, 5.0, -1e-40, 5.0, 2.0, 7.0] } } } }, { "name": "axis0_f32_subnormal_collapse_sorted", "attrs": { "axis": 0, "sorted": 1 }, "provenance": { "notes": "Sorted companion to the subnormal axis case. Raw-bit equality and total-order keys preserve -1e-40 < 0 < 1e-40 on FTZ GPUs; the pinned output is cross-checked with ORT." }, "inputs": { "x": { "dtype": "float32", "shape": [5, 2], "data": { "kind": "values", "values": [0.0, 5.0, 1e-40, 5.0, -1e-40, 5.0, 0.0, 5.0, 2.0, 7.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [4, 2], "tolerance": 0, "data": { "kind": "values", "values": [-1e-40, 5.0, 0.0, 5.0, 1e-40, 5.0, 2.0, 7.0] } } } }, { "name": "hash_int8_signed_negatives_32k", "attrs": { "sorted": 1 }, "provenance": { "notes": "Exercises hash deduplication at 32768 elements with 12 signed int8 values, including -128, 127, and other negatives. The TypeScript reference is the oracle because ORT CPU does not implement Unique for int8." }, "inputs": { "x": { "dtype": "int8", "shape": [32768], "data": { "kind": "cycle", "values": [5, -1, -128, 3, 127, -1, 0, -128, 42, -64, 100, -100, 7, 17] } } }, "outputs": { "y": { "dtype": "int8", "shape": [12], "tolerance": 0 } } }, { "name": "parallel_uint32_sentinel_first_seen_4k", "attrs": { "sorted": 0 }, "provenance": { "notes": "Exercises grid-parallel deduplication below the hash threshold with 0xffffffff present in first-seen order. The TypeScript reference is the oracle because ORT CPU does not implement Unique for uint32." }, "inputs": { "x": { "dtype": "uint32", "shape": [4096], "data": { "kind": "cycle", "values": [4294967295, 0, 7, 1000000, 4294967295, 42, 0, 13, 7, 999] } } }, "outputs": { "y": { "dtype": "uint32", "shape": [7], "tolerance": 0 } } }, { "name": "flat_f32_all_distinct_4096", "provenance": { "notes": "4096 fully distinct values exercise the exact large-output serial float path and its ordered representative set." }, "attrs": { "sorted": 1 }, "inputs": { "x": { "dtype": "float32", "shape": [4096], "data": { "kind": "linspace", "start": -4096.0, "end": 4095.0 } } }, "outputs": { "y": { "dtype": "float32", "shape": [4096], "tolerance": 0 } } }, { "name": "axis0_f32_all_distinct_2500", "provenance": { "notes": "2500 fully distinct scalar rows exercise exact axis-mode output and bit-preserving slice comparison at a large axis size." }, "attrs": { "axis": 0, "sorted": 1 }, "inputs": { "x": { "dtype": "float32", "shape": [2500, 1], "data": { "kind": "linspace", "start": -5000.0, "end": 4999.0 } } }, "outputs": { "y": { "dtype": "float32", "shape": [2500, 1], "tolerance": 0 } } }, { "name": "serial_f32_32k_signed_zero_single_bucket", "provenance": { "notes": "32768 f32 elements containing both +0.0 and -0.0 plus finite values verify that exact serial equality canonicalizes signed zero into one bucket, matching ORT." }, "attrs": { "sorted": 1 }, "inputs": { "x": { "dtype": "float32", "shape": [32768], "data": { "kind": "cycle", "values": [0.0, 0.0, 2.5, -3.5, 7.0, 0.0, 0.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [4], "tolerance": 0 } } }, { "name": "large_y_int32_sorted_2501_distinct", "provenance": { "notes": "6000 int32 values deduplicate to an exact 2501-element sorted result, exercising the large-output global-scratch sort and signed integer order across zero." }, "attrs": { "sorted": 1 }, "inputs": { "x": { "dtype": "int32", "shape": [6000], "data": { "kind": "linspace", "start": -1200, "end": 1300 } } }, "outputs": { "y": { "dtype": "int32", "shape": [2501] } } }, { "name": "large_y_int32_unsorted_8192_distinct", "provenance": { "notes": "8192 distinct int32 values exercise the large-output unsorted compaction path without allocating or touching bitonic-sort scratch." }, "attrs": { "sorted": 0 }, "inputs": { "x": { "dtype": "int32", "shape": [8192], "data": { "kind": "linspace", "start": -4096, "end": 4095 } } }, "outputs": { "y": { "dtype": "int32", "shape": [8192] } } }, { "name": "f32_sorted_padding_heavy", "provenance": { "notes": "A padding-heavy sorted float case with about 40 distinct values verifies max-key padding and raw-bit float ordering, including negatives and signed zero." }, "attrs": { "sorted": 1 }, "inputs": { "x": { "dtype": "float32", "shape": [400], "data": { "kind": "cycle", "values": [3.5, -1.0, 0.0, 2.5, -7.25, 100.0, -100.0, 0.5, -0.5, 42.0, -42.0, 1.0, -1.5, 88.75, -88.75, 6.0, -6.0, 13.5, -13.5, 21.0, -21.0, 7.0, -7.0, 55.5, -55.5, 9.0, -9.0, 64.25, -64.25, 4.0, -4.0, 17.0, -17.0, 30.0, -30.0, 2.0, -2.0, 11.0, -11.0, 99.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [40] } } }, { "name": "uint32_sorted_unsigned_order", "provenance": { "notes": "The exact 30-element result spans values above 2^31 through 0xffffffff and verifies unsigned ordering rather than a signed interpretation of raw bits." }, "attrs": { "sorted": 1 }, "inputs": { "x": { "dtype": "uint32", "shape": [300], "data": { "kind": "cycle", "values": [10, 4000000000, 5, 2147483648, 0, 3000000000, 100, 2147483647, 42, 4294967295, 7, 1, 2500000000, 99, 2147483649, 3, 500, 4000000001, 8, 2, 123456, 4294967294, 55, 2147483650, 9, 777, 3500000000, 6, 4, 1000000] } } }, "outputs": { "y": { "dtype": "uint32", "shape": [30] } } }, { "name": "int32_unsorted_first_occurrence", "provenance": { "notes": "The exact 30-element unsorted result preserves first-occurrence order while round-tripping signed int32 values through raw-bit scratch." }, "attrs": { "sorted": 0 }, "inputs": { "x": { "dtype": "int32", "shape": [300], "data": { "kind": "cycle", "values": [37, -5, 12, 99, -73, 0, 41, 8, -21, 64, 3, -90, 55, 17, -2, 76, 29, -48, 83, 6, -33, 92, 14, -67, 50, 22, -9, 70, 35, -58] } } }, "outputs": { "y": { "dtype": "int32", "shape": [30] } } }, { "name": "axis0_large_y_f32_sorted_2200_distinct", "provenance": { "notes": "The exact serial float axis path handles 2200 distinct scalar slices with its representative order in global storage. This keeps float behavior aligned with ORT's non-transitive NaN comparator without exceeding workgroup-storage limits." }, "attrs": { "axis": 0, "sorted": 1 }, "inputs": { "x": { "dtype": "float32", "shape": [2200, 1], "data": { "kind": "linspace", "start": -500.0, "end": 500.0 } } }, "outputs": { "y": { "dtype": "float32", "shape": [2200, 1] } } }, { "name": "axis0_large_y_int32_unsorted_2100_distinct", "provenance": { "notes": "axis=0 output axis dim 2100 > 2048 with sorted=0 selects axis_bounded_large's no-bitonic branch: parallel compaction gathers the first-occurrence slice indices in appearance order and scatters them from GLOBAL slots scratch, skipping the sort network. inner=1 so flat-unique == axis-unique (reference exact). Validates the unsorted large-axis path at multi-chunk scale against the single-lane unique-axis kernel." }, "attrs": { "axis": 0, "sorted": 0 }, "inputs": { "x": { "dtype": "int32", "shape": [2100, 1], "data": { "kind": "linspace", "start": -4000, "end": 4000 } } }, "outputs": { "y": { "dtype": "int32", "shape": [2100, 1] } } }, { "name": "axis_hash_split_scatter_sorted_all_distinct", "provenance": { "notes": "The hash-backed axis path compacts, sorts, and scatters all 4096 distinct scalar rows into the exact output shape." }, "attrs": { "axis": 0, "sorted": 1 }, "inputs": { "x": { "dtype": "int32", "shape": [4096, 1], "data": { "kind": "linspace", "start": -2048, "end": 2047 } } }, "outputs": { "y": { "dtype": "int32", "shape": [4096, 1], "tolerance": 0 } } }, { "name": "axis_hash_split_scatter_unsorted_four_distinct", "provenance": { "notes": "Unsorted companion for grid-parallel axis scatter: four distinct scalar rows are emitted in first-occurrence order into an exact four-row output." }, "attrs": { "axis": 0, "sorted": 0 }, "inputs": { "x": { "dtype": "int32", "shape": [2048, 1], "data": { "kind": "cycle", "values": [9, -2, 7, 9, 42, -2] } } }, "outputs": { "y": { "dtype": "int32", "shape": [4, 1], "tolerance": 0 } } }, { "name": "axis_hash_int32_inner2_duplicate_rows_sorted", "provenance": { "notes": "Routes the >=2048-axis exact hash dedup with vector-valued slices. Repeated rows must share one hash bucket, first-occurrence representatives must survive, and sorted output remains lexicographic over the complete two-element slice. Pinned values avoid relying on the flattened TypeScript Unique reference for axis semantics." }, "attrs": { "axis": 0, "sorted": 1 }, "inputs": { "x": { "dtype": "int32", "shape": [2048, 2], "data": { "kind": "cycle", "values": [2, 1, 0, 3, 2, 1, -1, 4] } } }, "outputs": { "y": { "dtype": "int32", "shape": [3, 2], "tolerance": 0, "data": { "kind": "values", "values": [-1, 4, 0, 3, 2, 1] } } } }, { "name": "hash_int32_sorted_16_distinct", "provenance": { "notes": "A 32768-element input with 16 distinct signed values exercises hash-backed compaction and sorting with an exact result." }, "attrs": { "sorted": 1 }, "inputs": { "x": { "dtype": "int32", "shape": [32768], "data": { "kind": "cycle", "values": [37, -5, 12, 99, -73, 0, 41, 8, -21, 64, 3, -90, 55, 17, -2, 76] } } }, "outputs": { "y": { "dtype": "int32", "shape": [16] } } }, { "name": "hash_int32_sorted_16k_4096_distinct", "provenance": { "notes": "A 16K-element input with exactly 4096 distinct integers exercises the narrow int32 large-output hash threshold and signed sorting." }, "attrs": { "sorted": 1 }, "inputs": { "x": { "dtype": "int32", "shape": [16384], "data": { "kind": "linspace", "start": 0, "end": 4095 } } }, "outputs": { "y": { "dtype": "int32", "shape": [4096] } } }, { "name": "exact_output_33_unsorted_f32_serial", "provenance": { "notes": "Thirty-three distinct float values exercise exact-output first-occurrence ordering on the serial float path." }, "attrs": { "sorted": 0 }, "inputs": { "x": { "dtype": "float32", "shape": [33], "data": { "kind": "linspace", "start": -16.0, "end": 16.0 } } }, "outputs": { "y": { "dtype": "float32", "shape": [33], "tolerance": 0 } } }, { "name": "rank7_axis_last", "attrs": { "axis": 6, "sorted": 1 }, "inputs": { "x": { "dtype": "float32", "shape": [1, 2, 1, 2, 1, 2, 4], "data": { "kind": "constant", "value": 3.0 } } }, "outputs": { "y": { "dtype": "float32", "shape": [1, 2, 1, 2, 1, 2, 1], "tolerance": 0 } } }, { "name": "axis0_y1025_storage_order_serial", "provenance": { "notes": "A 1025-row exact float output exercises axis_serial with storage-backed representative order, so its capacity is independent of maxComputeWorkgroupStorageSize." }, "attrs": { "axis": 0, "sorted": 1 }, "inputs": { "x": { "dtype": "float32", "shape": [1025, 1], "data": { "kind": "linspace", "start": -1024.0, "end": 1024.0 } } }, "outputs": { "y": { "dtype": "float32", "shape": [1025, 1], "tolerance": 0 } } }, { "name": "axis0_rows65537_over_hash_ceiling_large_y", "provenance": { "notes": "65537 rows exceed the axis hash-table ceiling, while exactly 2049 distinct rows keep the output above the local crossover; this selects the global axis fallback with an exact result." }, "attrs": { "axis": 0, "sorted": 1 }, "inputs": { "x": { "dtype": "int32", "shape": [65537, 1], "data": { "kind": "linspace", "start": 0, "end": 2048 } } }, "outputs": { "y": { "dtype": "int32", "shape": [2049, 1], "tolerance": 0 } } }, { "name": "rank8_axis_last", "attrs": { "axis": 7, "sorted": 1 }, "inputs": { "x": { "dtype": "float32", "shape": [1, 2, 1, 2, 1, 2, 2, 4], "data": { "kind": "cycle", "values": [1.0, 2.0, 3.0, 1.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [1, 2, 1, 2, 1, 2, 2, 3], "tolerance": 0 } } }, { "name": "axis0_uint32_sorted_order", "provenance": { "source": "https://onnx.ai/onnx/operators/onnx__Unique.html", "notes": "Exercises unsigned slice ordering through the bounded parallel axis compaction path, including values above int32 range." }, "attrs": { "axis": 0, "sorted": 1 }, "inputs": { "x": { "dtype": "uint32", "shape": [6, 1], "data": { "kind": "values", "values": [4000000000, 5, 2147483648, 5, 0, 4000000000] } } }, "outputs": { "y": { "dtype": "uint32", "shape": [4, 1], "tolerance": 0, "data": { "kind": "values", "values": [0, 5, 2147483648, 4000000000] } } } }, { "name": "axis_empty_y_only", "provenance": { "source": "https://onnx.ai/onnx/operators/onnx__Unique.html", "notes": "An empty selected axis has zero unique slices and therefore a legal zero-sized Y axis." }, "attrs": { "axis": 0, "sorted": 1 }, "inputs": { "x": { "dtype": "int32", "shape": [0, 2], "data": { "kind": "values", "values": [] } } }, "outputs": { "y": { "dtype": "int32", "shape": [0, 2], "tolerance": 0 } } }, { "name": "axis_empty_all_metadata", "provenance": { "source": "https://onnx.ai/onnx/operators/onnx__Unique.html", "notes": "Zero-length axis mode requests every standard optional metadata output with its exact empty shape." }, "attrs": { "axis": 1, "sorted": 0 }, "inputs": { "x": { "dtype": "int32", "shape": [2, 0, 3], "data": { "kind": "values", "values": [] } } }, "outputs": { "y": { "dtype": "int32", "shape": [2, 0, 3], "tolerance": 0 }, "indices": { "dtype": "uint32", "shape": [0], "tolerance": 0, "data": { "kind": "values", "values": [] } }, "inverse_indices": { "dtype": "uint32", "shape": [0], "tolerance": 0, "data": { "kind": "values", "values": [] } }, "counts": { "dtype": "uint32", "shape": [0], "tolerance": 0, "data": { "kind": "values", "values": [] } } } }, { "name": "axis_nan_ordered_map_unsorted_all_metadata", "provenance": { "source": "onnxruntime/core/providers/cpu/tensor/unique.cc", "notes": "ORT's ordered slice comparator stops at the first unequal coordinate. A NaN there makes the key equivalent to the lower-bound bucket and ignores the remaining suffix." }, "attrs": { "axis": 0, "sorted": 0 }, "inputs": { "x": { "dtype": "float32", "shape": [4, 2], "data": { "kind": "values", "values": [5.0, 0.0, 1.0, 0.0, "NaN", 9.0, 3.0, 0.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [3, 2], "tolerance": 0, "data": { "kind": "values", "values": [5.0, 0.0, 1.0, 0.0, 3.0, 0.0] } }, "indices": { "dtype": "uint32", "shape": [3], "tolerance": 0, "data": { "kind": "values", "values": [0, 1, 3] } }, "inverse_indices": { "dtype": "uint32", "shape": [4], "tolerance": 0, "data": { "kind": "values", "values": [0, 1, 1, 2] } }, "counts": { "dtype": "uint32", "shape": [3], "tolerance": 0, "data": { "kind": "values", "values": [1, 2, 1] } } } }, { "name": "axis_nan_ordered_map_sorted_all_metadata", "provenance": { "source": "onnxruntime/core/providers/cpu/tensor/unique.cc", "notes": "The same NaN lower-bound equivalence is retained while sorted output follows the ordered map's comparator order." }, "attrs": { "axis": 0, "sorted": 1 }, "inputs": { "x": { "dtype": "float32", "shape": [4, 2], "data": { "kind": "values", "values": [5.0, 0.0, 1.0, 0.0, "NaN", 9.0, 3.0, 0.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [3, 2], "tolerance": 0, "data": { "kind": "values", "values": [1.0, 0.0, 3.0, 0.0, 5.0, 0.0] } }, "indices": { "dtype": "uint32", "shape": [3], "tolerance": 0, "data": { "kind": "values", "values": [1, 3, 0] } }, "inverse_indices": { "dtype": "uint32", "shape": [4], "tolerance": 0, "data": { "kind": "values", "values": [2, 0, 0, 1] } }, "counts": { "dtype": "uint32", "shape": [3], "tolerance": 0, "data": { "kind": "values", "values": [2, 1, 1] } } } }, { "name": "flat_nan_ordered_map_unsorted_all_metadata", "provenance": { "source": "onnxruntime/core/providers/cpu/tensor/unique.cc", "notes": "Flat Unique uses the same stateful lower_bound rule: NaN maps to the smallest bucket present at its insertion point, not unconditionally to output bucket zero." }, "attrs": { "sorted": 0 }, "inputs": { "x": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [5.0, 1.0, "NaN", 3.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [3], "tolerance": 0, "data": { "kind": "values", "values": [5.0, 1.0, 3.0] } }, "indices": { "dtype": "uint32", "shape": [3], "tolerance": 0, "data": { "kind": "values", "values": [0, 1, 3] } }, "inverse_indices": { "dtype": "uint32", "shape": [4], "tolerance": 0, "data": { "kind": "values", "values": [0, 1, 1, 2] } }, "counts": { "dtype": "uint32", "shape": [3], "tolerance": 0, "data": { "kind": "values", "values": [1, 2, 1] } } } }, { "name": "flat_nan_ordered_map_sorted_all_metadata", "provenance": { "source": "onnxruntime/core/providers/cpu/tensor/unique.cc", "notes": "Sorted flat output keeps the ordered-map bucket accounting while emitting comparator order." }, "attrs": { "sorted": 1 }, "inputs": { "x": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [5.0, 1.0, "NaN", 3.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [3], "tolerance": 0, "data": { "kind": "values", "values": [1.0, 3.0, 5.0] } }, "indices": { "dtype": "uint32", "shape": [3], "tolerance": 0, "data": { "kind": "values", "values": [1, 3, 0] } }, "inverse_indices": { "dtype": "uint32", "shape": [4], "tolerance": 0, "data": { "kind": "values", "values": [2, 0, 0, 1] } }, "counts": { "dtype": "uint32", "shape": [3], "tolerance": 0, "data": { "kind": "values", "values": [2, 1, 1] } } } }, { "name": "flat_nan_ordered_map_insertion_state_all_metadata", "provenance": { "source": "onnxruntime/core/providers/cpu/tensor/unique.cc", "notes": "With NaN inserted before the later minimum, lower_bound associates it with 5 rather than retroactively moving it to the later 1 bucket." }, "attrs": { "sorted": 0 }, "inputs": { "x": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [5.0, "NaN", 1.0, 3.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [3], "tolerance": 0, "data": { "kind": "values", "values": [5.0, 1.0, 3.0] } }, "indices": { "dtype": "uint32", "shape": [3], "tolerance": 0, "data": { "kind": "values", "values": [0, 2, 3] } }, "inverse_indices": { "dtype": "uint32", "shape": [4], "tolerance": 0, "data": { "kind": "values", "values": [0, 0, 1, 2] } }, "counts": { "dtype": "uint32", "shape": [3], "tolerance": 0, "data": { "kind": "values", "values": [2, 1, 1] } } } }, { "name": "metadata_flat_all_int32", "provenance": { "source": "https://onnx.ai/onnx/operators/onnx__Unique.html", "notes": "Exercises every optional output on the non-float flattened comparator path." }, "attrs": { "sorted": 1 }, "inputs": { "x": { "dtype": "int32", "shape": [5], "data": { "kind": "values", "values": [3, 1, 3, 2, 1] } } }, "outputs": { "y": { "dtype": "int32", "shape": [3], "tolerance": 0, "data": { "kind": "values", "values": [1, 2, 3] } }, "indices": { "dtype": "uint32", "shape": [3], "tolerance": 0, "data": { "kind": "values", "values": [1, 3, 0] } }, "inverse_indices": { "dtype": "uint32", "shape": [5], "tolerance": 0, "data": { "kind": "values", "values": [2, 0, 2, 1, 0] } }, "counts": { "dtype": "uint32", "shape": [3], "tolerance": 0, "data": { "kind": "values", "values": [2, 1, 2] } } } }, { "name": "metadata_flat_indices_nd_input", "provenance": { "source": "https://onnx.ai/onnx/operators/onnx__Unique.html", "notes": "Exercises the requested standard optional output combination while flattening an N-D input." }, "attrs": { "sorted": 0 }, "inputs": { "x": { "dtype": "float32", "shape": [2, 3], "data": { "kind": "values", "values": [2.0, 1.0, 1.0, 3.0, 4.0, 3.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [4] }, "indices": { "dtype": "uint32", "shape": [4], "tolerance": 0 } } }, { "name": "metadata_axis_negative_indices", "provenance": { "source": "https://onnx.ai/onnx/operators/onnx__Unique.html", "notes": "Exercises the requested standard optional output combination and normalizes axis=-2 to axis 0 for a rank-2 input." }, "attrs": { "axis": -2, "sorted": 1 }, "inputs": { "x": { "dtype": "float32", "shape": [3, 3], "data": { "kind": "values", "values": [1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 2.0, 3.0, 4.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [2, 3] }, "indices": { "dtype": "uint32", "shape": [2], "tolerance": 0 } } }, { "name": "metadata_flat_inverse_nd_input", "provenance": { "source": "https://onnx.ai/onnx/operators/onnx__Unique.html", "notes": "Exercises the requested standard optional output combination while flattening an N-D input." }, "attrs": { "sorted": 0 }, "inputs": { "x": { "dtype": "float32", "shape": [2, 3], "data": { "kind": "values", "values": [2.0, 1.0, 1.0, 3.0, 4.0, 3.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [4] }, "inverse_indices": { "dtype": "uint32", "shape": [6], "tolerance": 0 } } }, { "name": "metadata_axis_negative_inverse", "provenance": { "source": "https://onnx.ai/onnx/operators/onnx__Unique.html", "notes": "Exercises the requested standard optional output combination and normalizes axis=-2 to axis 0 for a rank-2 input." }, "attrs": { "axis": -2, "sorted": 1 }, "inputs": { "x": { "dtype": "float32", "shape": [3, 3], "data": { "kind": "values", "values": [1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 2.0, 3.0, 4.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [2, 3] }, "inverse_indices": { "dtype": "uint32", "shape": [3], "tolerance": 0 } } }, { "name": "metadata_flat_counts_nd_input", "provenance": { "source": "https://onnx.ai/onnx/operators/onnx__Unique.html", "notes": "Exercises the requested standard optional output combination while flattening an N-D input." }, "attrs": { "sorted": 0 }, "inputs": { "x": { "dtype": "float32", "shape": [2, 3], "data": { "kind": "values", "values": [2.0, 1.0, 1.0, 3.0, 4.0, 3.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [4] }, "counts": { "dtype": "uint32", "shape": [4], "tolerance": 0 } } }, { "name": "metadata_axis_negative_counts", "provenance": { "source": "https://onnx.ai/onnx/operators/onnx__Unique.html", "notes": "Exercises the requested standard optional output combination and normalizes axis=-2 to axis 0 for a rank-2 input." }, "attrs": { "axis": -2, "sorted": 1 }, "inputs": { "x": { "dtype": "float32", "shape": [3, 3], "data": { "kind": "values", "values": [1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 2.0, 3.0, 4.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [2, 3] }, "counts": { "dtype": "uint32", "shape": [2], "tolerance": 0 } } }, { "name": "metadata_flat_indices_inverse_nd_input", "provenance": { "source": "https://onnx.ai/onnx/operators/onnx__Unique.html", "notes": "Exercises the requested standard optional output combination while flattening an N-D input." }, "attrs": { "sorted": 0 }, "inputs": { "x": { "dtype": "float32", "shape": [2, 3], "data": { "kind": "values", "values": [2.0, 1.0, 1.0, 3.0, 4.0, 3.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [4] }, "indices": { "dtype": "uint32", "shape": [4], "tolerance": 0 }, "inverse_indices": { "dtype": "uint32", "shape": [6], "tolerance": 0 } } }, { "name": "metadata_axis_negative_indices_inverse", "provenance": { "source": "https://onnx.ai/onnx/operators/onnx__Unique.html", "notes": "Exercises the requested standard optional output combination and normalizes axis=-2 to axis 0 for a rank-2 input." }, "attrs": { "axis": -2, "sorted": 1 }, "inputs": { "x": { "dtype": "float32", "shape": [3, 3], "data": { "kind": "values", "values": [1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 2.0, 3.0, 4.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [2, 3] }, "indices": { "dtype": "uint32", "shape": [2], "tolerance": 0 }, "inverse_indices": { "dtype": "uint32", "shape": [3], "tolerance": 0 } } }, { "name": "metadata_flat_indices_counts_nd_input", "provenance": { "source": "https://onnx.ai/onnx/operators/onnx__Unique.html", "notes": "Exercises the requested standard optional output combination while flattening an N-D input." }, "attrs": { "sorted": 0 }, "inputs": { "x": { "dtype": "float32", "shape": [2, 3], "data": { "kind": "values", "values": [2.0, 1.0, 1.0, 3.0, 4.0, 3.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [4] }, "indices": { "dtype": "uint32", "shape": [4], "tolerance": 0 }, "counts": { "dtype": "uint32", "shape": [4], "tolerance": 0 } } }, { "name": "metadata_axis_negative_indices_counts", "provenance": { "source": "https://onnx.ai/onnx/operators/onnx__Unique.html", "notes": "Exercises the requested standard optional output combination and normalizes axis=-2 to axis 0 for a rank-2 input." }, "attrs": { "axis": -2, "sorted": 1 }, "inputs": { "x": { "dtype": "float32", "shape": [3, 3], "data": { "kind": "values", "values": [1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 2.0, 3.0, 4.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [2, 3] }, "indices": { "dtype": "uint32", "shape": [2], "tolerance": 0 }, "counts": { "dtype": "uint32", "shape": [2], "tolerance": 0 } } }, { "name": "metadata_flat_inverse_counts_nd_input", "provenance": { "source": "https://onnx.ai/onnx/operators/onnx__Unique.html", "notes": "Exercises the requested standard optional output combination while flattening an N-D input." }, "attrs": { "sorted": 0 }, "inputs": { "x": { "dtype": "float32", "shape": [2, 3], "data": { "kind": "values", "values": [2.0, 1.0, 1.0, 3.0, 4.0, 3.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [4] }, "inverse_indices": { "dtype": "uint32", "shape": [6], "tolerance": 0 }, "counts": { "dtype": "uint32", "shape": [4], "tolerance": 0 } } }, { "name": "metadata_axis_negative_inverse_counts", "provenance": { "source": "https://onnx.ai/onnx/operators/onnx__Unique.html", "notes": "Exercises the requested standard optional output combination and normalizes axis=-2 to axis 0 for a rank-2 input." }, "attrs": { "axis": -2, "sorted": 1 }, "inputs": { "x": { "dtype": "float32", "shape": [3, 3], "data": { "kind": "values", "values": [1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 2.0, 3.0, 4.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [2, 3] }, "inverse_indices": { "dtype": "uint32", "shape": [3], "tolerance": 0 }, "counts": { "dtype": "uint32", "shape": [2], "tolerance": 0 } } }, { "name": "metadata_flat_all_nd_input", "provenance": { "source": "https://onnx.ai/onnx/operators/onnx__Unique.html", "notes": "Exercises the requested standard optional output combination while flattening an N-D input." }, "attrs": { "sorted": 0 }, "inputs": { "x": { "dtype": "float32", "shape": [2, 3], "data": { "kind": "values", "values": [2.0, 1.0, 1.0, 3.0, 4.0, 3.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [4] }, "indices": { "dtype": "uint32", "shape": [4], "tolerance": 0 }, "inverse_indices": { "dtype": "uint32", "shape": [6], "tolerance": 0 }, "counts": { "dtype": "uint32", "shape": [4], "tolerance": 0 } } }, { "name": "metadata_axis_negative_all", "provenance": { "source": "https://onnx.ai/onnx/operators/onnx__Unique.html", "notes": "Exercises the requested standard optional output combination and normalizes axis=-2 to axis 0 for a rank-2 input." }, "attrs": { "axis": -2, "sorted": 1 }, "inputs": { "x": { "dtype": "float32", "shape": [3, 3], "data": { "kind": "values", "values": [1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 2.0, 3.0, 4.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [2, 3] }, "indices": { "dtype": "uint32", "shape": [2], "tolerance": 0 }, "inverse_indices": { "dtype": "uint32", "shape": [3], "tolerance": 0 }, "counts": { "dtype": "uint32", "shape": [2], "tolerance": 0 } } }, { "name": "float16_sorted_subnormal_and_signed_zero", "provenance": { "source": "https://onnx.ai/onnx/operators/onnx__Unique.html", "notes": "Covers the standard float16 type with bit-preserving subnormal ordering and signed-zero equality." }, "attrs": { "sorted": 1 }, "inputs": { "x": { "dtype": "float16", "shape": [5], "data": { "kind": "values", "values": [0.0, -0.0, 5.960464477539063e-8, -5.960464477539063e-8, 0.0] } } }, "outputs": { "y": { "dtype": "float16", "shape": [3], "tolerance": 0, "data": { "kind": "values", "values": [-5.960464477539063e-8, 0.0, 5.960464477539063e-8] } } } }, { "name": "float16_nan_ordered_map_all_metadata", "provenance": { "source": "https://onnx.ai/onnx/operators/onnx__Unique.html", "notes": "Exercises float16 NaN lower-bound equivalence and every standard optional metadata output." }, "attrs": { "sorted": 0 }, "inputs": { "x": { "dtype": "float16", "shape": [4], "data": { "kind": "values", "values": [5.0, "NaN", 1.0, 3.0] } } }, "outputs": { "y": { "dtype": "float16", "shape": [3], "tolerance": 0 }, "indices": { "dtype": "uint32", "shape": [3], "tolerance": 0 }, "inverse_indices": { "dtype": "uint32", "shape": [4], "tolerance": 0 }, "counts": { "dtype": "uint32", "shape": [3], "tolerance": 0 } } }, { "name": "float16_axis_unsorted_duplicate_rows", "provenance": { "source": "https://onnx.ai/onnx/operators/onnx__Unique.html", "notes": "Covers standard float16 axis-mode deduplication and first-occurrence output order." }, "attrs": { "axis": 0, "sorted": 0 }, "inputs": { "x": { "dtype": "float16", "shape": [3, 2], "data": { "kind": "values", "values": [2.0, 1.0, 1.0, 3.0, 2.0, 1.0] } } }, "outputs": { "y": { "dtype": "float16", "shape": [2, 2], "tolerance": 0 } } }, { "name": "int16_sorted_extremes", "provenance": { "source": "https://onnx.ai/onnx/operators/onnx__Unique.html", "notes": "Covers the standard int16 type at both representable extremes." }, "attrs": { "sorted": 1 }, "inputs": { "x": { "dtype": "int16", "shape": [6], "data": { "kind": "values", "values": [32767, -32768, -1, 0, 32767, -32768] } } }, "outputs": { "y": { "dtype": "int16", "shape": [4], "tolerance": 0 } } }, { "name": "bool_unsorted_all_metadata", "provenance": { "source": "https://onnx.ai/onnx/operators/onnx__Unique.html", "notes": "Covers the standard bool type, first-occurrence order, and every optional metadata output." }, "attrs": { "sorted": 0 }, "inputs": { "x": { "dtype": "bool", "shape": [5], "data": { "kind": "values", "values": [1, 0, 1, 1, 0] } } }, "outputs": { "y": { "dtype": "bool", "shape": [2], "tolerance": 0 }, "indices": { "dtype": "uint32", "shape": [2], "tolerance": 0 }, "inverse_indices": { "dtype": "uint32", "shape": [5], "tolerance": 0 }, "counts": { "dtype": "uint32", "shape": [2], "tolerance": 0 } } }, { "name": "axis0_f32_hash_sorted_duplicate_rows", "provenance": { "notes": "Float rows on the parallel axis hash route: 2560 rows cycling 64 distinct two-element patterns, deduplicated and lexicographically sorted through the canonical-bit comparators." }, "attrs": { "axis": 0, "sorted": 1 }, "inputs": { "x": { "dtype": "float32", "shape": [2560, 2], "data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/axis0_f32_hash_sorted_duplicate_rows_input_x" } } } }, "outputs": { "y": { "dtype": "float32", "shape": [64, 2], "tolerance": 0 } } }, { "name": "axis0_f32_hash_unsorted_first_occurrence", "provenance": { "notes": "Unsorted companion on the float axis hash route: the same 64 distinct rows must come back in first-occurrence order from the compaction scan alone." }, "attrs": { "axis": 0, "sorted": 0 }, "inputs": { "x": { "dtype": "float32", "shape": [2560, 2], "data": { "kind": "cycle", "values": { "$ref": "#/fixtureArrays/axis0_f32_hash_sorted_duplicate_rows_input_x" } } } }, "outputs": { "y": { "dtype": "float32", "shape": [64, 2], "tolerance": 0 } } }, { "name": "axis0_f32_hash_sorted_zero_collapse_floor2048", "provenance": { "notes": "At the axis-hash admission floor (axisDim == LOCAL_SORT_CROSSOVER): -0.0 and 0.0 fold to one canonical zero among 31 distinct scalars, matching the serial route's signed-zero canonicalization." }, "attrs": { "axis": 0, "sorted": 1 }, "inputs": { "x": { "dtype": "float32", "shape": [2048, 1], "data": { "kind": "cycle", "values": [-0.0, -14.5125, -3.325, -4.6375, 10.4875, -5.95, 0.3, 16.7375, 4.2375, -10.8875, 12.8, 18.05, 7.8625, 14.1125, 5.55, -15.825, -8.2625, 6.55, -6.95, 0.0, -13.2, 2.925, -18.45, -9.575, -0.7, 1.6125, -2.0125, 9.175, -17.1375, -12.2, 11.8, 15.425] } } }, "outputs": { "y": { "dtype": "float32", "shape": [31, 1], "tolerance": 0 } } }, { "name": "float16_axis0_hash_sorted", "provenance": { "notes": "f16 on the float axis hash route: 48 half-exact scalars exercise the 16-bit canonical key (vec2 pack, 16-bit sign fold) through hash, sort, and scatter." }, "attrs": { "axis": 0, "sorted": 1 }, "inputs": { "x": { "dtype": "float16", "shape": [2560, 1], "data": { "kind": "cycle", "values": [-3.0, 1.75, -3.5, 0.5, 1.25, -2.75, -5.0, 1.0, -3.25, -4.25, 0.75, -4.5, -1.75, -1.0, -0.75, -5.25, 2.0, 5.75, 2.75, 2.5, 3.75, -5.75, -0.5, 3.5, -4.0, -2.0, -1.25, -5.5, 5.0, -2.25, 2.25, 4.75, 3.0, -6.0, -4.75, 5.5, 4.0, 1.5, -3.75, 4.25, 3.25, -0.25, 5.25, -1.5, -2.5, 0.25, 0.0, 4.5] } } }, "outputs": { "y": { "dtype": "float16", "shape": [48, 1], "tolerance": 0 } } }, { "name": "axis1_f32_hash_sorted_outer2", "provenance": { "notes": "outer > 1 on the float axis hash route: axis 1 of a [2, 2560] tensor makes every slice span two strided elements, exercising the outer loop of the canonical slice comparators." }, "attrs": { "axis": 1, "sorted": 1 }, "inputs": { "x": { "dtype": "float32", "shape": [2, 2560], "data": { "kind": "cycle", "values": [-50.0, 5.5, 25.0, -47.0, -36.5, 43.0, 46.0, -5.0, 35.5, 31.0, -20.0, 8.5, -2.0, -12.5, -29.0, 38.5, -39.5, 47.5, -14.0, 16.0, -32.0, 20.5, 13.0, -42.5, -24.5, -35.0, -9.5, 1.0, -44.0, -21.5, 32.5, 10.0, 17.5, -27.5, 23.5, 2.5, -6.5, 40.0, 28.0, -17.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [2, 40], "tolerance": 0 } } } ] }