ai.onnx.Shape / build /webgpu /test.json
Xenova's picture
Xenova HF Staff
sync 2e7068faf55e
0dcee9d verified
Raw
History Blame
16.2 kB
{
"op": "ai.onnx.Shape",
"cases": [
{
"name": "rank3_f32",
"inputs": { "data": { "dtype": "float32", "shape": [2, 3, 4] } },
"outputs": { "shape": { "dtype": "uint32", "shape": [3] } }
},
{
"name": "rank4_u32",
"inputs": { "data": { "dtype": "uint32", "shape": [1, 2, 3, 4] } },
"outputs": { "shape": { "dtype": "uint32", "shape": [4] } }
},
{
"name": "rank0_scalar_input_empty_shape_vector",
"inputs": { "data": { "dtype": "float32", "shape": [] } },
"outputs": { "shape": { "dtype": "uint32", "shape": [0], "tolerance": 0 } }
},
{
"name": "ort_interior_zero_dim_reports_zero",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/shape_op_test.cc",
"test": "ShapeOpTest.ShapeOpset15_Default",
"notes": "Additional node-level zero-dimension edge: Shape must report an interior zero dimension exactly."
},
"inputs": { "data": { "dtype": "float32", "shape": [2, 0, 3], "data": { "kind": "values", "values": [] } } },
"outputs": {
"shape": { "dtype": "uint32", "shape": [3], "tolerance": 0, "data": { "kind": "values", "values": [2, 0, 3] } }
}
},
{
"name": "start_end_middle_dims",
"attrs": { "start": 1, "end": 3 },
"inputs": { "data": { "dtype": "float32", "shape": [2, 3, 4, 5] } },
"outputs": { "shape": { "dtype": "uint32", "shape": [2], "tolerance": 0 } }
},
{
"name": "negative_start_negative_end",
"attrs": { "start": -3, "end": -1 },
"inputs": { "data": { "dtype": "float32", "shape": [2, 3, 4, 5] } },
"outputs": { "shape": { "dtype": "uint32", "shape": [2], "tolerance": 0 } }
},
{
"name": "ort_start_equals_end_empty_slice",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/shape_op_test.cc",
"test": "ShapeOpTest.ShapeOpset15_StartAndEndProducingEmptySlice"
},
"attrs": { "start": 2, "end": 2 },
"inputs": {
"data": { "dtype": "int32", "shape": [1, 2, 2], "data": { "kind": "values", "values": [1, 2, 3, 4] } }
},
"outputs": { "shape": { "dtype": "uint32", "shape": [0], "tolerance": 0 } }
},
{
"name": "ort_int8_shape_3x4",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/shape_op_test.cc",
"test": "ShapeOpTest.ShapeTestInt8"
},
"inputs": {
"data": {
"dtype": "int8",
"shape": [3, 4],
"data": { "kind": "values", "values": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] }
}
},
"outputs": { "shape": { "dtype": "uint32", "shape": [2], "tolerance": 0 } }
},
{
"name": "ort_int16_shape_3x4",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/shape_op_test.cc",
"test": "ShapeOpTest.ShapeTestInt16"
},
"inputs": {
"data": {
"dtype": "int16",
"shape": [3, 4],
"data": { "kind": "values", "values": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] }
}
},
"outputs": { "shape": { "dtype": "uint32", "shape": [2], "tolerance": 0 } }
},
{
"name": "ort_uint8_shape_12x1",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/shape_op_test.cc",
"test": "ShapeOpTest.ShapeTestUint8"
},
"inputs": {
"data": {
"dtype": "uint8",
"shape": [12, 1],
"data": { "kind": "values", "values": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] }
}
},
"outputs": { "shape": { "dtype": "uint32", "shape": [2], "tolerance": 0 } }
},
{
"name": "ort_int32_shape_4x3",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/shape_op_test.cc",
"test": "ShapeOpTest.ShapeTestInt32"
},
"inputs": {
"data": {
"dtype": "int32",
"shape": [4, 3],
"data": { "kind": "values", "values": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] }
}
},
"outputs": { "shape": { "dtype": "uint32", "shape": [2], "tolerance": 0 } }
},
{
"name": "ort_int32_default_opset15",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/shape_op_test.cc",
"test": "ShapeOpTest.ShapeOpset15_Default"
},
"inputs": {
"data": { "dtype": "int32", "shape": [1, 2, 2], "data": { "kind": "values", "values": [1, 2, 3, 4] } }
},
"outputs": { "shape": { "dtype": "uint32", "shape": [3], "tolerance": 0 } }
},
{
"name": "ort_start_only_int32",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/shape_op_test.cc",
"test": "ShapeOpTest.ShapeOpset15_StartOnly"
},
"attrs": { "start": 1 },
"inputs": {
"data": { "dtype": "int32", "shape": [1, 2, 2], "data": { "kind": "values", "values": [1, 2, 3, 4] } }
},
"outputs": { "shape": { "dtype": "uint32", "shape": [2], "tolerance": 0 } }
},
{
"name": "ort_end_only_int32",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/shape_op_test.cc",
"test": "ShapeOpTest.ShapeOpset15_EndOnly"
},
"attrs": { "end": 2 },
"inputs": {
"data": { "dtype": "int32", "shape": [1, 2, 2], "data": { "kind": "values", "values": [1, 2, 3, 4] } }
},
"outputs": { "shape": { "dtype": "uint32", "shape": [2], "tolerance": 0 } }
},
{
"name": "ort_start_and_end_int32",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/shape_op_test.cc",
"test": "ShapeOpTest.ShapeOpset15_StartAndEnd"
},
"attrs": { "start": 1, "end": 2 },
"inputs": {
"data": { "dtype": "int32", "shape": [1, 2, 2], "data": { "kind": "values", "values": [1, 2, 3, 4] } }
},
"outputs": { "shape": { "dtype": "uint32", "shape": [1], "tolerance": 0 } }
},
{
"name": "ort_negative_start_and_end_int32",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/shape_op_test.cc",
"test": "ShapeOpTest.ShapeOpset15_StartAndEndNegative"
},
"attrs": { "start": -2, "end": -1 },
"inputs": {
"data": { "dtype": "int32", "shape": [1, 2, 2], "data": { "kind": "values", "values": [1, 2, 3, 4] } }
},
"outputs": { "shape": { "dtype": "uint32", "shape": [1], "tolerance": 0 } }
},
{
"name": "ort_float_shape_2x6",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/shape_op_test.cc",
"test": "ShapeOpTest.ShapeTestFloat"
},
"inputs": {
"data": {
"dtype": "float32",
"shape": [2, 6],
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0] }
}
},
"outputs": { "shape": { "dtype": "uint32", "shape": [2], "tolerance": 0 } }
},
{
"name": "ort_bool_exact_shape_2x3",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/shape_op_test.cc",
"test": "ShapeOpTest.ShapeTestBool"
},
"inputs": {
"data": { "dtype": "bool", "shape": [2, 3], "data": { "kind": "values", "values": [1, 1, 0, 0, 1, 0] } }
},
"outputs": { "shape": { "dtype": "uint32", "shape": [2], "tolerance": 0 } }
},
{
"name": "ort_uint32_shape_12x1",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/shape_op_test.cc",
"test": "ShapeOpTest.ShapeTestUint32"
},
"inputs": {
"data": {
"dtype": "uint32",
"shape": [12, 1],
"data": { "kind": "values", "values": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] }
}
},
"outputs": { "shape": { "dtype": "uint32", "shape": [2], "tolerance": 0 } }
},
{
"name": "ort_bool_shape_logical_uint32_2x3",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/shape_op_test.cc",
"test": "ShapeOpTest.ShapeTestBool",
"notes": "Logical bool fixture represented with uint32 storage slots."
},
"inputs": {
"data": { "dtype": "uint32", "shape": [2, 3], "data": { "kind": "values", "values": [1, 1, 0, 0, 1, 0] } }
},
"outputs": { "shape": { "dtype": "uint32", "shape": [2], "tolerance": 0 } }
},
{
"name": "ort_bool_shape_exact_2x3",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/shape_op_test.cc",
"test": "ShapeOpTest.ShapeTestBool"
},
"inputs": {
"data": { "dtype": "bool", "shape": [2, 3], "data": { "kind": "values", "values": [1, 1, 0, 0, 1, 0] } }
},
"outputs": {
"shape": { "dtype": "uint32", "shape": [2], "tolerance": 0, "data": { "kind": "values", "values": [2, 3] } }
}
},
{
"name": "onnx_backend_shape",
"provenance": {
"source": "cmake/external/onnx/onnx/backend/test/data/node/test_shape",
"notes": "ONNX shape/size outputs are int64; this framework uses uint32 shape/index storage."
},
"inputs": { "data": { "dtype": "float32", "shape": [3, 4, 5] } },
"outputs": { "shape": { "dtype": "uint32", "shape": [3], "tolerance": 0 } }
},
{
"name": "onnx_backend_shape_clip_end",
"provenance": {
"source": "cmake/external/onnx/onnx/backend/test/data/node/test_shape_clip_end",
"notes": "ONNX shape/size outputs are int64; this framework uses uint32 shape/index storage."
},
"attrs": { "end": 10 },
"inputs": { "data": { "dtype": "float32", "shape": [3, 4, 5] } },
"outputs": { "shape": { "dtype": "uint32", "shape": [3], "tolerance": 0 } }
},
{
"name": "onnx_backend_shape_clip_start",
"provenance": {
"source": "cmake/external/onnx/onnx/backend/test/data/node/test_shape_clip_start",
"notes": "ONNX shape/size outputs are int64; this framework uses uint32 shape/index storage."
},
"attrs": { "start": -10 },
"inputs": { "data": { "dtype": "float32", "shape": [3, 4, 5] } },
"outputs": { "shape": { "dtype": "uint32", "shape": [3], "tolerance": 0 } }
},
{
"name": "onnx_backend_shape_end_1",
"provenance": {
"source": "cmake/external/onnx/onnx/backend/test/data/node/test_shape_end_1",
"notes": "ONNX shape/size outputs are int64; this framework uses uint32 shape/index storage."
},
"attrs": { "end": 1 },
"inputs": { "data": { "dtype": "float32", "shape": [3, 4, 5] } },
"outputs": { "shape": { "dtype": "uint32", "shape": [1], "tolerance": 0 } }
},
{
"name": "onnx_backend_shape_end_negative_1",
"provenance": {
"source": "cmake/external/onnx/onnx/backend/test/data/node/test_shape_end_negative_1",
"notes": "ONNX shape/size outputs are int64; this framework uses uint32 shape/index storage."
},
"attrs": { "end": -1 },
"inputs": { "data": { "dtype": "float32", "shape": [3, 4, 5] } },
"outputs": { "shape": { "dtype": "uint32", "shape": [2], "tolerance": 0 } }
},
{
"name": "onnx_backend_shape_example",
"provenance": {
"source": "cmake/external/onnx/onnx/backend/test/data/node/test_shape_example",
"notes": "ONNX shape/size outputs are int64; this framework uses uint32 shape/index storage."
},
"inputs": { "data": { "dtype": "float32", "shape": [2, 3] } },
"outputs": { "shape": { "dtype": "uint32", "shape": [2], "tolerance": 0 } }
},
{
"name": "onnx_backend_shape_start_1",
"provenance": {
"source": "cmake/external/onnx/onnx/backend/test/data/node/test_shape_start_1",
"notes": "ONNX shape/size outputs are int64; this framework uses uint32 shape/index storage."
},
"attrs": { "start": 1 },
"inputs": { "data": { "dtype": "float32", "shape": [3, 4, 5] } },
"outputs": { "shape": { "dtype": "uint32", "shape": [2], "tolerance": 0 } }
},
{
"name": "onnx_backend_shape_start_1_end_2",
"provenance": {
"source": "cmake/external/onnx/onnx/backend/test/data/node/test_shape_start_1_end_2",
"notes": "ONNX shape/size outputs are int64; this framework uses uint32 shape/index storage."
},
"attrs": { "end": 2, "start": 1 },
"inputs": { "data": { "dtype": "float32", "shape": [3, 4, 5] } },
"outputs": { "shape": { "dtype": "uint32", "shape": [1], "tolerance": 0 } }
},
{
"name": "onnx_backend_shape_start_1_end_negative_1",
"provenance": {
"source": "cmake/external/onnx/onnx/backend/test/data/node/test_shape_start_1_end_negative_1",
"notes": "ONNX shape/size outputs are int64; this framework uses uint32 shape/index storage."
},
"attrs": { "end": -1, "start": 1 },
"inputs": { "data": { "dtype": "float32", "shape": [3, 4, 5] } },
"outputs": { "shape": { "dtype": "uint32", "shape": [1], "tolerance": 0 } }
},
{
"name": "onnx_backend_shape_start_greater_than_end",
"provenance": {
"source": "cmake/external/onnx/onnx/backend/test/data/node/test_shape_start_greater_than_end",
"notes": "ONNX shape/size outputs are int64; this framework uses uint32 shape/index storage."
},
"attrs": { "end": 1, "start": 2 },
"inputs": { "data": { "dtype": "float32", "shape": [3, 4, 5] } },
"outputs": { "shape": { "dtype": "uint32", "shape": [0], "tolerance": 0 } }
},
{
"name": "onnx_backend_shape_start_negative_1",
"provenance": {
"source": "cmake/external/onnx/onnx/backend/test/data/node/test_shape_start_negative_1",
"notes": "ONNX shape/size outputs are int64; this framework uses uint32 shape/index storage."
},
"attrs": { "start": -1 },
"inputs": { "data": { "dtype": "float32", "shape": [3, 4, 5] } },
"outputs": { "shape": { "dtype": "uint32", "shape": [1], "tolerance": 0 } }
},
{
"name": "ort_caseB_empty",
"inputs": { "data": { "dtype": "float32", "shape": [0, 3, 4], "data": { "kind": "values", "values": [] } } },
"outputs": {
"shape": { "dtype": "uint32", "shape": [3], "data": { "kind": "values", "values": [0, 3, 4] }, "tolerance": 0 }
}
},
{
"name": "rank3_f16",
"inputs": { "data": { "dtype": "float16", "shape": [2, 3, 4] } },
"outputs": { "shape": { "dtype": "uint32", "shape": [3] } }
},
{
"name": "rank6_negative_start_clip",
"attrs": { "start": -7 },
"inputs": { "data": { "dtype": "float32", "shape": [2, 3, 4, 5, 6, 7] } },
"outputs": {
"shape": {
"dtype": "uint32",
"shape": [6],
"tolerance": 0,
"data": { "kind": "values", "values": [2, 3, 4, 5, 6, 7] }
}
}
},
{
"name": "rank6_start_end_middle_negative",
"attrs": { "start": -4, "end": -1 },
"inputs": { "data": { "dtype": "uint32", "shape": [2, 3, 4, 5, 6, 7] } },
"outputs": {
"shape": { "dtype": "uint32", "shape": [3], "tolerance": 0, "data": { "kind": "values", "values": [4, 5, 6] } }
}
},
{
"name": "rank7_full_shape",
"provenance": {
"source": "onnx spec: Shape returns the input tensor dimensions",
"notes": "Small rank-7 sentinel. ORT CPU returns [1,2,1,3,1,4,1]; full_shape is rank-agnostic, and rank8_full_shape covers the band above it."
},
"inputs": { "data": { "dtype": "float32", "shape": [1, 2, 1, 3, 1, 4, 1] } },
"outputs": {
"shape": {
"dtype": "uint32",
"shape": [7],
"tolerance": 0,
"data": { "kind": "values", "values": [1, 2, 1, 3, 1, 4, 1] }
}
}
},
{
"name": "rank8_full_shape",
"inputs": { "data": { "dtype": "float32", "shape": [1, 2, 1, 3, 1, 4, 1, 2] } },
"outputs": {
"shape": {
"dtype": "uint32",
"shape": [8],
"tolerance": 0,
"data": { "kind": "values", "values": [1, 2, 1, 3, 1, 4, 1, 2] }
}
}
}
]
}