Return element-wise minimum of the input arrays.
JAX implementation of numpy.minimum
.
x – input array or scalar.
y – input array or scalar. Both x
and y
should either have same shape or be broadcast compatible.
args (ArrayLike)
out (None)
where (None)
An array containing the element-wise minimum of x
and y
.
Any
Note
jnp.minimum
returns:
smaller of the two if both elements are finite numbers.
nan
if one element is nan
.
Examples
Inputs with x.shape == y.shape
:
>>> x = jnp.array([2, 3, 5, 1]) >>> y = jnp.array([-3, 6, -4, 7]) >>> jnp.minimum(x, y) Array([-3, 3, -4, 1], dtype=int32)
Inputs having broadcast compatibility:
>>> x1 = jnp.array([[1, 5, 2], ... [-3, 4, 7]]) >>> y1 = jnp.array([-2, 3, 6]) >>> jnp.minimum(x1, y1) Array([[-2, 3, 2], [-3, 3, 6]], dtype=int32)
Inputs with nan
:
>>> nan = jnp.nan >>> x2 = jnp.array([[2.5, nan, -2], ... [nan, 5, 6], ... [-4, 3, 7]]) >>> y2 = jnp.array([1, nan, 5]) >>> jnp.minimum(x2, y2) Array([[ 1., nan, -2.], [nan, nan, 5.], [-4., nan, 5.]], dtype=float32)
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