Repository: onnx/onnx
File: onnx/test/test_backend_reference.py (Python)

Code before:
backend_test.exclude(
    "(test_cast_FLOAT_to_STRING|test_castlike_FLOAT_to_STRING|test_strnorm)"
)

# The following tests fail due to a shape mismatch.
backend_test.exclude(
    "(test_center_crop_pad_crop_axes_hwc_expanded"
    "|test_lppool_2d_dilations"
    "|test_averagepool_2d_dilations)"
)

# The following tests fail due to a type mismatch.
backend_test.exclude("(test_eyelike_without_dtype)")

# The following tests fail due to discrepancies (small but still higher than 1e-7).
backend_test.exclude("test_adam_multiple")  # 1e-2

# Currently google-re2/Pillow is not supported on Win32 and is required for the reference implementation of RegexFullMatch.
if sys.platform == "win32":
    backend_test.exclude("test_regex_full_match_basic_cpu")
    backend_test.exclude("test_regex_full_match_email_domain_cpu")
    backend_test.exclude("test_regex_full_match_empty_cpu")
    backend_test.exclude("test_image_decoder_decode_")

if sys.version_info > (3, 12):
    # 2024.11.11 re2 not compatible with python 3.13 , https://github.com/google/re2/issues/516
    backend_test.exclude("test_regex_full_match_basic_cpu")
    backend_test.exclude("test_regex_full_match_email_domain_cpu")
    backend_test.exclude("test_regex_full_match_empty_cpu")

if sys.version_info <= (3, 10):
    #  AttributeError: module 'numpy.typing' has no attribute 'NDArray'
    backend_test.exclude("test_image_decoder_decode_")

if sys.platform == "darwin":
    # FIXME: https://github.com/onnx/onnx/issues/5792
    backend_test.exclude("test_qlinearmatmul_3D_int8_float16_cpu")
    backend_test.exclude("test_qlinearmatmul_3D_int8_float32_cpu")

# op_dft and op_stft requires numpy >= 1.21.5
if version_utils.numpy_older_than("1.21.5"):
    backend_test.exclude("test_stft")
    backend_test.exclude("test_stft_with_window")
    backend_test.exclude("test_stft_cpu")
    backend_test.exclude("test_dft")
    backend_test.exclude("test_dft_axis")
    backend_test.exclude("test_dft_inverse")
    backend_test.exclude("test_dft_opset19")
    backend_test.exclude("test_dft_axis_opset19")
    backend_test.exclude("test_dft_inverse_opset19")


Review comment (suggestion):
```suggestion
    # TODO(https://github.com/google/re2/issues/516): Remove the skips
```

Code after:
backend_test.exclude(
    "(test_cast_FLOAT_to_STRING|test_castlike_FLOAT_to_STRING|test_strnorm)"
)

# The following tests fail due to a shape mismatch.
backend_test.exclude(
    "(test_center_crop_pad_crop_axes_hwc_expanded"
    "|test_lppool_2d_dilations"
    "|test_averagepool_2d_dilations)"
)

# The following tests fail due to a type mismatch.
backend_test.exclude("(test_eyelike_without_dtype)")

# The following tests fail due to discrepancies (small but still higher than 1e-7).
backend_test.exclude("test_adam_multiple")  # 1e-2

# Currently google-re2/Pillow is not supported on Win32 and is required for the reference implementation of RegexFullMatch.
if sys.platform == "win32":
    backend_test.exclude("test_regex_full_match_basic_cpu")
    backend_test.exclude("test_regex_full_match_email_domain_cpu")
    backend_test.exclude("test_regex_full_match_empty_cpu")
    backend_test.exclude("test_image_decoder_decode_")

if sys.version_info > (3, 12):
    # TODO(https://github.com/google/re2/issues/516): Remove the skips
    backend_test.exclude("test_regex_full_match_basic_cpu")
    backend_test.exclude("test_regex_full_match_email_domain_cpu")
    backend_test.exclude("test_regex_full_match_empty_cpu")

if sys.version_info <= (3, 10):
    #  AttributeError: module 'numpy.typing' has no attribute 'NDArray'
    backend_test.exclude("test_image_decoder_decode_")

if sys.platform == "darwin":
    # FIXME: https://github.com/onnx/onnx/issues/5792
    backend_test.exclude("test_qlinearmatmul_3D_int8_float16_cpu")
    backend_test.exclude("test_qlinearmatmul_3D_int8_float32_cpu")

# op_dft and op_stft requires numpy >= 1.21.5
if version_utils.numpy_older_than("1.21.5"):
    backend_test.exclude("test_stft")
    backend_test.exclude("test_stft_with_window")
    backend_test.exclude("test_stft_cpu")
    backend_test.exclude("test_dft")
    backend_test.exclude("test_dft_axis")
    backend_test.exclude("test_dft_inverse")
    backend_test.exclude("test_dft_opset19")
    backend_test.exclude("test_dft_axis_opset19")
    backend_test.exclude("test_dft_inverse_opset19")