Download build/webgpu/test.json from webgpu-kernels/ai.onnx.Cast: direct link, hf CLI and curl.
- Browser
- Download file 27 kB
-
https://huggingface.co/kernels/webgpu-kernels/ai.onnx.Cast/resolve/v1/build/webgpu/test.json
- Command line
-
hf download hf://webgpu-kernels/ai.onnx.Cast@v1/build/webgpu/test.json
-
curl -L -o test.json https://huggingface.co/kernels/webgpu-kernels/ai.onnx.Cast/resolve/v1/build/webgpu/test.json
27 kB
| { | |
| "fixtureArrays": { | |
| "ort_nonstring_rank4_float32_to_uint32_input_x": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] | |
| }, | |
| "cases": [ | |
| { | |
| "name": "float32_to_uint32", | |
| "attrs": { "to": 12 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [7], | |
| "data": { "kind": "values", "values": [0.1, 1.9, 2.2, 5.8, 7.0, 9.6, 12.4] } | |
| } | |
| }, | |
| "outputs": { "y": { "dtype": "uint32", "shape": [7], "tolerance": 0 } } | |
| }, | |
| { | |
| "name": "uint32_to_float32_large_values", | |
| "attrs": { "to": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "uint32", | |
| "shape": [6], | |
| "data": { "kind": "values", "values": [0, 1, 255, 65535, 16777216, 4294967295] } | |
| } | |
| }, | |
| "outputs": { "y": { "dtype": "float32", "shape": [6], "tolerance": 0 } } | |
| }, | |
| { | |
| "name": "float32_to_float16_rounding", | |
| "attrs": { "to": 10 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [8], | |
| "data": { | |
| "kind": "values", | |
| "values": [-65504.0, -3.14159, 0.0, 0.0, 0.33325195, 1.0009766, 123.4375, 65504.0] | |
| } | |
| } | |
| }, | |
| "outputs": { "y": { "dtype": "float16", "shape": [8], "tolerance": 0.001 } } | |
| }, | |
| { | |
| "name": "float32_to_float16_overflow_and_nonfinite", | |
| "attrs": { "to": 10 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [8], | |
| "data": { | |
| "kind": "values", | |
| "values": [65504.0, 65520.0, 70000.0, -65504.0, -65520.0, -70000.0, "Infinity", "NaN"] | |
| } | |
| } | |
| }, | |
| "outputs": { "y": { "dtype": "float16", "shape": [8], "tolerance": 0, "allowNaN": true } } | |
| }, | |
| { | |
| "name": "ort_float32_to_int32_truncates_toward_zero", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/tensor/cast_op_test.cc", | |
| "test": "CastOpTest.NonStringTypes", | |
| "notes": "Finite float32 values exercise truncation toward zero when cast to signed int32." | |
| }, | |
| "attrs": { "to": 6 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [2, 3], | |
| "data": { "kind": "values", "values": [1.0, 2.9, -3.0, 0.0, 100.0, -0.5] } | |
| } | |
| }, | |
| "outputs": { "y": { "dtype": "int32", "shape": [2, 3], "tolerance": 0 } } | |
| }, | |
| { | |
| "name": "ort_int32_to_float32_signed_values", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/tensor/cast_op_test.cc", | |
| "test": "CastOpTest.NonStringTypes", | |
| "notes": "Signed int32 input path from ORT's broad non-string Cast matrix." | |
| }, | |
| "attrs": { "to": 1 }, | |
| "inputs": { | |
| "x": { "dtype": "int32", "shape": [2, 3], "data": { "kind": "values", "values": [1, 2, -3, 0, 100, -7] } } | |
| }, | |
| "outputs": { "y": { "dtype": "float32", "shape": [2, 3], "tolerance": 0 } } | |
| }, | |
| { | |
| "name": "ort_float16_to_int32_truncates_toward_zero", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/tensor/cast_op_test.cc", | |
| "test": "CastOpTest.NonStringTypes", | |
| "notes": "Exactly representable float16 values exercise truncation toward zero when cast to signed int32." | |
| }, | |
| "attrs": { "to": 6 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float16", | |
| "shape": [2, 3], | |
| "data": { "kind": "values", "values": [1.0, 2.5, -3.0, 0.0, 100.0, -0.5] } | |
| } | |
| }, | |
| "outputs": { "y": { "dtype": "int32", "shape": [2, 3], "tolerance": 0 } } | |
| }, | |
| { | |
| "name": "ort_int32_to_float16_signed_values", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/tensor/cast_op_test.cc", | |
| "test": "CastOpTest.NonStringTypes", | |
| "notes": "Signed int32 values exercise conversion to representable float16 results." | |
| }, | |
| "attrs": { "to": 10 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "int32", | |
| "shape": [2, 2, 2], | |
| "data": { "kind": "values", "values": [-8, 7, 0, -1, 3, -5, 6, 2] } | |
| } | |
| }, | |
| "outputs": { "y": { "dtype": "float16", "shape": [2, 2, 2], "tolerance": 0.001 } } | |
| }, | |
| { | |
| "name": "ort_uint32_to_int32_in_range", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/tensor/cast_op_test.cc", | |
| "test": "CastOpTest.NonStringTypes", | |
| "notes": "Unsigned-to-signed subset kept within exactly representable int32 range." | |
| }, | |
| "attrs": { "to": 6 }, | |
| "inputs": { | |
| "x": { "dtype": "uint32", "shape": [6], "data": { "kind": "values", "values": [0, 1, 127, 255, 4096, 65535] } } | |
| }, | |
| "outputs": { "y": { "dtype": "int32", "shape": [6], "tolerance": 0 } } | |
| }, | |
| { | |
| "name": "ort_int32_to_uint32_non_negative", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/tensor/cast_op_test.cc", | |
| "test": "CastOpTest.NonStringTypes", | |
| "notes": "Signed-to-unsigned subset avoids narrowing/wrapping ambiguity." | |
| }, | |
| "attrs": { "to": 12 }, | |
| "inputs": { | |
| "x": { "dtype": "int32", "shape": [6], "data": { "kind": "values", "values": [0, 1, 127, 255, 4096, 65535] } } | |
| }, | |
| "outputs": { "y": { "dtype": "uint32", "shape": [6], "tolerance": 0 } } | |
| }, | |
| { | |
| "name": "float16_to_float32_non_finite", | |
| "attrs": { "to": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float16", | |
| "shape": [6], | |
| "data": { "kind": "values", "values": ["NaN", "-Infinity", 0.0, 0.0, 1.5, "Infinity"] } | |
| } | |
| }, | |
| "outputs": { "y": { "dtype": "float32", "shape": [6], "tolerance": 0.000001, "allowNaN": true } } | |
| }, | |
| { | |
| "name": "zero_sized_float32_to_uint32", | |
| "attrs": { "to": 12 }, | |
| "inputs": { "x": { "dtype": "float32", "shape": [2, 0], "data": { "kind": "values", "values": [] } } }, | |
| "outputs": { "y": { "dtype": "uint32", "shape": [2, 0], "tolerance": 0 } } | |
| }, | |
| { | |
| "name": "ort_empty_int32_to_float32", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/tensor/cast_op_test.cc", | |
| "test": "CastOpTest.Int32ToInt4x2EmptyTensor", | |
| "notes": "An empty int32 input produces an empty float32 output without dispatch." | |
| }, | |
| "attrs": { "to": 1 }, | |
| "inputs": { "x": { "dtype": "int32", "shape": [0], "data": { "kind": "values", "values": [] } } }, | |
| "outputs": { "y": { "dtype": "float32", "shape": [0], "tolerance": 0 } } | |
| }, | |
| { | |
| "name": "ort_empty_float16_to_int32", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/tensor/cast_op_test.cc", | |
| "test": "CastOpTest.Int32ToInt2x4EmptyTensor", | |
| "notes": "An empty float16 input produces an empty int32 output without dispatch." | |
| }, | |
| "attrs": { "to": 6 }, | |
| "inputs": { "x": { "dtype": "float16", "shape": [2, 0, 3], "data": { "kind": "values", "values": [] } } }, | |
| "outputs": { "y": { "dtype": "int32", "shape": [2, 0, 3], "tolerance": 0 } } | |
| }, | |
| { | |
| "name": "ort_nonstring_rank4_float32_to_uint32", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/tensor/cast_op_test.cc", | |
| "test": "CastOpTest.NonStringTypes", | |
| "notes": "A rank-4 float32 tensor exercises conversion to uint32." | |
| }, | |
| "attrs": { "to": 12 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [2, 3, 2, 2], | |
| "data": { | |
| "kind": "values", | |
| "values": { "$ref": "#/fixtureArrays/ort_nonstring_rank4_float32_to_uint32_input_x" } | |
| } | |
| } | |
| }, | |
| "outputs": { "y": { "dtype": "uint32", "shape": [2, 3, 2, 2], "tolerance": 0 } } | |
| }, | |
| { | |
| "name": "ort_nonstring_rank4_uint32_to_float32", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/tensor/cast_op_test.cc", | |
| "test": "CastOpTest.NonStringTypes", | |
| "notes": "A rank-4 uint32 tensor exercises conversion to float32." | |
| }, | |
| "attrs": { "to": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "uint32", | |
| "shape": [2, 3, 2, 2], | |
| "data": { | |
| "kind": "values", | |
| "values": { "$ref": "#/fixtureArrays/ort_nonstring_rank4_float32_to_uint32_input_x" } | |
| } | |
| } | |
| }, | |
| "outputs": { "y": { "dtype": "float32", "shape": [2, 3, 2, 2], "tolerance": 0 } } | |
| }, | |
| { | |
| "name": "ort_nonstring_rank4_int32_to_float16", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/tensor/cast_op_test.cc", | |
| "test": "CastOpTest.NonStringTypes", | |
| "notes": "A rank-4 int32 tensor exercises conversion to float16." | |
| }, | |
| "attrs": { "to": 10 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "int32", | |
| "shape": [2, 3, 2, 2], | |
| "data": { | |
| "kind": "values", | |
| "values": { "$ref": "#/fixtureArrays/ort_nonstring_rank4_float32_to_uint32_input_x" } | |
| } | |
| } | |
| }, | |
| "outputs": { "y": { "dtype": "float16", "shape": [2, 3, 2, 2], "tolerance": 0.001 } } | |
| }, | |
| { | |
| "name": "ort_nonstring_rank4_float32_to_float16", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/tensor/cast_op_test.cc", | |
| "test": "CastOpTest.NonStringTypes", | |
| "notes": "A rank-4 float32 tensor exercises conversion to float16." | |
| }, | |
| "attrs": { "to": 10 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [2, 3, 2, 2], | |
| "data": { | |
| "kind": "values", | |
| "values": { "$ref": "#/fixtureArrays/ort_nonstring_rank4_float32_to_uint32_input_x" } | |
| } | |
| } | |
| }, | |
| "outputs": { "y": { "dtype": "float16", "shape": [2, 3, 2, 2], "tolerance": 0.001 } } | |
| }, | |
| { | |
| "name": "ort_nonstring_rank4_float16_to_float32", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/tensor/cast_op_test.cc", | |
| "test": "CastOpTest.NonStringTypes", | |
| "notes": "A rank-4 float16 tensor exercises conversion to float32." | |
| }, | |
| "attrs": { "to": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float16", | |
| "shape": [2, 3, 2, 2], | |
| "data": { | |
| "kind": "values", | |
| "values": { "$ref": "#/fixtureArrays/ort_nonstring_rank4_float32_to_uint32_input_x" } | |
| } | |
| } | |
| }, | |
| "outputs": { "y": { "dtype": "float32", "shape": [2, 3, 2, 2], "tolerance": 0 } } | |
| }, | |
| { | |
| "name": "ort_nonstring_rank4_float16_to_uint32", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/tensor/cast_op_test.cc", | |
| "test": "CastOpTest.NonStringTypes", | |
| "notes": "A rank-4 float16 tensor with non-negative values exercises conversion to uint32." | |
| }, | |
| "attrs": { "to": 12 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float16", | |
| "shape": [2, 3, 2, 2], | |
| "data": { | |
| "kind": "values", | |
| "values": { "$ref": "#/fixtureArrays/ort_nonstring_rank4_float32_to_uint32_input_x" } | |
| } | |
| } | |
| }, | |
| "outputs": { "y": { "dtype": "uint32", "shape": [2, 3, 2, 2], "tolerance": 0 } } | |
| }, | |
| { | |
| "name": "ort_nonstring_rank4_uint32_to_float16", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/tensor/cast_op_test.cc", | |
| "test": "CastOpTest.NonStringTypes", | |
| "notes": "A rank-4 uint32 tensor exercises conversion to float16." | |
| }, | |
| "attrs": { "to": 10 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "uint32", | |
| "shape": [2, 3, 2, 2], | |
| "data": { | |
| "kind": "values", | |
| "values": { "$ref": "#/fixtureArrays/ort_nonstring_rank4_float32_to_uint32_input_x" } | |
| } | |
| } | |
| }, | |
| "outputs": { "y": { "dtype": "float16", "shape": [2, 3, 2, 2], "tolerance": 0.001 } } | |
| }, | |
| { | |
| "name": "ort_nonstring_rank4_int32_to_uint32", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/tensor/cast_op_test.cc", | |
| "test": "CastOpTest.NonStringTypes", | |
| "notes": "A rank-4 int32 tensor with non-negative values exercises conversion to uint32." | |
| }, | |
| "attrs": { "to": 12 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "int32", | |
| "shape": [2, 3, 2, 2], | |
| "data": { | |
| "kind": "values", | |
| "values": { "$ref": "#/fixtureArrays/ort_nonstring_rank4_float32_to_uint32_input_x" } | |
| } | |
| } | |
| }, | |
| "outputs": { "y": { "dtype": "uint32", "shape": [2, 3, 2, 2], "tolerance": 0 } } | |
| }, | |
| { | |
| "name": "ort_nonstring_rank4_uint32_to_int32", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/tensor/cast_op_test.cc", | |
| "test": "CastOpTest.NonStringTypes", | |
| "notes": "A rank-4 uint32 tensor whose values fit signed int32 exercises conversion to int32." | |
| }, | |
| "attrs": { "to": 6 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "uint32", | |
| "shape": [2, 3, 2, 2], | |
| "data": { | |
| "kind": "values", | |
| "values": { "$ref": "#/fixtureArrays/ort_nonstring_rank4_float32_to_uint32_input_x" } | |
| } | |
| } | |
| }, | |
| "outputs": { "y": { "dtype": "int32", "shape": [2, 3, 2, 2], "tolerance": 0 } } | |
| }, | |
| { | |
| "name": "onnx_backend_cast_float_to_float16", | |
| "provenance": { | |
| "source": "cmake/external/onnx/onnx/backend/test/data/node/test_cast_FLOAT_to_FLOAT16", | |
| "test": "test_cast_FLOAT_to_FLOAT16", | |
| "notes": "The official ONNX backend test_castlike_FLOAT_to_FLOAT16_expanded fixture projects to this same Cast request." | |
| }, | |
| "attrs": { "to": 10 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [3, 4], | |
| "data": { | |
| "kind": "values", | |
| "values": [0.4789254665374756, 0.48033666610717773, 0.4996848702430725, 0.8191054463386536, 0.4703124761581421, 0.8164680004119873, 0.21087194979190826, 0.7229037880897522, "NaN", "Infinity", "Infinity", "-Infinity"] | |
| } | |
| } | |
| }, | |
| "outputs": { "y": { "dtype": "float16", "shape": [3, 4], "tolerance": 0.001, "allowNaN": true } } | |
| }, | |
| { | |
| "name": "onnx_backend_cast_float16_to_float", | |
| "provenance": { | |
| "source": "cmake/external/onnx/onnx/backend/test/data/node/test_cast_FLOAT16_to_FLOAT", | |
| "test": "test_cast_FLOAT16_to_FLOAT", | |
| "notes": "The official ONNX backend test_castlike_FLOAT16_to_FLOAT_expanded fixture projects to this same Cast request." | |
| }, | |
| "attrs": { "to": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float16", | |
| "shape": [3, 4], | |
| "data": { | |
| "kind": "values", | |
| "values": [0.47900390625, 0.480224609375, 0.499755859375, 0.8193359375, 0.47021484375, 0.81640625, 0.2108154296875, 0.72314453125, "NaN", "Infinity", "Infinity", "-Infinity"] | |
| } | |
| } | |
| }, | |
| "outputs": { "y": { "dtype": "float32", "shape": [3, 4], "tolerance": 0, "allowNaN": true } } | |
| }, | |
| { | |
| "name": "ort_uint8_to_int32_edge_values", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/tensor/cast_op_test.cc", | |
| "test": "CastOpTest.NonStringTypes", | |
| "notes": "Focused logical uint8 subset of ORT's non-string Cast matrix." | |
| }, | |
| "attrs": { "to": 6 }, | |
| "inputs": { | |
| "x": { "dtype": "uint8", "shape": [5], "data": { "kind": "values", "values": [0, 1, 127, 128, 255] } } | |
| }, | |
| "outputs": { "y": { "dtype": "int32", "shape": [5], "tolerance": 0 } } | |
| }, | |
| { | |
| "name": "ort_int8_to_float32_edge_values", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/tensor/cast_op_test.cc", | |
| "test": "CastOpTest.NonStringTypes", | |
| "notes": "Focused logical int8 subset of ORT's non-string Cast matrix." | |
| }, | |
| "attrs": { "to": 1 }, | |
| "inputs": { | |
| "x": { "dtype": "int8", "shape": [5], "data": { "kind": "values", "values": [-128, -1, 0, 1, 127] } } | |
| }, | |
| "outputs": { "y": { "dtype": "float32", "shape": [5], "tolerance": 0 } } | |
| }, | |
| { | |
| "name": "ort_float32_to_uint8_in_range_truncates", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/tensor/cast_op_test.cc", | |
| "test": "CastOpTest.NonStringTypes", | |
| "notes": "In-range float-to-uint8 subset; fractional values truncate toward zero." | |
| }, | |
| "attrs": { "to": 2 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [5], | |
| "data": { "kind": "values", "values": [0.9, 1.9, 127.75, 128.25, 255.0] } | |
| } | |
| }, | |
| "outputs": { "y": { "dtype": "uint8", "shape": [5], "tolerance": 0 } } | |
| }, | |
| { | |
| "name": "ort_float32_to_int8_in_range_truncates", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/tensor/cast_op_test.cc", | |
| "test": "CastOpTest.NonStringTypes", | |
| "notes": "In-range float-to-int8 subset; fractional values truncate toward zero." | |
| }, | |
| "attrs": { "to": 3 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [6], | |
| "data": { "kind": "values", "values": [-128.0, -1.9, -0.5, 0.0, 1.9, 127.0] } | |
| } | |
| }, | |
| "outputs": { "y": { "dtype": "int8", "shape": [6], "tolerance": 0 } } | |
| }, | |
| { | |
| "name": "vec4_i8_to_f32_lanes", | |
| "attrs": { "to": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "int8", | |
| "shape": [8], | |
| "data": { "kind": "values", "values": [-128, -127, -1, 0, 1, 64, 126, 127] } | |
| } | |
| }, | |
| "outputs": { "y": { "dtype": "float32", "shape": [8], "tolerance": 0 } } | |
| }, | |
| { | |
| "name": "vec4_u8_to_i32_lanes", | |
| "attrs": { "to": 6 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "uint8", | |
| "shape": [8], | |
| "data": { "kind": "values", "values": [0, 1, 2, 127, 128, 200, 254, 255] } | |
| } | |
| }, | |
| "outputs": { "y": { "dtype": "int32", "shape": [8], "tolerance": 0 } } | |
| }, | |
| { | |
| "name": "vec4_f32_to_i32_truncates_toward_zero", | |
| "attrs": { "to": 6 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [8], | |
| "data": { "kind": "values", "values": [1.0, 2.9, -3.0, 0.0, 100.0, -0.5, -2.9, 127.75] } | |
| } | |
| }, | |
| "outputs": { "y": { "dtype": "int32", "shape": [8], "tolerance": 0 } } | |
| }, | |
| { | |
| "name": "vec4_f16_to_i32_truncates_toward_zero", | |
| "attrs": { "to": 6 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float16", | |
| "shape": [8], | |
| "data": { "kind": "values", "values": [1.0, 2.5, -3.0, 0.0, 100.0, -0.5, -2.5, 7.5] } | |
| } | |
| }, | |
| "outputs": { "y": { "dtype": "int32", "shape": [8], "tolerance": 0 } } | |
| }, | |
| { | |
| "name": "vec4_f32_to_i8_in_range_truncates", | |
| "attrs": { "to": 3 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [8], | |
| "data": { "kind": "values", "values": [-128.0, -1.9, -0.5, 0.0, 1.9, 127.0, -127.75, 126.5] } | |
| } | |
| }, | |
| "outputs": { "y": { "dtype": "int8", "shape": [8], "tolerance": 0 } } | |
| }, | |
| { | |
| "name": "scalar_x4_f32_to_u32_tail", | |
| "attrs": { "to": 12 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [17], | |
| "data": { | |
| "kind": "values", | |
| "values": [0.0, 1.9, 2.2, 3.8, 4.0, 5.6, 6.1, 7.9, 8.0, 9.2, 10.7, 11.0, 12.4, 13.8, 14.0, 15.9, 16.2] | |
| } | |
| } | |
| }, | |
| "outputs": { "y": { "dtype": "uint32", "shape": [17], "tolerance": 0 } } | |
| }, | |
| { | |
| "name": "vec4_tail_f32_to_u32_4097", | |
| "attrs": { "to": 12 }, | |
| "inputs": { "x": { "dtype": "float32", "shape": [4097], "data": { "kind": "constant", "value": 1.75 } } }, | |
| "outputs": { "y": { "dtype": "uint32", "shape": [4097], "tolerance": 0 } }, | |
| "provenance": { "notes": "Exercises a packed vec4 bulk followed by a scalar tail in the same dispatch." } | |
| }, | |
| { | |
| "name": "vec4_tail_f32_to_i8_4099", | |
| "attrs": { "to": 3 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [4099], | |
| "data": { "kind": "cycle", "values": [1.5, -2.5, 126.25, -127.75, 63.5] } | |
| } | |
| }, | |
| "outputs": { "y": { "dtype": "int8", "shape": [4099], "tolerance": 0 } }, | |
| "provenance": { | |
| "notes": "A 4099-element float32-to-int8 cast is not four-aligned, leaving a 3-element tail. All values are within int8 range, verifying truncation toward zero rather than undefined out-of-range behavior; a 5-value cycle, coprime with 4, gives the tail distinct values." | |
| } | |
| }, | |
| { | |
| "name": "vec4_tail_f32_to_u8_4099", | |
| "attrs": { "to": 2 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [4099], | |
| "data": { "kind": "cycle", "values": [0.5, 200.75, 255.0, 254.25, 1.5, 44.5, 127.5] } | |
| } | |
| }, | |
| "outputs": { "y": { "dtype": "uint8", "shape": [4099], "tolerance": 0 } }, | |
| "provenance": { | |
| "notes": "A 4,099-element float32-to-uint8 cast exercises a vec4 bulk and three-element scalar tail. Every value is in range, and a seven-value cycle coprime with the four-lane stride exercises distinct lanes under ONNX truncation-toward-zero semantics." | |
| } | |
| }, | |
| { | |
| "name": "ort_bool_exact_to_float32", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/tensor/cast_op_test.cc", | |
| "test": "CastOpTest.Float8_Opset25_Cuda", | |
| "notes": "Logical false and true values must cast exactly to 0.0 and 1.0." | |
| }, | |
| "attrs": { "to": 1 }, | |
| "inputs": { | |
| "x": { "dtype": "bool", "shape": [2, 3], "data": { "kind": "values", "values": [1, 0, 1, 1, 0, 0] } } | |
| }, | |
| "outputs": { "y": { "dtype": "float32", "shape": [2, 3], "tolerance": 0 } } | |
| }, | |
| { | |
| "name": "ort_bool_exact_to_int32", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/tensor/cast_op_test.cc", | |
| "test": "CastOpTest.NonStringTypes", | |
| "notes": "Bool-to-signed-integer subset of ORT's non-string Cast matrix." | |
| }, | |
| "attrs": { "to": 6 }, | |
| "inputs": { | |
| "x": { "dtype": "bool", "shape": [2, 3], "data": { "kind": "values", "values": [1, 0, 1, 1, 0, 0] } } | |
| }, | |
| "outputs": { "y": { "dtype": "int32", "shape": [2, 3], "tolerance": 0 } } | |
| }, | |
| { | |
| "name": "ort_bool_exact_to_uint8", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/tensor/cast_op_test.cc", | |
| "test": "CastOpTest.NonStringTypes", | |
| "notes": "Bool-to-logical-uint8 subset of ORT's non-string Cast matrix." | |
| }, | |
| "attrs": { "to": 2 }, | |
| "inputs": { | |
| "x": { "dtype": "bool", "shape": [2, 3], "data": { "kind": "values", "values": [1, 0, 1, 1, 0, 0] } } | |
| }, | |
| "outputs": { | |
| "y": { | |
| "dtype": "uint8", | |
| "shape": [2, 3], | |
| "tolerance": 0, | |
| "data": { "kind": "values", "values": [1, 0, 1, 1, 0, 0] } | |
| } | |
| } | |
| }, | |
| { | |
| "name": "ort_int32_to_bool_exact", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/tensor/cast_op_test.cc", | |
| "test": "CastOpTest.NonStringTypes", | |
| "notes": "Signed-integer-to-bool subset of ORT's non-string Cast matrix." | |
| }, | |
| "attrs": { "to": 9 }, | |
| "inputs": { | |
| "x": { "dtype": "int32", "shape": [2, 3], "data": { "kind": "values", "values": [-3, -1, 0, 1, 2, 100] } } | |
| }, | |
| "outputs": { "y": { "dtype": "bool", "shape": [2, 3], "tolerance": 0 } } | |
| }, | |
| { | |
| "name": "ort_uint8_to_bool_nonzero_exact", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/tensor/cast_op_test.cc", | |
| "test": "CastOpTest.NonStringTypes", | |
| "notes": "Unsigned-byte-to-bool subset of ORT's non-string Cast matrix; nonzero values must become true." | |
| }, | |
| "attrs": { "to": 9 }, | |
| "inputs": { | |
| "x": { "dtype": "uint8", "shape": [2, 3], "data": { "kind": "values", "values": [0, 1, 2, 255, 0, 7] } } | |
| }, | |
| "outputs": { | |
| "y": { | |
| "dtype": "bool", | |
| "shape": [2, 3], | |
| "tolerance": 0, | |
| "data": { "kind": "values", "values": [0, 1, 1, 1, 0, 1] } | |
| } | |
| } | |
| }, | |
| { | |
| "name": "ort_float32_to_bool_exact", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/tensor/cast_op_test.cc", | |
| "test": "CastOpTest.NonStringTypes", | |
| "notes": "Float-to-bool subset of ORT's non-string Cast matrix." | |
| }, | |
| "attrs": { "to": 9 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [2, 3], | |
| "data": { "kind": "values", "values": [-1.5, -0.25, 0.0, 0.25, 2.5, 100.0] } | |
| } | |
| }, | |
| "outputs": { "y": { "dtype": "bool", "shape": [2, 3], "tolerance": 0 } } | |
| }, | |
| { | |
| "name": "float32_special_nonzero_to_bool_nan_fastmath_gap", | |
| "attrs": { "to": 9 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "float32", | |
| "shape": [8], | |
| "data": { "kind": "values", "values": ["NaN", "Infinity", "-Infinity", 0.0, -0.0, 1.0, -2.5, 1e-38] } | |
| } | |
| }, | |
| "outputs": { "y": { "dtype": "bool", "shape": [8], "tolerance": 0 } } | |
| }, | |
| { | |
| "name": "ort_int32_to_float32_precision_boundaries", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/tensor/cast_op_test.cc", | |
| "test": "CastOpTest.NonStringTypes", | |
| "notes": "Integer-to-float boundary values around the float32 exact-integer range." | |
| }, | |
| "attrs": { "to": 1 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "int32", | |
| "shape": [6], | |
| "data": { "kind": "values", "values": [16777215, 16777216, 16777217, 2147483647, -16777217, -2147483648] } | |
| } | |
| }, | |
| "outputs": { "y": { "dtype": "float32", "shape": [6], "tolerance": 0 } } | |
| }, | |
| { | |
| "name": "ort_uint32_to_float16_overflow_boundaries", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/tensor/cast_op_test.cc", | |
| "test": "CastOpTest.NonStringTypes", | |
| "notes": "Unsigned integer to float16 values at and above the finite f16 range." | |
| }, | |
| "attrs": { "to": 10 }, | |
| "inputs": { | |
| "x": { | |
| "dtype": "uint32", | |
| "shape": [8], | |
| "data": { "kind": "values", "values": [0, 1, 65503, 65504, 65505, 65519, 65520, 70000] } | |
| } | |
| }, | |
| "outputs": { "y": { "dtype": "float16", "shape": [8], "tolerance": 0 } } | |
| }, | |
| { | |
| "name": "ort_bool_scalar_to_int32", | |
| "provenance": { | |
| "source": "onnxruntime/test/providers/cpu/tensor/cast_op_test.cc", | |
| "test": "CastOpTest.NonStringTypes", | |
| "notes": "Scalar bool projection of ORT's non-string Cast matrix." | |
| }, | |
| "attrs": { "to": 6 }, | |
| "inputs": { "x": { "dtype": "bool", "shape": [], "data": { "kind": "values", "values": [1] } } }, | |
| "outputs": { "y": { "dtype": "int32", "shape": [], "tolerance": 0 } } | |
| } | |
| ] | |
| } | |