{ "op": "ai.onnx.Log", "cases": [ { "name": "vector_positive", "inputs": { "x": { "dtype": "float32", "shape": [32], "data": { "kind": "constant", "value": 2.5 } } }, "outputs": { "y": { "dtype": "float32", "shape": [32], "tolerance": 0.000001 } } }, { "name": "rank0_scalar_positive", "inputs": { "x": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [4.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [], "tolerance": 0.000001 } } }, { "name": "domain_edges_zero_negative_inf", "inputs": { "x": { "dtype": "float32", "shape": [6], "data": { "kind": "values", "values": [0.0, -1.0, -5.0, "Infinity", "NaN", 1.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [6], "tolerance": 0.000001, "allowNaN": true } } }, { "name": "f32_positive_subnormal_inputs_finite_logs_vec4_gpu_gap", "skipGpu": { "category": "permanent", "reason": "Portable WGSL floating-point semantics do not guarantee preservation of the subnormal values required by this fixture. Backend evidence: WebGPU/Metal flushes subnormals to zero (f32 and f16); the kernel cannot preserve denormal inputs/outputs bit-exactly." }, "provenance": { "source": "onnxruntime/test/providers/cpu/math/element_wise_ops_test.cc", "test": "MathOpTest.Log", "notes": "Positive subnormal inputs are inside Log's domain and should produce finite large negative values; flushing them to zero produces -Infinity." }, "inputs": { "x": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [1e-45, 1e-40, 1e-39, 1e-38] } } }, "outputs": { "y": { "dtype": "float32", "shape": [4], "tolerance": 0.000001 } } }, { "name": "f32_positive_subnormal_inputs_finite_logs_scalar_gpu_gap", "skipGpu": { "category": "permanent", "reason": "Portable WGSL floating-point semantics do not guarantee preservation of the subnormal values required by this fixture. Backend evidence: WebGPU/Metal flushes subnormals to zero (f32 and f16); the kernel cannot preserve denormal inputs/outputs bit-exactly." }, "provenance": { "source": "onnxruntime/test/providers/cpu/math/element_wise_ops_test.cc", "test": "MathOpTest.Log", "notes": "Scalar-path companion for positive subnormal Log inputs." }, "inputs": { "x": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [1e-45, 1e-40, 1e-38] } } }, "outputs": { "y": { "dtype": "float32", "shape": [3], "tolerance": 0.000001 } } }, { "name": "f16_positive_values", "inputs": { "x": { "dtype": "float16", "shape": [5], "data": { "kind": "values", "values": [0.25, 0.5, 1.0, 2.0, 8.0] } } }, "outputs": { "y": { "dtype": "float16", "shape": [5], "tolerance": 0.002 } } }, { "name": "subnormal_positive_f32", "inputs": { "x": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [1.17549435e-38, 1e-37, 1e-20, 1e-10] } } }, "outputs": { "y": { "dtype": "float32", "shape": [4], "tolerance": 0.00001 } } }, { "name": "positive_subnormal_values_gpu_gap", "skipGpu": { "category": "permanent", "reason": "Portable WGSL floating-point semantics do not guarantee preservation of the subnormal values required by this fixture. Backend evidence: WebGPU/Metal flushes subnormals to zero (f32 and f16); the kernel cannot preserve denormal inputs/outputs bit-exactly." }, "provenance": { "source": "onnxruntime/test/providers/cpu/math/element_wise_ops_test.cc", "test": "MathOpTest.Log", "notes": "Positive subnormal inputs are valid for Log; flushing them to zero turns finite logs into -Infinity." }, "inputs": { "x": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [1e-45, 1e-40, 1e-39, 1e-38] } } }, "outputs": { "y": { "dtype": "float32", "shape": [4], "tolerance": 0.00001 } } }, { "name": "positive_subnormal_values_scalar_gpu_gap", "skipGpu": { "category": "permanent", "reason": "Portable WGSL floating-point semantics do not guarantee preservation of the subnormal values required by this fixture. Backend evidence: WebGPU/Metal flushes subnormals to zero (f32 and f16); the kernel cannot preserve denormal inputs/outputs bit-exactly." }, "provenance": { "source": "onnxruntime/test/providers/cpu/math/element_wise_ops_test.cc", "test": "MathOpTest.Log", "notes": "Scalar-path companion: positive subnormal inputs are valid and should produce finite logs." }, "inputs": { "x": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [1e-45, 1e-40, 1e-39] } } }, "outputs": { "y": { "dtype": "float32", "shape": [3], "tolerance": 0.00001 } } }, { "name": "ort_float_2x2", "provenance": { "source": "onnxruntime/test/providers/cpu/math/element_wise_ops_test.cc", "test": "MathOpTest.Log" }, "inputs": { "x": { "dtype": "float32", "shape": [2, 2], "data": { "kind": "values", "values": [1.0, 2.0, 5.0, 10.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [2, 2], "tolerance": 0.000001 } } }, { "name": "ort_float16_2x2_projection", "provenance": { "source": "onnxruntime/test/providers/cpu/math/element_wise_ops_test.cc", "test": "MathOpTest.Log", "notes": "Float16 projection of ORT's float Log node values." }, "inputs": { "x": { "dtype": "float16", "shape": [2, 2], "data": { "kind": "values", "values": [1.0, 2.0, 5.0, 10.0] } } }, "outputs": { "y": { "dtype": "float16", "shape": [2, 2], "tolerance": 0.002 } } }, { "name": "signed_zero_negative_infinity_domain", "provenance": { "source": "onnxruntime/test/providers/cpu/math/element_wise_ops_test.cc", "test": "MathOpTest.Log", "notes": "Additional node-level domain boundary: log(+/-0) is -Infinity, negative finite and -Infinity inputs produce NaN, and log(+Infinity) is +Infinity." }, "inputs": { "x": { "dtype": "float32", "shape": [7], "data": { "kind": "values", "values": [0.0, 0.0, -1.0, "-Infinity", 1.0, "Infinity", "NaN"] } } }, "outputs": { "y": { "dtype": "float32", "shape": [7], "tolerance": 0, "allowNaN": true, "data": { "kind": "values", "values": ["-Infinity", "-Infinity", "NaN", "NaN", 0.0, "Infinity", "NaN"] } } } }, { "name": "onnx_backend_example", "provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_log_example" }, "inputs": { "x": { "dtype": "float32", "shape": [2], "data": { "kind": "values", "values": [1.0, 10.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [2], "tolerance": 0.000001 } } }, { "name": "onnx_backend_log", "provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_log" }, "inputs": { "x": { "dtype": "float32", "shape": [3, 4, 5], "data": { "kind": "values", "values": [5.8360395431518555, 1.4920592308044434, 2.6610958576202393, 9.401724815368652, 6.472471237182617, 0.37633413076400757, 2.5859384536743164, 0.859540581703186, 0.901929497718811, 1.507719874382019, 1.1549344062805176, 4.281371593475342, 2.1404964923858643, 1.1293870210647583, 1.5587172508239746, 1.3960884809494019, 4.4552321434021, 0.8145183324813843, 1.3676141500473022, 0.4256679117679596, 0.07784857600927353, 1.9224849939346313, 2.3736672401428223, 0.47608205676078796, 9.677026748657227, 0.23354846239089966, 1.0468215942382812, 0.8292912244796753, 4.6310296058654785, 4.346446990966797, 1.1675965785980225, 1.4596000909805298, 0.4115660488605499, 0.1379593163728714, 0.706160843372345, 1.1692341566085815, 3.4222238063812256, 3.3280277252197266, 0.6788691878318787, 0.7391142249107361, 0.3504444658756256, 0.24170967936515808, 0.18154163658618927, 7.034140110015869, 0.6007044911384583, 0.6452777981758118, 0.285705029964447, 2.176004409790039, 0.1991100162267685, 0.8083661198616028, 0.4084170162677765, 1.4724129438400269, 0.6000123023986816, 0.3070845305919647, 0.9722112417221069, 1.5346952676773071, 1.0687793493270874, 1.3531996011734009, 0.5302948355674744, 0.6957665085792542] } } }, "outputs": { "y": { "dtype": "float32", "shape": [3, 4, 5], "tolerance": 0.00001, "allowNaN": true } } }, { "name": "onnx_backend_log_example", "provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_log_example" }, "inputs": { "x": { "dtype": "float32", "shape": [2], "data": { "kind": "values", "values": [1.0, 10.0] } } }, "outputs": { "y": { "dtype": "float32", "shape": [2], "tolerance": 0.00001 } } }, { "name": "empty_input_zero_dim", "inputs": { "x": { "dtype": "float32", "shape": [0], "data": { "kind": "values", "values": [] } } }, "outputs": { "y": { "dtype": "float32", "shape": [0], "tolerance": 0 } } }, { "name": "f16_domain_edges_scalar_path", "inputs": { "x": { "dtype": "float16", "shape": [5], "data": { "kind": "values", "values": [0.0, -1.0, "-Infinity", "Infinity", 1.0] } } }, "outputs": { "y": { "dtype": "float16", "shape": [5], "allowNaN": true } }, "tolerance": 0.001 }, { "name": "f16_domain_edges_vec4_path", "inputs": { "x": { "dtype": "float16", "shape": [4], "data": { "kind": "values", "values": [0.0, -2.0, "Infinity", 1.0] } } }, "outputs": { "y": { "dtype": "float16", "shape": [4], "allowNaN": true } }, "tolerance": 0.001 } ] }