()
| 278 | |
| 279 | @staticmethod |
| 280 | def export_uint2() -> None: |
| 281 | node = onnx.helper.make_node( |
| 282 | "QuantizeLinear", |
| 283 | inputs=["x", "y_scale", "y_zero_point"], |
| 284 | outputs=["y"], |
| 285 | axis=0, |
| 286 | ) |
| 287 | |
| 288 | x = np.array( |
| 289 | [ |
| 290 | [0.0, 2.5, 4.8, 8.6], |
| 291 | [-2.0, -1.0, 1.0, 3.0], |
| 292 | [4.0, 5.0, 6.0, 7.0], |
| 293 | ], |
| 294 | dtype=np.float32, |
| 295 | ) |
| 296 | y_scale = np.asarray([2.0, 3.0, 4.0], dtype=np.float32) |
| 297 | y_zero_point = make_tensor( |
| 298 | "y_zero_point", TensorProto.UINT2, y_scale.shape, np.zeros_like(y_scale) |
| 299 | ) |
| 300 | y = make_tensor( |
| 301 | "y", TensorProto.UINT2, x.shape, [0, 1, 2, 3, 0, 0, 0, 1, 1, 1, 2, 2] |
| 302 | ) |
| 303 | expect( |
| 304 | node, |
| 305 | inputs=[x, y_scale, y_zero_point], |
| 306 | outputs=[y], |
| 307 | name="test_quantizelinear_uint2", |
| 308 | ) |
| 309 | |
| 310 | @staticmethod |
| 311 | def export_int2() -> None: |
nothing calls this directly
no test coverage detected