| { |
| "op": "ai.onnx.Gather", |
| "fixtureArrays": { |
| "onnx_backend_gather_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], |
| "rank6_axis5_input_data": [0, 1, 2, 3, 10, 11, 12, 13, 100, 101, 102, 103, 110, 111, 112, 113], |
| "ort_negative_axis_f16_rank3_input_data": [0, 0.1, 0.2, 0.3, 1, 1.1, 1.2, 1.3, 2, 2.1, 2.2, 2.3, 10, 10.1, 10.2, 10.3, 11, 11.1, 11.2, 11.3, 12, 12.1, 12.2, 12.3], |
| "rank5_indices_rank2_axis0_aligned_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, 60, 61, 62, 63, 70, 71, 72, 73] |
| }, |
| "cases": [ |
| { |
| "name": "f32_subnormal_data_axis0", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/gather_op_test.cc", |
| "test": "GatherOpTest.Gather_axis0", |
| "notes": "Gather copies selected tensor elements; finite subnormal payloads remain valid data after indexing." |
| }, |
| "attrs": { "axis": 0 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [4], |
| "data": { "kind": "values", "values": [1e-40, -1e-40, 0.0, 1e-39] } |
| }, |
| "indices": { "dtype": "int32", "shape": [4], "data": { "kind": "values", "values": [3, 0, 1, 2] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [4], "tolerance": 0 } } |
| }, |
| { |
| "name": "dispatch_cliff_axis1_generic", |
| "attrs": { "axis": 1 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [1, 2, 8388481], |
| "data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.13 } |
| }, |
| "indices": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [1, 0] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [1, 2, 8388481], "tolerance": 0 } } |
| }, |
| { |
| "name": "axis0", |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [3, 4], |
| "data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.13 } |
| }, |
| "indices": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [2, 0] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [2, 4], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "axis1", |
| "attrs": { "axis": 1 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [3, 4], |
| "data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.13 } |
| }, |
| "indices": { "dtype": "int32", "shape": [3], "data": { "kind": "values", "values": [3, 1, 0] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [3, 3], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "axis1_many_rows_idx32_f32", |
| "provenance": { |
| "notes": "Compact sibling for the axis=1 Gather benchmark; preserves many independent rows and a column-index vector without benchmark-scale tensors." |
| }, |
| "attrs": { "axis": 1 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [128, 512], |
| "data": { "kind": "fillFloat32", "sinStep": 0.013, "cosStep": 0.021, "scale": 0.2 } |
| }, |
| "indices": { |
| "dtype": "int32", |
| "shape": [32], |
| "data": { "kind": "cycle", "values": [0, 17, 128, 255, 511, 3, 64, 301] } |
| } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [128, 32], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "rank3_axis1_indices2d", |
| "attrs": { "axis": 1 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [2, 4, 3], |
| "data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.23 } |
| }, |
| "indices": { "dtype": "int32", "shape": [2, 2], "data": { "kind": "values", "values": [3, 1, 0, 2] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [2, 2, 2, 3], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "negative_axis", |
| "attrs": { "axis": -1 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [2, 3, 4], |
| "data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.13 } |
| }, |
| "indices": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [3, 1] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [2, 3, 2], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "rank3_axis2", |
| "attrs": { "axis": 2 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [2, 3, 4], |
| "data": { |
| "kind": "values", |
| "values": [0.0, 1.0, 2.0, 3.0, 10.0, 11.0, 12.0, 13.0, 20.0, 21.0, 22.0, 23.0, 100.0, 101.0, 102.0, 103.0, 110.0, 111.0, 112.0, 113.0, 120.0, 121.0, 122.0, 123.0] |
| } |
| }, |
| "indices": { "dtype": "int32", "shape": [3], "data": { "kind": "values", "values": [3, 0, 2] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [2, 3, 3], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "uint32_bool_like_axis0", |
| "attrs": { "axis": 0 }, |
| "inputs": { |
| "data": { |
| "dtype": "uint32", |
| "shape": [3, 4], |
| "data": { "kind": "values", "values": [1, 0, 1, 0, 2, 0, 2, 0, 3, 0, 3, 0] } |
| }, |
| "indices": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [2, 0] } } |
| }, |
| "outputs": { "output": { "dtype": "uint32", "shape": [2, 4], "tolerance": 0 } } |
| }, |
| { |
| "name": "scalar_index_axis1", |
| "attrs": { "axis": 1 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [3, 4], |
| "data": { "kind": "values", "values": [0.0, 1.0, 2.0, 3.0, 10.0, 11.0, 12.0, 13.0, 20.0, 21.0, 22.0, 23.0] } |
| }, |
| "indices": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [2] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [3], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "ort_scalar_index_axis0_rank3", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/gather_op_test.cc", |
| "test": "GatherOpTest.Gather_axis0_scalar_indices", |
| "notes": "ORT uses int64 scalar indices; this framework uses int32 indices where representable." |
| }, |
| "attrs": { "axis": 0 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [2, 2, 2], |
| "data": { "kind": "values", "values": [0.0, 0.01, 0.1, 0.11, 1.0, 1.01, 1.1, 1.11] } |
| }, |
| "indices": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [1] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [2, 2], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "ort_scalar_index_axis1_rank3", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/gather_op_test.cc", |
| "test": "GatherOpTest.Gather_axis1_scalar_indices", |
| "notes": "ORT uses int64 scalar indices; this framework uses int32 indices where representable." |
| }, |
| "attrs": { "axis": 1 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [2, 2, 2], |
| "data": { "kind": "values", "values": [0.0, 0.01, 0.1, 0.11, 1.0, 1.01, 1.1, 1.11] } |
| }, |
| "indices": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [1] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [2, 2], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "rank4_indices_axis1", |
| "attrs": { "axis": 1 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [2, 4], |
| "data": { "kind": "values", "values": [0.0, 1.0, 2.0, 3.0, 10.0, 11.0, 12.0, 13.0] } |
| }, |
| "indices": { "dtype": "int32", "shape": [1, 1, 2, 2], "data": { "kind": "values", "values": [3, 0, 1, 2] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [2, 1, 1, 2, 2], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "rank6_axis5", |
| "attrs": { "axis": -1 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [1, 2, 1, 2, 1, 4], |
| "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/rank6_axis5_input_data" } } |
| }, |
| "indices": { "dtype": "int32", "shape": [3], "data": { "kind": "values", "values": [3, 0, 2] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [1, 2, 1, 2, 1, 3], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "backend_rank4_axis0", |
| "attrs": { "axis": 0 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [5, 4, 3, 2], |
| "data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.19, "scale": 0.25 } |
| }, |
| "indices": { "dtype": "int32", "shape": [3], "data": { "kind": "values", "values": [0, 1, 3] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [3, 4, 3, 2], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "backend_rank4_axis1", |
| "attrs": { "axis": 1 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [5, 4, 3, 2], |
| "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.17, "scale": 0.25 } |
| }, |
| "indices": { "dtype": "int32", "shape": [3], "data": { "kind": "values", "values": [0, 1, 3] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [5, 3, 3, 2], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "ort_negative_axis_f16_rank3", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/gather_op_test.cc", |
| "test": "GatherOpTest.Gather_negative_axis" |
| }, |
| "attrs": { "axis": -3 }, |
| "inputs": { |
| "data": { |
| "dtype": "float16", |
| "shape": [2, 3, 4], |
| "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_negative_axis_f16_rank3_input_data" } } |
| }, |
| "indices": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } } |
| }, |
| "outputs": { "output": { "dtype": "float16", "shape": [1, 3, 4], "tolerance": 0.001 } } |
| }, |
| { |
| "name": "ort_axis0_int32_indices_rank3", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/gather_op_test.cc", |
| "test": "GatherOpTest.Gather_axis0_indicesInt32" |
| }, |
| "attrs": { "axis": 0 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [2, 3, 4], |
| "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_negative_axis_f16_rank3_input_data" } } |
| }, |
| "indices": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [1, 3, 4], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "ort_axis1_float_rank3", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/gather_op_test.cc", |
| "test": "GatherOpTest.Gather_axis1" |
| }, |
| "attrs": { "axis": 1 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [2, 3, 4], |
| "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_negative_axis_f16_rank3_input_data" } } |
| }, |
| "indices": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [2, 0] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [2, 2, 4], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "ort_axis2_float_rank3", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/gather_op_test.cc", |
| "test": "GatherOpTest.Gather_axis2" |
| }, |
| "attrs": { "axis": 2 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [2, 3, 4], |
| "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_negative_axis_f16_rank3_input_data" } } |
| }, |
| "indices": { "dtype": "int32", "shape": [3], "data": { "kind": "values", "values": [1, 0, 2] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [2, 3, 3], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "ort_axis0_indices2d_int32_indices", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/gather_op_test.cc", |
| "test": "GatherOpTest.Gather_axis0_indices2dInt32" |
| }, |
| "attrs": { "axis": 0 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [3, 3], |
| "data": { "kind": "values", "values": [0.0, 0.1, 0.2, 1.0, 1.1, 1.2, 2.0, 2.1, 2.2] } |
| }, |
| "indices": { "dtype": "int32", "shape": [2, 2], "data": { "kind": "values", "values": [1, 0, 2, 1] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [2, 2, 3], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "ort_axis1_indices2d_f16", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/gather_op_test.cc", |
| "test": "GatherOpTest.Gather_axis1_indices2d" |
| }, |
| "attrs": { "axis": 1 }, |
| "inputs": { |
| "data": { |
| "dtype": "float16", |
| "shape": [3, 3], |
| "data": { "kind": "values", "values": [0.0, 0.1, 0.2, 1.0, 1.1, 1.2, 2.0, 2.1, 2.2] } |
| }, |
| "indices": { "dtype": "int32", "shape": [2, 2], "data": { "kind": "values", "values": [1, 0, 2, 1] } } |
| }, |
| "outputs": { "output": { "dtype": "float16", "shape": [3, 2, 2], "tolerance": 0.001 } } |
| }, |
| { |
| "name": "ort_axis1_indices2d_uint32_data", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/gather_op_test.cc", |
| "test": "GatherOpTest.Gather_axis1_indices2d_uint32" |
| }, |
| "attrs": { "axis": 1 }, |
| "inputs": { |
| "data": { |
| "dtype": "uint32", |
| "shape": [3, 3], |
| "data": { "kind": "values", "values": [0, 1, 2, 10, 11, 12, 20, 21, 22] } |
| }, |
| "indices": { "dtype": "int32", "shape": [2, 2], "data": { "kind": "values", "values": [1, 0, 2, 1] } } |
| }, |
| "outputs": { "output": { "dtype": "uint32", "shape": [3, 2, 2], "tolerance": 0 } } |
| }, |
| { |
| "name": "ort_int32_negative_indices_axis0", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/gather_op_test.cc", |
| "test": "GatherOpTest.Gather_axis1_neg_indices2d_int8", |
| "notes": "ORT's explicit negative-index data case uses int8 axis=1; this framework covers signed index wrapping on float32 axis=0." |
| }, |
| "attrs": { "axis": 0 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [3, 4], |
| "data": { "kind": "values", "values": [0.0, 1.0, 2.0, 3.0, 10.0, 11.0, 12.0, 13.0, 20.0, 21.0, 22.0, 23.0] } |
| }, |
| "indices": { "dtype": "int32", "shape": [3], "data": { "kind": "values", "values": [-1, 0, -2] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [3, 4], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "ort_int32_negative_indices_last_axis_rank3", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/gather_op_test.cc", |
| "test": "GatherOpTest.Gather_axis1_neg_indices2d_int8", |
| "notes": "ORT's explicit negative-index data case uses int8 axis=1; this framework covers signed index wrapping on the last axis of float32 rank-3 data." |
| }, |
| "attrs": { "axis": -1 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [2, 2, 4], |
| "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/rank6_axis5_input_data" } } |
| }, |
| "indices": { "dtype": "int32", "shape": [2, 2], "data": { "kind": "values", "values": [-1, 0, -3, 2] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [2, 2, 2, 2], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "ort_axis1_indices2d_int32_data", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/gather_op_test.cc", |
| "test": "GatherOpTest.Gather_axis1_indices2d_int32" |
| }, |
| "attrs": { "axis": 1 }, |
| "inputs": { |
| "data": { |
| "dtype": "int32", |
| "shape": [3, 3], |
| "data": { "kind": "values", "values": [0, 1, 2, 10, 11, 12, 20, 21, 22] } |
| }, |
| "indices": { "dtype": "int32", "shape": [2, 2], "data": { "kind": "values", "values": [1, 0, 2, 1] } } |
| }, |
| "outputs": { "output": { "dtype": "int32", "shape": [3, 2, 2], "tolerance": 0 } } |
| }, |
| { |
| "name": "ort_axis1_indices2d_bool_data", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/gather_op_test.cc", |
| "test": "GatherOpTest.Gather_axis1_indices2d_bool" |
| }, |
| "attrs": { "axis": 1 }, |
| "inputs": { |
| "data": { |
| "dtype": "bool", |
| "shape": [3, 3], |
| "data": { "kind": "values", "values": [1, 0, 1, 1, 1, 0, 0, 1, 0] } |
| }, |
| "indices": { "dtype": "int32", "shape": [2, 2], "data": { "kind": "values", "values": [1, 0, 2, 1] } } |
| }, |
| "outputs": { |
| "output": { |
| "dtype": "bool", |
| "shape": [3, 2, 2], |
| "tolerance": 0, |
| "data": { "kind": "values", "values": [0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1] } |
| } |
| } |
| }, |
| { |
| "name": "ort_axis1_indices2d_int16_data", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/gather_op_test.cc", |
| "test": "GatherOpTest.Gather_axis1_indices2d_int16" |
| }, |
| "attrs": { "axis": 1 }, |
| "inputs": { |
| "data": { |
| "dtype": "int16", |
| "shape": [3, 3], |
| "data": { "kind": "values", "values": [0, 1, 2, 10, 11, 12, 20, 21, 22] } |
| }, |
| "indices": { "dtype": "int32", "shape": [2, 2], "data": { "kind": "values", "values": [1, 0, 2, 1] } } |
| }, |
| "outputs": { "output": { "dtype": "int16", "shape": [3, 2, 2], "tolerance": 0 } } |
| }, |
| { |
| "name": "ort_axis1_negative_indices2d_int32_data", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/gather_op_test.cc", |
| "test": "GatherOpTest.Gather_axis1_neg_indices2d_int8", |
| "notes": "ORT's signed negative-index case uses int8 payload; this framework uses int32 payload while preserving the axis-1 signed-index behavior." |
| }, |
| "attrs": { "axis": 1 }, |
| "inputs": { |
| "data": { |
| "dtype": "int32", |
| "shape": [3, 3], |
| "data": { "kind": "values", "values": [0, 1, 2, 10, 11, 12, 20, 21, 22] } |
| }, |
| "indices": { "dtype": "int32", "shape": [2, 2], "data": { "kind": "values", "values": [-2, -3, -1, -2] } } |
| }, |
| "outputs": { |
| "output": { |
| "dtype": "int32", |
| "shape": [3, 2, 2], |
| "tolerance": 0, |
| "data": { "kind": "values", "values": [1, 0, 2, 1, 11, 10, 12, 11, 21, 20, 22, 21] } |
| } |
| } |
| }, |
| { |
| "name": "onnx_backend_gather_0", |
| "attrs": { "axis": 0 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [5, 4, 3, 2], |
| "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/onnx_backend_gather_input_data" } } |
| }, |
| "indices": { "dtype": "int32", "shape": [3], "data": { "kind": "values", "values": [0, 1, 3] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [3, 4, 3, 2] } }, |
| "provenance": { |
| "source": "cmake/external/onnx/onnx/backend/test/data/node/test_gather_0", |
| "notes": "ONNX int64 index values are adapted to supported int32 where representable." |
| } |
| }, |
| { |
| "name": "onnx_backend_gather_1", |
| "attrs": { "axis": 1 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [5, 4, 3, 2], |
| "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/onnx_backend_gather_input_data" } } |
| }, |
| "indices": { "dtype": "int32", "shape": [3], "data": { "kind": "values", "values": [0, 1, 3] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [5, 3, 3, 2] } }, |
| "provenance": { |
| "source": "cmake/external/onnx/onnx/backend/test/data/node/test_gather_1", |
| "notes": "ONNX int64 index values are adapted to supported int32 where representable." |
| } |
| }, |
| { |
| "name": "onnx_backend_gather_2d_indices", |
| "attrs": { "axis": 1 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [3, 3], |
| "data": { |
| "kind": "values", |
| "values": [1.764052391052246, 0.40015721321105957, 0.978738009929657, 2.2408931255340576, 1.8675580024719238, -0.9772778749465942, 0.9500884413719177, -0.15135720372200012, -0.10321885347366333] |
| } |
| }, |
| "indices": { "dtype": "int32", "shape": [1, 2], "data": { "kind": "values", "values": [0, 2] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [3, 1, 2] } }, |
| "provenance": { |
| "source": "cmake/external/onnx/onnx/backend/test/data/node/test_gather_2d_indices", |
| "notes": "ONNX int64 index values are adapted to supported int32 where representable." |
| } |
| }, |
| { |
| "name": "onnx_backend_gather_negative_indices", |
| "attrs": { "axis": 0 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [10], |
| "data": { "kind": "values", "values": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0] } |
| }, |
| "indices": { "dtype": "int32", "shape": [3], "data": { "kind": "values", "values": [0, -9, -10] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [3] } }, |
| "provenance": { |
| "source": "cmake/external/onnx/onnx/backend/test/data/node/test_gather_negative_indices", |
| "notes": "ONNX int64 index values are adapted to supported int32 where representable." |
| } |
| }, |
| { |
| "name": "ort_int8_axis1_indices2d_edge_values", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/gather_op_test.cc", |
| "test": "GatherOpTest.Gather_axis1_indices2d_int8", |
| "notes": "Axis-1 two-dimensional indices with logical int8 edge values." |
| }, |
| "attrs": { "axis": 1 }, |
| "inputs": { |
| "data": { "dtype": "int8", "shape": [2, 3], "data": { "kind": "values", "values": [-128, -1, 0, 1, 2, 127] } }, |
| "indices": { "dtype": "int32", "shape": [1, 2], "data": { "kind": "values", "values": [2, 0] } } |
| }, |
| "outputs": { "output": { "dtype": "int8", "shape": [2, 1, 2], "tolerance": 0 } } |
| }, |
| { |
| "name": "uint8_axis1_negative_indices", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/gather_op_test.cc", |
| "test": "GatherOpTest.Gather_axis1_neg_indices2d_int8", |
| "notes": "Negative-index gather pattern with logical uint8 data." |
| }, |
| "attrs": { "axis": 1 }, |
| "inputs": { |
| "data": { |
| "dtype": "uint8", |
| "shape": [2, 3], |
| "data": { "kind": "values", "values": [0, 1, 127, 128, 254, 255] } |
| }, |
| "indices": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, -1] } } |
| }, |
| "outputs": { "output": { "dtype": "uint8", "shape": [2, 2], "tolerance": 0 } } |
| }, |
| { |
| "name": "row_fast_axis0_f32_rank2", |
| "attrs": { "axis": 0 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [64, 8], |
| "data": { "kind": "fillFloat32", "sinStep": 0.21, "cosStep": 0.17 } |
| }, |
| "indices": { "dtype": "int32", "shape": [5], "data": { "kind": "values", "values": [3, 0, 63, 7, 9] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [5, 8], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "row_fast_axis0_f16_rank2", |
| "attrs": { "axis": 0 }, |
| "inputs": { |
| "data": { |
| "dtype": "float16", |
| "shape": [16, 12], |
| "data": { "kind": "fillFloat32", "sinStep": 0.19, "cosStep": 0.23 } |
| }, |
| "indices": { "dtype": "int32", "shape": [4], "data": { "kind": "values", "values": [15, 1, 8, 0] } } |
| }, |
| "outputs": { "output": { "dtype": "float16", "shape": [4, 12], "tolerance": 0.001 } } |
| }, |
| { |
| "name": "row_fast_axis0_i32_negative_indices", |
| "attrs": { "axis": 0 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [16, 4], |
| "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29 } |
| }, |
| "indices": { "dtype": "int32", "shape": [4], "data": { "kind": "values", "values": [-1, -16, 3, 5] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [4, 4], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "row_fast_axis0_rank3_data_indices2d", |
| "attrs": { "axis": 0 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [6, 4, 3], |
| "data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.31 } |
| }, |
| "indices": { "dtype": "int32", "shape": [2, 2], "data": { "kind": "values", "values": [5, 0, 3, 1] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [2, 2, 4, 3], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "row_fast_negative_axis_rank2", |
| "attrs": { "axis": -2 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [8, 4], |
| "data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.19 } |
| }, |
| "indices": { "dtype": "int32", "shape": [3], "data": { "kind": "values", "values": [7, 2, 4] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [3, 4], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "row_fast_axis0_u32_data", |
| "attrs": { "axis": 0 }, |
| "inputs": { |
| "data": { |
| "dtype": "uint32", |
| "shape": [10, 8], |
| "data": { "kind": "cycle", "values": [3, 1, 4, 1, 5, 9, 2, 6, 8, 7, 3, 0, 11, 13] } |
| }, |
| "indices": { "dtype": "int32", "shape": [4], "data": { "kind": "values", "values": [9, 0, 5, 2] } } |
| }, |
| "outputs": { "output": { "dtype": "uint32", "shape": [4, 8], "tolerance": 0 } } |
| }, |
| { |
| "name": "empty_indices_zero_width_suffix", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/gather_op_test.cc", |
| "test": "GatherOpTest.Gather_axis0", |
| "notes": "Valid empty-index axis-0 gather with a zero-width trailing data dimension; output has no elements but generic coordinate math must still compile." |
| }, |
| "attrs": { "axis": 0 }, |
| "inputs": { |
| "data": { "dtype": "float32", "shape": [2, 0], "data": { "kind": "values", "values": [] } }, |
| "indices": { "dtype": "int32", "shape": [0], "data": { "kind": "values", "values": [] } } |
| }, |
| "outputs": { |
| "output": { "dtype": "float32", "shape": [0, 0], "tolerance": 0, "data": { "kind": "values", "values": [] } } |
| } |
| }, |
| { |
| "name": "empty_input_zero_dim", |
| "attrs": { "axis": 0 }, |
| "inputs": { |
| "data": { "dtype": "float32", "shape": [0, 4], "data": { "kind": "values", "values": [] } }, |
| "indices": { "dtype": "int32", "shape": [0], "data": { "kind": "values", "values": [] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [0, 4], "tolerance": 0 } } |
| }, |
| { |
| "name": "rank5_indices_rank1_data_axis0", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/gather_op_test.cc", |
| "test": "GatherOpTest.Gather_axis0", |
| "notes": "ONNX Gather permits arbitrary-rank indices; output rank = data_rank + indices_rank - 1." |
| }, |
| "attrs": { "axis": 0 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [8], |
| "data": { "kind": "values", "values": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0] } |
| }, |
| "indices": { "dtype": "int32", "shape": [1, 2, 1, 2, 1], "data": { "kind": "values", "values": [3, 0, 5, 2] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [1, 2, 1, 2, 1], "tolerance": 0 } } |
| }, |
| { |
| "name": "rank5_indices_rank2_axis0_aligned", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/gather_op_test.cc", |
| "test": "GatherOpTest.Gather_axis0_indices2d", |
| "notes": "axis-0 gather over rank-2 data with aligned 4-wide rows would normally hit row_fast_vec4, but rank-5 indices trips the ranks.indices <= 4 cap on BOTH variants. Output rank = 2 + 5 - 1 = 6 (<= 6). ORT CPU verified, out shape (1,2,1,2,1,4)." |
| }, |
| "attrs": { "axis": 0 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [8, 4], |
| "data": { |
| "kind": "values", |
| "values": { "$ref": "#/fixtureArrays/rank5_indices_rank2_axis0_aligned_input_data" } |
| } |
| }, |
| "indices": { "dtype": "int32", "shape": [1, 2, 1, 2, 1], "data": { "kind": "values", "values": [7, 0, 3, 1] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [1, 2, 1, 2, 1, 4], "tolerance": 0 } } |
| }, |
| { |
| "name": "scalar_index_middle_axis_rank4", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/gather_op_test.cc", |
| "test": "GatherOpTest.Gather_axis1_scalar_indices", |
| "notes": "Rank-0 (scalar) index on a MIDDLE axis (axis=2) of rank-4 data exercises the gather.wgsl.jinja data_offset stride-folding across leading+trailing data dims with indicesRank=0. Output rank = 4 + 0 - 1 = 3. ORT CPU verified, out shape (2,3,7)." |
| }, |
| "attrs": { "axis": 2 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [2, 3, 5, 7], |
| "data": { "kind": "fillFloat32", "sinStep": 0.09, "cosStep": 0.21 } |
| }, |
| "indices": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [3] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [2, 3, 7], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "row_fast_vec4_oob_positive_index_zero_fill", |
| "provenance": { |
| "notes": "axis=0, data=[8,4] has inner(data,0)=4 which satisfies %4==0, so row_fast_vec4 is selected. Index value 8 >= AXIS_DIM=8 triggers the INVALID_INDEX branch in the inline normalize_index inside datamove-gather-row.wgsl.jinja. Expected: output rows for OOB indices are zero-filled. All existing row_fast_* tests use only valid indices; this is the first OOB positive index through the vec4 path." |
| }, |
| "attrs": { "axis": 0 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [8, 4], |
| "data": { |
| "kind": "values", |
| "values": { "$ref": "#/fixtureArrays/rank5_indices_rank2_axis0_aligned_input_data" } |
| } |
| }, |
| "indices": { "dtype": "int32", "shape": [4], "data": { "kind": "values", "values": [0, 8, 3, 7] } } |
| }, |
| "outputs": { |
| "output": { |
| "dtype": "float32", |
| "shape": [4, 4], |
| "tolerance": 0, |
| "data": { |
| "kind": "values", |
| "values": [0.0, 1.0, 2.0, 3.0, 0.0, 0.0, 0.0, 0.0, 30.0, 31.0, 32.0, 33.0, 70.0, 71.0, 72.0, 73.0] |
| } |
| } |
| } |
| }, |
| { |
| "name": "row_fast_vec4_oob_negative_index_zero_fill", |
| "provenance": { |
| "notes": "axis=0, data=[4,8] has inner(data,0)=8 which satisfies %4==0, selecting row_fast_vec4. i32 indices: 0 is valid, -5 is OOB (normalized: -5+4=-1<0 => INVALID_INDEX), 2 is valid, -4 is the maximally negative valid index (normalized: -4+4=0). Pins zero-fill on the signed-OOB branch of the inline normalize_index inside datamove-gather-row.wgsl.jinja." |
| }, |
| "attrs": { "axis": 0 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [4, 8], |
| "data": { |
| "kind": "values", |
| "values": [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 10.0, 10.1, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 20.0, 20.1, 20.2, 20.3, 20.4, 20.5, 20.6, 20.7, 30.0, 30.1, 30.2, 30.3, 30.4, 30.5, 30.6, 30.7] |
| } |
| }, |
| "indices": { "dtype": "int32", "shape": [4], "data": { "kind": "values", "values": [0, -5, 2, -4] } } |
| }, |
| "outputs": { |
| "output": { |
| "dtype": "float32", |
| "shape": [4, 8], |
| "tolerance": 0, |
| "data": { |
| "kind": "values", |
| "values": [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 20.0, 20.1, 20.2, 20.3, 20.4, 20.5, 20.6, 20.7, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7] |
| } |
| } |
| } |
| }, |
| { |
| "name": "rank8_axis7", |
| "attrs": { "axis": -1 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [1, 2, 1, 2, 1, 2, 2, 4], |
| "data": { "kind": "linspace", "start": 1.0, "end": 64.0 } |
| }, |
| "indices": { "dtype": "int32", "shape": [3], "data": { "kind": "values", "values": [0, 3, 1] } } |
| }, |
| "outputs": { "output": { "dtype": "float32", "shape": [1, 2, 1, 2, 1, 2, 2, 3], "tolerance": 0.000001 } } |
| } |
| ] |
| } |
|
|