()
| 66 | |
| 67 | @staticmethod |
| 68 | def export_e4m3fn() -> None: |
| 69 | node = onnx.helper.make_node( |
| 70 | "QuantizeLinear", |
| 71 | inputs=["x", "y_scale", "y_zero_point"], |
| 72 | outputs=["y"], |
| 73 | ) |
| 74 | |
| 75 | x = np.array([0.0, 1.0, 2.0, 100000.0, 200.0]).astype(np.float32) |
| 76 | y_scale = np.float32(2) |
| 77 | y_zero_point = make_tensor("y_zero_point", TensorProto.FLOAT8E4M3FN, [1], [0]) |
| 78 | y = make_tensor("y", TensorProto.FLOAT8E4M3FN, [5], [0, 0.5, 1, 448, 96]) |
| 79 | |
| 80 | expect( |
| 81 | node, |
| 82 | inputs=[x, y_scale, y_zero_point], |
| 83 | outputs=[y], |
| 84 | name="test_quantizelinear_e4m3fn", |
| 85 | ) |
| 86 | |
| 87 | @staticmethod |
| 88 | def export_e5m2() -> None: |
nothing calls this directly
no test coverage detected