Skip to content

feat!: allow clip to have int min or max when x is floating-point #811

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
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Allow clip to have int min or max when x is floating-point
This is for consistency with operators, which allow combining an int with an
array that has a floating-point data type.

See the discussion at #807.
  • Loading branch information
asmeurer committed Jun 4, 2024
commit 87d35dfce1075dcc6096405ac6c67251df5cdb2d
2 changes: 1 addition & 1 deletion src/array_api_stubs/_2023_12/elementwise_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ def clip(

- If both ``min`` and ``max`` are ``None``, the elements of the returned array must equal the respective elements in ``x``.
- If a broadcasted element in ``min`` is greater than a corresponding broadcasted element in ``max``, behavior is unspecified and thus implementation-dependent.
- If ``x`` and either ``min`` or ``max`` have different data type kinds (e.g., integer versus floating-point), behavior is unspecified and thus implementation-dependent.
- If ``x`` has an integer data type and either ``min`` or ``max`` is floating-point, behavior is unspecified and thus implementation-dependent.

.. versionadded:: 2023.12
"""
Expand Down