| { |
| "fixtureArrays": { |
| "bool_axis1_rank4_to_rank3_input_data": [1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1] |
| }, |
| "cases": [ |
| { |
| "name": "int16_copy_boundaries", |
| "inputs": { |
| "data": { "dtype": "int16", "shape": [1, 4, 1], "data": { "kind": "values", "values": [-32768, -1, 0, 32767] } }, |
| "axes": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 2] } } |
| }, |
| "outputs": { |
| "squeezed": { |
| "dtype": "int16", |
| "shape": [4], |
| "tolerance": 0, |
| "data": { "kind": "values", "values": [-32768, -1, 0, 32767] } |
| } |
| } |
| }, |
| { |
| "name": "remove_unit_dims", |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [1, 3, 1, 4], |
| "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29 } |
| }, |
| "axes": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 2] } } |
| }, |
| "outputs": { "squeezed": { "dtype": "float32", "shape": [3, 4], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "no_axes_all_unit_dims_to_scalar", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/squeeze_op_test.cc", |
| "test": "SqueezeOpTest.Squeeze_Empty_Axes_3" |
| }, |
| "inputs": { |
| "data": { "dtype": "float32", "shape": [1, 1, 1, 1], "data": { "kind": "values", "values": [42.0] } } |
| }, |
| "outputs": { "squeezed": { "dtype": "float32", "shape": [], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "uint32_scalar_bool_like", |
| "inputs": { |
| "data": { "dtype": "uint32", "shape": [1], "data": { "kind": "values", "values": [1] } }, |
| "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } } |
| }, |
| "outputs": { "squeezed": { "dtype": "uint32", "shape": [], "tolerance": 0 } } |
| }, |
| { |
| "name": "ort_4d_two_axes_input", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/squeeze_op_test.cc", |
| "test": "SqueezeOpTest.Squeeze_4d_2_axes_input" |
| }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [1, 4, 1, 2], |
| "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0] } |
| }, |
| "axes": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 2] } } |
| }, |
| "outputs": { "squeezed": { "dtype": "float32", "shape": [4, 2], "tolerance": 0 } } |
| }, |
| { |
| "name": "backend_many_axes", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/squeeze_op_test.cc", |
| "test": "SqueezeOpTest.Squeeze_2", |
| "notes": "Same multi-axis squeeze pattern with one extra trailing singleton dimension." |
| }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [1, 3, 1, 1, 2, 1], |
| "data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.23 } |
| }, |
| "axes": { "dtype": "int32", "shape": [4], "data": { "kind": "values", "values": [0, 2, 3, 5] } } |
| }, |
| "outputs": { "squeezed": { "dtype": "float32", "shape": [3, 2], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "ort_axes_input_rank5", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/squeeze_op_test.cc", |
| "test": "SqueezeOpTest.Squeeze_2_axes_input" |
| }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [1, 4, 1, 1, 2], |
| "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0] } |
| }, |
| "axes": { "dtype": "int32", "shape": [3], "data": { "kind": "values", "values": [0, 2, 3] } } |
| }, |
| "outputs": { "squeezed": { "dtype": "float32", "shape": [4, 2], "tolerance": 0 } } |
| }, |
| { |
| "name": "ort_negative_axes_rank5", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/squeeze_op_test.cc", |
| "test": "SqueezeOpTest.SqueezeNegAxis_2" |
| }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [1, 4, 1, 1, 2], |
| "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0] } |
| }, |
| "axes": { "dtype": "int32", "shape": [3], "data": { "kind": "values", "values": [0, -3, -2] } } |
| }, |
| "outputs": { "squeezed": { "dtype": "float32", "shape": [4, 2], "tolerance": 0 } } |
| }, |
| { |
| "name": "no_axes_mixed_unit_dims", |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [1, 2, 1, 3, 1], |
| "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29 } |
| } |
| }, |
| "outputs": { "squeezed": { "dtype": "float32", "shape": [2, 3], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "f16_single_trailing_axis", |
| "inputs": { |
| "data": { |
| "dtype": "float16", |
| "shape": [2, 3, 1], |
| "data": { "kind": "values", "values": [1.0, -2.0, 3.0, -4.0, 5.0, -6.0] } |
| }, |
| "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [2] } } |
| }, |
| "outputs": { "squeezed": { "dtype": "float16", "shape": [2, 3], "tolerance": 0.001 } } |
| }, |
| { |
| "name": "negative_axes_int32", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/squeeze_op_test.cc", |
| "test": "SqueezeOpTest.SqueezeNegAxis_axes_input" |
| }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [1, 2, 1, 3, 1], |
| "data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31 } |
| }, |
| "axes": { "dtype": "int32", "shape": [3], "data": { "kind": "values", "values": [-5, -3, -1] } } |
| }, |
| "outputs": { "squeezed": { "dtype": "float32", "shape": [2, 3], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "zero_sized_no_axes", |
| "inputs": { "data": { "dtype": "float32", "shape": [1, 0, 1], "data": { "kind": "values", "values": [] } } }, |
| "outputs": { "squeezed": { "dtype": "float32", "shape": [0], "tolerance": 0.000001 } } |
| }, |
| { |
| "name": "uint32_negative_axis_to_scalar", |
| "inputs": { |
| "data": { "dtype": "uint32", "shape": [1], "data": { "kind": "values", "values": [7] } }, |
| "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-1] } } |
| }, |
| "outputs": { "squeezed": { "dtype": "uint32", "shape": [], "tolerance": 0 } } |
| }, |
| { |
| "name": "ort_axis0_rank4", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/squeeze_op_test.cc", |
| "test": "SqueezeOpTest.Squeeze_21" |
| }, |
| "inputs": { |
| "data": { "dtype": "float32", "shape": [1, 3, 4, 5], "data": { "kind": "constant", "value": 1.0 } }, |
| "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } } |
| }, |
| "outputs": { "squeezed": { "dtype": "float32", "shape": [3, 4, 5], "tolerance": 0 } } |
| }, |
| { |
| "name": "ort_no_axes_noop_rank2", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/squeeze_op_test.cc", |
| "test": "SqueezeOpTest.Squeeze_Empty_Axes_2" |
| }, |
| "inputs": { "data": { "dtype": "float32", "shape": [2, 4], "data": { "kind": "constant", "value": 1.0 } } }, |
| "outputs": { "squeezed": { "dtype": "float32", "shape": [2, 4], "tolerance": 0 } } |
| }, |
| { |
| "name": "ort_4d_negative_axis_axes_input", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/squeeze_op_test.cc", |
| "test": "SqueezeOpTest.Squeeze_4d_NegAxis_axes_input" |
| }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [1, 4, 1, 2], |
| "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0] } |
| }, |
| "axes": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, -2] } } |
| }, |
| "outputs": { "squeezed": { "dtype": "float32", "shape": [4, 2], "tolerance": 0 } } |
| }, |
| { |
| "name": "ort_int32_axis0_rank4", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/squeeze_op_test.cc", |
| "test": "SqueezeOpTest.Squeeze_1_int32" |
| }, |
| "inputs": { |
| "data": { "dtype": "int32", "shape": [1, 3, 4, 5], "data": { "kind": "constant", "value": 1 } }, |
| "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } } |
| }, |
| "outputs": { "squeezed": { "dtype": "int32", "shape": [3, 4, 5], "tolerance": 0 } } |
| }, |
| { |
| "name": "ort_empty_axes_all_unit_dims_rank3", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/squeeze_op_test.cc", |
| "test": "SqueezeOpTest.Squeeze_Empty_Axes_1" |
| }, |
| "inputs": { |
| "data": { "dtype": "float32", "shape": [1, 1, 4], "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0] } } |
| }, |
| "outputs": { "squeezed": { "dtype": "float32", "shape": [4], "tolerance": 0 } } |
| }, |
| { |
| "name": "ort_unsorted_axes_rank5", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/squeeze_op_test.cc", |
| "test": "SqueezeOpTest.UnsortedAxes" |
| }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [1, 3, 1, 1, 2], |
| "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] } |
| }, |
| "axes": { "dtype": "int32", "shape": [3], "data": { "kind": "values", "values": [3, 0, 2] } } |
| }, |
| "outputs": { "squeezed": { "dtype": "float32", "shape": [3, 2], "tolerance": 0 } } |
| }, |
| { |
| "name": "onnx_backend_squeeze", |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [1, 3, 4, 5], |
| "data": { |
| "kind": "values", |
| "values": [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] |
| } |
| }, |
| "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } } |
| }, |
| "outputs": { "squeezed": { "dtype": "float32", "shape": [3, 4, 5] } }, |
| "provenance": { |
| "source": "cmake/external/onnx/onnx/backend/test/data/node/test_squeeze", |
| "notes": "The integer axes tensor exactly represents the source ONNX int64 axis values." |
| } |
| }, |
| { |
| "name": "onnx_backend_squeeze_negative_axes", |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [1, 3, 1, 5], |
| "data": { |
| "kind": "values", |
| "values": [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] |
| } |
| }, |
| "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-2] } } |
| }, |
| "outputs": { "squeezed": { "dtype": "float32", "shape": [1, 3, 5] } }, |
| "provenance": { |
| "source": "cmake/external/onnx/onnx/backend/test/data/node/test_squeeze_negative_axes", |
| "notes": "The integer axes tensor exactly represents the source ONNX int64 axis values." |
| } |
| }, |
| { |
| "name": "ort_duplicate_axes_rank5", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/squeeze_op_test.cc", |
| "test": "SqueezeOpTest.DuplicateAxes", |
| "notes": "ORT accepts duplicate axes for this legacy success case; axes are represented with int32 metadata slots here." |
| }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [1, 4, 1, 1, 2], |
| "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0] } |
| }, |
| "axes": { "dtype": "int32", "shape": [6], "data": { "kind": "values", "values": [3, 0, 2, 0, 2, 3] } } |
| }, |
| "outputs": { "squeezed": { "dtype": "float32", "shape": [4, 2], "tolerance": 0 } } |
| }, |
| { |
| "name": "ort_int8_axes_input_rank5_edge_values", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/squeeze_op_test.cc", |
| "test": "SqueezeOpTest.Squeeze_2_axes_input", |
| "notes": "Same axes-input squeeze pattern with logical int8 edge values." |
| }, |
| "inputs": { |
| "data": { |
| "dtype": "int8", |
| "shape": [1, 2, 1, 3, 1], |
| "data": { "kind": "values", "values": [-128, -1, 0, 1, 2, 127] } |
| }, |
| "axes": { "dtype": "int32", "shape": [3], "data": { "kind": "values", "values": [0, 2, 4] } } |
| }, |
| "outputs": { "squeezed": { "dtype": "int8", "shape": [2, 3], "tolerance": 0 } } |
| }, |
| { |
| "name": "uint8_no_axes_all_unit_dims_to_scalar", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/squeeze_op_test.cc", |
| "test": "SqueezeOpTest.Squeeze_Empty_Axes_3", |
| "notes": "No axes input squeezes all unit dimensions for logical uint8 data." |
| }, |
| "inputs": { "data": { "dtype": "uint8", "shape": [1, 1, 1], "data": { "kind": "values", "values": [255] } } }, |
| "outputs": { "squeezed": { "dtype": "uint8", "shape": [], "tolerance": 0 } } |
| }, |
| { |
| "name": "f16_vec4_unit_middle_axis", |
| "inputs": { |
| "data": { |
| "dtype": "float16", |
| "shape": [2, 1, 4], |
| "data": { "kind": "values", "values": [1.0, -2.0, 3.5, -4.5, 5.0, -6.0, 7.25, -8.75] } |
| }, |
| "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } } |
| }, |
| "outputs": { "squeezed": { "dtype": "float16", "shape": [2, 4], "tolerance": 0 } } |
| }, |
| { |
| "name": "scalar_copy_dispatch_clamp", |
| "provenance": { |
| "notes": "Odd numel forces the scalar copy variant; WORKGROUP_SIZE=4 makes ceil(numel/WG)=65536 exceed the 65535 workgroups-per-dimension limit, pinning the min(...,65535) dispatch clamp + grid-stride loop (some threads copy two elements)." |
| }, |
| "tunables": { "WORKGROUP_SIZE": 4 }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [1, 262141], |
| "data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.31 } |
| }, |
| "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [0] } } |
| }, |
| "outputs": { "squeezed": { "dtype": "float32", "shape": [262141], "tolerance": 0 } } |
| }, |
| { |
| "name": "bool_axis1_rank4_to_rank3", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/unsqueeze_op_test.cc", |
| "test": "UnsqueezeOpTest.Unsqueeze_1_bool", |
| "notes": "Spec-valid Squeeze inverse of ORT's bool Unsqueeze case." |
| }, |
| "inputs": { |
| "data": { |
| "dtype": "bool", |
| "shape": [2, 1, 3, 4], |
| "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/bool_axis1_rank4_to_rank3_input_data" } } |
| }, |
| "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [1] } } |
| }, |
| "outputs": { |
| "squeezed": { |
| "dtype": "bool", |
| "shape": [2, 3, 4], |
| "tolerance": 0, |
| "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/bool_axis1_rank4_to_rank3_input_data" } } |
| } |
| } |
| }, |
| { |
| "name": "f32_vec4_copy_1024", |
| "provenance": { |
| "notes": "A small aligned float32 payload exercises vectorized copying while removing all unit axes." |
| }, |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [1, 1024, 1], |
| "data": { "kind": "fillFloat32", "sinStep": 0.019, "cosStep": 0.037, "scale": 0.5 } |
| } |
| }, |
| "outputs": { "squeezed": { "dtype": "float32", "shape": [1024], "tolerance": 0 } } |
| }, |
| { |
| "name": "ort_caseB_empty", |
| "inputs": { |
| "data": { |
| "dtype": "float32", |
| "shape": [1, 3, 1, 4], |
| "data": { |
| "kind": "values", |
| "values": [0.1685003787279129, 0.15739141404628754, 0.1382775753736496, 0.11521615087985992, 0.09246580302715302, 0.0740915909409523, 0.0635889545083046, 0.0635586753487587, 0.07546063512563705, 0.09946724772453308, 0.1344294399023056, 0.17795813083648682] |
| } |
| }, |
| "axes": { "dtype": "int32", "shape": [0], "data": { "kind": "values", "values": [] } } |
| }, |
| "outputs": { |
| "squeezed": { |
| "dtype": "float32", |
| "shape": [3, 4], |
| "data": { |
| "kind": "values", |
| "values": [0.1685003787279129, 0.15739141404628754, 0.1382775753736496, 0.11521615087985992, 0.09246580302715302, 0.0740915909409523, 0.0635889545083046, 0.0635586753487587, 0.07546063512563705, 0.09946724772453308, 0.1344294399023056, 0.17795813083648682] |
| }, |
| "tolerance": 0.001 |
| } |
| } |
| }, |
| { |
| "name": "int8_numel2_no_axes_scalar_copy", |
| "inputs": { "data": { "dtype": "int8", "shape": [1, 2, 1], "data": { "kind": "values", "values": [-128, 127] } } }, |
| "outputs": { "squeezed": { "dtype": "int8", "shape": [2], "tolerance": 0 } } |
| }, |
| { |
| "name": "uint8_numel3_negative_axis", |
| "inputs": { |
| "data": { "dtype": "uint8", "shape": [1, 3], "data": { "kind": "values", "values": [0, 128, 255] } }, |
| "axes": { "dtype": "int32", "shape": [1], "data": { "kind": "values", "values": [-2] } } |
| }, |
| "outputs": { "squeezed": { "dtype": "uint8", "shape": [3], "tolerance": 0 } } |
| }, |
| { |
| "name": "f16_numel6_two_unit_dims_scalar_copy", |
| "inputs": { |
| "data": { |
| "dtype": "float16", |
| "shape": [1, 2, 1, 3], |
| "data": { "kind": "values", "values": [-65504.0, -0.5, 0.0, 0.5, 1.0, 65504.0] } |
| }, |
| "axes": { "dtype": "int32", "shape": [2], "data": { "kind": "values", "values": [0, 2] } } |
| }, |
| "outputs": { "squeezed": { "dtype": "float16", "shape": [2, 3], "tolerance": 0 } } |
| } |
| ] |
| } |
|
|