ai.onnx.IsNaN / build /webgpu /test.json
Xenova's picture
Xenova HF Staff
sync 2e7068faf55e
34e5514 verified
Raw
History Blame
7.13 kB
{
"op": "ai.onnx.IsNaN",
"cases": [
{
"name": "f32_nan_inf_finite",
"inputs": {
"x": {
"dtype": "float32",
"shape": [2, 4],
"data": { "kind": "values", "values": [1.0, "NaN", "Infinity", "-Infinity", 0.0, "NaN", -5.5, 3.25] }
}
},
"outputs": { "y": { "dtype": "bool", "shape": [2, 4] } }
},
{
"name": "f16_nan_values",
"inputs": {
"x": {
"dtype": "float16",
"shape": [2, 3],
"data": { "kind": "values", "values": ["NaN", 0.0, 1.0, -2.0, "NaN", "Infinity"] }
}
},
"outputs": { "y": { "dtype": "bool", "shape": [2, 3] } }
},
{
"name": "scalar_false",
"inputs": { "x": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [42.0] } } },
"outputs": { "y": { "dtype": "bool", "shape": [] } }
},
{
"name": "scalar_true",
"inputs": { "x": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": ["NaN"] } } },
"outputs": { "y": { "dtype": "bool", "shape": [], "tolerance": 0 } }
},
{
"name": "zero_size_noop",
"inputs": { "x": { "dtype": "float16", "shape": [0, 3], "data": { "kind": "values", "values": [] } } },
"outputs": { "y": { "dtype": "bool", "shape": [0, 3], "tolerance": 0 } }
},
{
"name": "ort_float_opset20_2x2",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/isnan_test.cc",
"test": "IsNaNOpTest.IsNaNFloat20"
},
"inputs": {
"x": { "dtype": "float32", "shape": [2, 2], "data": { "kind": "values", "values": [1.0, "NaN", 2.0, "NaN"] } }
},
"outputs": { "y": { "dtype": "bool", "shape": [2, 2], "tolerance": 0 } }
},
{
"name": "onnx_backend_float_specials",
"provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_isnan", "test": "test_isnan" },
"inputs": {
"x": {
"dtype": "float32",
"shape": [6],
"data": { "kind": "values", "values": [-1.2, "NaN", "Infinity", 2.8, "-Infinity", "Infinity"] }
}
},
"outputs": { "y": { "dtype": "bool", "shape": [6], "tolerance": 0 } }
},
{
"name": "ort_float16_opset20_2x2",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/isnan_test.cc",
"test": "IsNaNOpTest.IsNaNFloat16_20"
},
"inputs": {
"x": { "dtype": "float16", "shape": [2, 2], "data": { "kind": "values", "values": [1.0, "NaN", 2.0, "NaN"] } }
},
"outputs": { "y": { "dtype": "bool", "shape": [2, 2], "tolerance": 0 } }
},
{
"name": "onnx_backend_float16_specials",
"provenance": {
"source": "cmake/external/onnx/onnx/backend/test/data/node/test_isnan_float16",
"test": "test_isnan_float16"
},
"inputs": {
"x": {
"dtype": "float16",
"shape": [6],
"data": { "kind": "values", "values": [-1.2, "NaN", "Infinity", 2.8, "-Infinity", "Infinity"] }
}
},
"outputs": { "y": { "dtype": "bool", "shape": [6], "tolerance": 0 } }
},
{
"name": "onnx_backend_isnan",
"provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_isnan" },
"inputs": {
"x": {
"dtype": "float32",
"shape": [6],
"data": {
"kind": "values",
"values": [-1.2000000476837158, "NaN", "Infinity", 2.799999952316284, "-Infinity", "Infinity"]
}
}
},
"outputs": { "y": { "dtype": "bool", "shape": [6], "tolerance": 0 } }
},
{
"name": "onnx_backend_isnan_float16",
"provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_isnan_float16" },
"inputs": {
"x": {
"dtype": "float16",
"shape": [6],
"data": {
"kind": "values",
"values": [-1.2001953125, "NaN", "Infinity", 2.80078125, "-Infinity", "Infinity"]
}
}
},
"outputs": { "y": { "dtype": "bool", "shape": [6], "tolerance": 0 } }
},
{
"name": "ort_bool_exact_empty_float16_zero_dim",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/isnan_test.cc",
"test": "IsNaNOpTest.IsNaNFloat16_20",
"notes": "Zero-dimension projection of ORT's float16 IsNaN coverage."
},
"inputs": { "x": { "dtype": "float16", "shape": [0, 2], "data": { "kind": "values", "values": [] } } },
"outputs": { "y": { "dtype": "bool", "shape": [0, 2], "tolerance": 0 } }
},
{
"name": "f32_vec4_mixed_nan_16",
"provenance": {
"notes": "Compact aligned f32 vec4 sibling for the 1M IsNaN benchmark; keeps mixed NaN/Inf/finite lanes on a same-layout vectorized path."
},
"inputs": {
"x": {
"dtype": "float32",
"shape": [16],
"data": {
"kind": "values",
"values": ["NaN", 0.0, "Infinity", "-Infinity", 1.5, "NaN", -2.0, 3.0, 4.0, 5.0, "NaN", 6.0, "-Infinity", 7.0, 8.0, "NaN"]
}
}
},
"outputs": {
"y": {
"dtype": "bool",
"shape": [16],
"tolerance": 0,
"data": { "kind": "values", "values": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] }
}
}
},
{
"name": "f16_all_nan_vec4",
"inputs": {
"x": { "dtype": "float16", "shape": [4], "data": { "kind": "values", "values": ["NaN", "NaN", "NaN", "NaN"] } }
},
"outputs": {
"y": { "dtype": "bool", "shape": [4], "tolerance": 0, "data": { "kind": "values", "values": [1, 1, 1, 1] } }
}
},
{
"name": "f16_mixed_nan_non_nan_vec4",
"inputs": {
"x": { "dtype": "float16", "shape": [4], "data": { "kind": "values", "values": ["NaN", 1.0, -1.0, "NaN"] } }
},
"outputs": {
"y": { "dtype": "bool", "shape": [4], "tolerance": 0, "data": { "kind": "values", "values": [1, 0, 0, 1] } }
}
},
{
"name": "rank7_vec4",
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 1, 1, 1, 1, 8],
"data": { "kind": "values", "values": ["NaN", 1.0, "Infinity", "-Infinity", 0.0, "NaN", 2.0, "NaN"] }
}
},
"outputs": { "y": { "dtype": "bool", "shape": [1, 1, 1, 1, 1, 1, 8], "tolerance": 0 } },
"provenance": {
"notes": "Rank-7 flat input on the shared vec4 unary kernel; rank is unused (sibling ops impose no rank cap). Covers the regime the removed 'ranks.x <= 6' guard rejected."
}
},
{
"name": "rank7_scalar",
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 1, 1, 1, 1, 3],
"data": { "kind": "values", "values": ["NaN", 1.0, "NaN"] }
}
},
"outputs": { "y": { "dtype": "bool", "shape": [1, 1, 1, 1, 1, 1, 3], "tolerance": 0 } },
"provenance": { "notes": "Rank-7 input, numel 3 routes to the scalar elementwise unary variant." }
}
]
}