Skip to content

Commit

Permalink
fix test isues on older python platforms
Browse files Browse the repository at this point in the history
Signed-off-by: Yuan Yao <[email protected]>
  • Loading branch information
yuanyao-nv committed Aug 27, 2024
1 parent 4cd5663 commit b6544c3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions onnx/numpy_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ def unpacked_float4e2m1_to_float32(x: npt.NDArray[np.uint8]) -> npt.NDArray[np.f
"""
# x is stored in 4 LSB of int
sign = np.where(np.bitwise_and(x, 0x08), -1, 1)
mantissa = x & 0x01
exponent = (x & 0x06) >> 1
mantissa = (x & 0x01).astype(np.float32)
exponent = ((x & 0x06) >> 1).astype(np.float32)

val = np.where(
exponent == 0,
Expand Down
3 changes: 3 additions & 0 deletions onnx/test/test_backend_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,13 @@ def run_node(cls, node, inputs, device=None, outputs_info=None, **kwargs):
"|test_cast_no_saturate_FLOAT16_to_FLOAT8"
"|test_cast_BFLOAT16_to_FLOAT"
"|test_castlike_BFLOAT16_to_FLOAT"
"|test_cast_FLOAT_to_FLOAT4"
"|test_cast_FLOAT16_to_FLOAT4"
"|test_quantizelinear_e4m3"
"|test_quantizelinear_e5m2"
"|test_quantizelinear_uint4"
"|test_quantizelinear_int4"
"|test_quantizelinear_float4e2m1"
")"
)

Expand Down

0 comments on commit b6544c3

Please sign in to comment.