Skip to content

Issue with test_clip #359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ndgrigorian opened this issue Apr 8, 2025 · 1 comment · Fixed by #360
Closed

Issue with test_clip #359

ndgrigorian opened this issue Apr 8, 2025 · 1 comment · Fixed by #360

Comments

@ndgrigorian
Copy link

    | Falsifying example: test_clip(
    |     x=array(0, dtype=uint8),
    |     data=data(...),
    | )
    | Draw 1 (min.shape, max.shape): ((), ())
    | Draw 2 (min): array(0, dtype=uint8)
    | Draw 3 (max): array(0, dtype=uint16)
    | Draw 4 (kwargs): {'min': array(0, dtype=uint8), 'max': array(0, dtype=uint16)}

Per spec,

If either min or max is an array having a different data type than x, behavior is unspecified and thus implementation-dependent.

Clarified that behavior is only defined when x, min, and max resolve to arrays having the same data type.

It seems to me that this is a malformed test, and only cases where min and max are (or resolve to, but even that's a stretch per first condition) the type of x should be tested.

@ev-br
Copy link
Member

ev-br commented Apr 8, 2025

Agreed, the 2024 spec clarification is pretty clear on arrays of different dtypes. There's also gh-339 which report issues for mixing float32 and float64. Here's a fix: gh-360

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants