| { |
| "op": "ai.onnx.Size", |
| "cases": [ |
| { |
| "name": "int16_rank2_boundaries", |
| "inputs": { |
| "data": { |
| "dtype": "int16", |
| "shape": [2, 3], |
| "data": { "kind": "values", "values": [-32768, -1, 0, 1, 32766, 32767] } |
| } |
| }, |
| "outputs": { |
| "size": { "dtype": "uint32", "shape": [], "tolerance": 0, "data": { "kind": "values", "values": [6] } } |
| } |
| }, |
| { |
| "name": "rank3", |
| "inputs": { "data": { "dtype": "float32", "shape": [2, 3, 4] } }, |
| "outputs": { "size": { "dtype": "uint32", "shape": [] } } |
| }, |
| { |
| "name": "true_scalar_output", |
| "inputs": { "data": { "dtype": "float32", "shape": [2, 0, 4] } }, |
| "outputs": { "size": { "dtype": "uint32", "shape": [], "tolerance": 0 } } |
| }, |
| { |
| "name": "scalar_input_size_one", |
| "inputs": { "data": { "dtype": "float32", "shape": [] } }, |
| "outputs": { "size": { "dtype": "uint32", "shape": [], "tolerance": 0 } } |
| }, |
| { |
| "name": "uint32_rank2", |
| "inputs": { "data": { "dtype": "uint32", "shape": [3, 3], "data": { "kind": "constant", "value": 0 } } }, |
| "outputs": { "size": { "dtype": "uint32", "shape": [], "tolerance": 0 } } |
| }, |
| { |
| "name": "ort_float_1d_1000", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/size_test.cc", |
| "test": "SizeOpTest.Float1000Test" |
| }, |
| "inputs": { "data": { "dtype": "float32", "shape": [1000], "data": { "kind": "constant", "value": 0.0 } } }, |
| "outputs": { "size": { "dtype": "uint32", "shape": [], "tolerance": 0 } } |
| }, |
| { |
| "name": "ort_float_3x3x4", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/size_test.cc", |
| "test": "SizeOpTest.Float3x3x4Test" |
| }, |
| "inputs": { "data": { "dtype": "float32", "shape": [3, 3, 4], "data": { "kind": "constant", "value": 0.0 } } }, |
| "outputs": { "size": { "dtype": "uint32", "shape": [], "tolerance": 0 } } |
| }, |
| { |
| "name": "ort_float_3x3", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/size_test.cc", |
| "test": "SizeOpTest.Float3x3Test" |
| }, |
| "inputs": { "data": { "dtype": "float32", "shape": [3, 3], "data": { "kind": "constant", "value": 0.0 } } }, |
| "outputs": { "size": { "dtype": "uint32", "shape": [], "tolerance": 0 } } |
| }, |
| { |
| "name": "ort_int32_3x3", |
| "provenance": { "source": "onnxruntime/test/providers/cpu/tensor/size_test.cc", "test": "SizeOpTest.Int3x3Test" }, |
| "inputs": { "data": { "dtype": "int32", "shape": [3, 3], "data": { "kind": "constant", "value": 0 } } }, |
| "outputs": { "size": { "dtype": "uint32", "shape": [], "tolerance": 0 } } |
| }, |
| { |
| "name": "ort_int32_scalar", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/size_test.cc", |
| "test": "SizeOpTest.IntScalarTest" |
| }, |
| "inputs": { "data": { "dtype": "int32", "shape": [], "data": { "kind": "values", "values": [0] } } }, |
| "outputs": { "size": { "dtype": "uint32", "shape": [], "tolerance": 0 } } |
| }, |
| { |
| "name": "bool_rank2_size", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/size_test.cc", |
| "test": "SizeOpTest.Int3x3Test", |
| "notes": "Same shape-only Size behavior as ORT's int case, using ONNX-valid bool input values." |
| }, |
| "inputs": { |
| "data": { "dtype": "bool", "shape": [2, 3], "data": { "kind": "values", "values": [1, 0, 1, 1, 0, 0] } } |
| }, |
| "outputs": { |
| "size": { "dtype": "uint32", "shape": [], "data": { "kind": "values", "values": [6] }, "tolerance": 0 } |
| } |
| }, |
| { |
| "name": "ort_int8_3x3_adapted", |
| "provenance": { |
| "source": "onnxruntime/test/providers/cpu/tensor/size_test.cc", |
| "test": "SizeOpTest.Int3x3Test", |
| "notes": "Same shape as ORT's int case, using ONNX-valid int8 payload values." |
| }, |
| "inputs": { |
| "data": { |
| "dtype": "int8", |
| "shape": [3, 3], |
| "data": { "kind": "values", "values": [-4, -3, -2, -1, 0, 1, 2, 3, 4] } |
| } |
| }, |
| "outputs": { "size": { "dtype": "uint32", "shape": [], "tolerance": 0 } } |
| }, |
| { |
| "name": "uint8_zero_sized_product", |
| "inputs": { "data": { "dtype": "uint8", "shape": [2, 0, 5], "data": { "kind": "values", "values": [] } } }, |
| "outputs": { "size": { "dtype": "uint32", "shape": [], "tolerance": 0 } } |
| }, |
| { |
| "name": "onnx_backend_size", |
| "provenance": { |
| "source": "cmake/external/onnx/onnx/backend/test/data/node/test_size", |
| "notes": "ONNX shape/size outputs are int64; this framework uses uint32 shape/index storage." |
| }, |
| "inputs": { "data": { "dtype": "float32", "shape": [3, 4, 5] } }, |
| "outputs": { "size": { "dtype": "uint32", "shape": [], "tolerance": 0 } } |
| }, |
| { |
| "name": "onnx_backend_size_example", |
| "provenance": { |
| "source": "cmake/external/onnx/onnx/backend/test/data/node/test_size_example", |
| "notes": "ONNX shape/size outputs are int64; this framework uses uint32 shape/index storage." |
| }, |
| "inputs": { "data": { "dtype": "float32", "shape": [2, 3] } }, |
| "outputs": { "size": { "dtype": "uint32", "shape": [], "tolerance": 0 } } |
| }, |
| { |
| "name": "ort_caseB_empty", |
| "inputs": { "data": { "dtype": "float32", "shape": [0, 3, 4], "data": { "kind": "values", "values": [] } } }, |
| "outputs": { |
| "size": { "dtype": "uint32", "shape": [], "data": { "kind": "values", "values": [0] }, "tolerance": 0 } |
| } |
| }, |
| { |
| "name": "rank3_f16", |
| "inputs": { "data": { "dtype": "float16", "shape": [2, 3, 4] } }, |
| "outputs": { "size": { "dtype": "uint32", "shape": [] } } |
| }, |
| { |
| "name": "rank6_numel", |
| "inputs": { "data": { "dtype": "float32", "shape": [2, 3, 4, 5, 6, 7] } }, |
| "outputs": { |
| "size": { "dtype": "uint32", "shape": [], "tolerance": 0, "data": { "kind": "values", "values": [5040] } } |
| } |
| } |
| ] |
| } |
|
|