ai.onnx.Round / build /webgpu /test.json
Xenova's picture
Xenova HF Staff
sync 2e7068faf55e
e1b1cf9 verified
Raw
History Blame
6.24 kB
{
"op": "ai.onnx.Round",
"cases": [
{
"name": "ties_to_even",
"inputs": {
"x": {
"dtype": "float32",
"shape": [8],
"data": { "kind": "values", "values": [-2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 2.1, 2.9] }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [8] } }
},
{
"name": "backend_mixed_values",
"provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_round" },
"inputs": {
"x": {
"dtype": "float32",
"shape": [15],
"data": {
"kind": "values",
"values": [0.1, 0.5, 0.9, 1.2, 1.5, 1.8, 2.3, 2.5, 2.7, -1.1, -1.5, -1.9, -2.2, -2.5, -2.8]
}
}
},
"outputs": { "y": { "dtype": "float32", "shape": [15], "tolerance": 0 } }
},
{
"name": "f16_ties_to_even",
"inputs": {
"x": {
"dtype": "float16",
"shape": [10],
"data": { "kind": "values", "values": [-4.5, -3.5, -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 3.5, 4.5] }
}
},
"outputs": { "y": { "dtype": "float16", "shape": [10], "tolerance": 0 } }
},
{
"name": "f16_nonfinite_and_near_half_values",
"inputs": {
"x": {
"dtype": "float16",
"shape": [8],
"data": {
"kind": "values",
"values": ["-Infinity", -2.5, -0.499755859375, 0.0, 0.0, 0.499755859375, "Infinity", "NaN"]
}
}
},
"outputs": { "y": { "dtype": "float16", "shape": [8], "tolerance": 0, "allowNaN": true } }
},
{
"name": "ort_float_fractional_mix",
"provenance": {
"source": "onnxruntime/test/providers/cpu/math/round_test.cc",
"test": "RoundTest.SimpleTestFloat"
},
"inputs": {
"x": { "dtype": "float32", "shape": [5], "data": { "kind": "values", "values": [0.9, 2.5, 2.3, 1.5, -4.5] } }
},
"outputs": { "y": { "dtype": "float32", "shape": [5], "tolerance": 0 } }
},
{
"name": "ort_float16_fractional_mix",
"provenance": {
"source": "onnxruntime/test/providers/cpu/math/round_test.cc",
"test": "RoundTest.SimpleTestFloat16"
},
"inputs": {
"x": { "dtype": "float16", "shape": [5], "data": { "kind": "values", "values": [0.9, 2.5, 2.3, 1.5, -4.5] } }
},
"outputs": { "y": { "dtype": "float16", "shape": [5], "tolerance": 0 } }
},
{
"name": "rank0_scalar_half_tie_even",
"provenance": {
"source": "onnxruntime/test/providers/cpu/math/round_test.cc",
"test": "RoundTest.SimpleTestFloat",
"notes": "Additional node-level edge for rank-0 tensors and half-to-even scalar behavior."
},
"inputs": { "x": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [2.5] } } },
"outputs": {
"y": { "dtype": "float32", "shape": [], "tolerance": 0, "data": { "kind": "values", "values": [2.0] } }
}
},
{
"name": "large_exact_half_ties_to_even",
"provenance": {
"source": "onnxruntime/test/providers/cpu/math/round_test.cc",
"test": "RoundTest.SimpleTestFloat",
"notes": "Half-way values at larger magnitudes remain exactly representable here and must round to the even integer, not away from zero."
},
"inputs": {
"x": {
"dtype": "float32",
"shape": [6],
"data": { "kind": "values", "values": [-1048577.5, -1048576.5, -1024.5, 1024.5, 1048576.5, 1048577.5] }
}
},
"outputs": {
"y": {
"dtype": "float32",
"shape": [6],
"tolerance": 0,
"data": { "kind": "values", "values": [-1048578.0, -1048576.0, -1024.0, 1024.0, 1048576.0, 1048578.0] }
}
}
},
{
"name": "f16_negative_positive_tie_grid",
"provenance": {
"source": "onnxruntime/test/providers/cpu/math/round_test.cc",
"test": "RoundTest.SimpleTestFloat16",
"notes": "Extended float16 tie grid across negative and positive odd/even integer neighbors."
},
"inputs": {
"x": {
"dtype": "float16",
"shape": [8],
"data": { "kind": "values", "values": [-7.5, -6.5, -5.5, -4.5, 4.5, 5.5, 6.5, 7.5] }
}
},
"outputs": {
"y": {
"dtype": "float16",
"shape": [8],
"tolerance": 0,
"data": { "kind": "values", "values": [-8.0, -6.0, -6.0, -4.0, 4.0, 6.0, 6.0, 8.0] }
}
}
},
{
"name": "nonfinite_and_signed_zero",
"inputs": {
"x": {
"dtype": "float32",
"shape": [6],
"data": { "kind": "values", "values": ["-Infinity", 0.0, 0.0, 0.49999997, "Infinity", "NaN"] }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [6], "tolerance": 0, "allowNaN": true } }
},
{
"name": "zero_size_noop",
"inputs": { "x": { "dtype": "float32", "shape": [0], "data": { "kind": "values", "values": [] } } },
"outputs": { "y": { "dtype": "float32", "shape": [0], "tolerance": 0 } }
},
{
"name": "f32_large_integral_noop_vec4",
"inputs": {
"x": {
"dtype": "float32",
"shape": [8],
"data": { "kind": "values", "values": [3.5, 4.5, 5.5, 6.5, -3.5, -4.5, -5.5, -6.5] }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [8], "tolerance": 0 } },
"provenance": {
"notes": "Half-ties at odd/even integer boundaries in vec4 path; tests round-half-to-even vs WGSL builtin round() which rounds away from zero."
}
},
{
"name": "f32_scalar_tail_4095",
"provenance": {
"notes": "Compact sibling for the large scalar-fallback Round benchmark; odd numel forces the non-vec4 elementwise path over a sustained fractional range."
},
"inputs": {
"x": {
"dtype": "float32",
"shape": [4095],
"data": { "kind": "fillFloat32", "sinStep": 0.013, "cosStep": 0.027, "scale": 10.0 }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [4095], "tolerance": 0 } }
}
]
}