8000 Add `clip` to the specification by kgryte · Pull Request #715 · data-apis/array-api · GitHub
[go: up one dir, main page]

Skip to content

Add clip to the specification #715

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

Merged
merged 6 commits into from
Jan 22, 2024
Merged
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
Prev Previous commit
Next Next commit
Allow broadcasting of the input array
  • Loading branch information
kgryte committed Nov 30, 2023
commit 14b297f2634701b4f7c151a781dcb4baebd77f4b
6 changes: 3 additions & 3 deletions src/array_api_stubs/_draft/elementwise_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -788,14 +788,14 @@ def clamp(
x: array
input array. Should have a real-valued data type.
min: Optional[Union[int, float, array]]
lower-bound of the range to which to clamp. If ``None``, no lower bound must be applied. Must broadcast to the same shape as ``x`` (see :ref:`broadcasting`). Should have a real-valued data type. Default: ``None``.
lower-bound of the range to which to clamp. If ``None``, no lower bound must be applied. Must be compatible with ``x1`` (see :ref:`broadcasting`). Should have a real-valued data type. Default: ``None``.
max: Optional[Union[int, float, array]]
upper-bound of the range to which to clamp. If ``None``, no upper bound must be applied. Must broadcast to the same shape as ``x`` (see :ref:`broadcasting`). Should have a real-valued data type. Default: ``None``.
upper-bound of the range to which to clamp. If ``None``, no upper bound must be applied. Must be compatible with ``x1`` (see :ref:`broadcasting`). Should have a real-valued data type. Default: ``None``.

Returns
-------
out: array
an array containing element-wise results. The returned array must have the same shape as ``x`` and have a data type determined by :ref:`type-promotion`.
an array containing element-wise results. The returned array must have a data type determined by :ref:`type-promotion`.

Notes
-----
Expand Down
0