Calculate element-wise reciprocal of the input.
JAX implementation of numpy.reciprocal
.
The reciprocal is calculated by 1/x
.
x (ArrayLike) – input array or scalar.
An array of same shape as x
containing the reciprocal of each element of x
.
Note
For integer inputs, np.reciprocal
returns rounded integer output, while jnp.reciprocal
promotes integer inputs to floating point.
Examples
>>> jnp.reciprocal(2) Array(0.5, dtype=float32, weak_type=True) >>> jnp.reciprocal(0.) Array(inf, dtype=float32, weak_type=True) >>> x = jnp.array([1, 5., 4.]) >>> jnp.reciprocal(x) Array([1. , 0.2 , 0.25], 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.3