A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.jax.dev/en/latest/_autosummary/jax.numpy.clip.html below:

jax.numpy.clip — JAX documentation

jax.numpy.clip#
jax.numpy.clip(arr=None, /, min=None, max=None, *, a=Deprecated, a_min=Deprecated, a_max=Deprecated)[source]#

Clip array values to a specified range.

JAX implementation of numpy.clip().

Parameters:
  • arr (ArrayLike | None) – N-dimensional array to be clipped.

  • min (ArrayLike | None) – optional minimum value of the clipped range; if None (default) then result will not be clipped to any minimum value. If specified, it should be broadcast-compatible with arr and max.

  • max (ArrayLike | None) – optional maximum value of the clipped range; if None (default) then result will not be clipped to any maximum value. If specified, it should be broadcast-compatible with arr and min.

  • a (ArrayLike | DeprecatedArg) – deprecated alias of the arr argument. Will result in a DeprecationWarning if used.

  • a_min (ArrayLike | None | DeprecatedArg) – deprecated alias of the min argument. Will result in a DeprecationWarning if used.

  • a_max (ArrayLike | None | DeprecatedArg) – deprecated alias of the max argument. Will result in a DeprecationWarning if used.

Returns:

An array containing values from arr, with values smaller than min set to min, and values larger than max set to max. Wherever min is larger than max, the value of max is returned.

Return type:

Array

Examples

>>> arr = jnp.array([0, 1, 2, 3, 4, 5, 6, 7])
>>> jnp.clip(arr, 2, 5)
Array([2, 2, 2, 3, 4, 5, 5, 5], dtype=int32)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4