Round input to the nearest integer towards zero.
JAX implementation of numpy.trunc()
.
x (ArrayLike) – input array or scalar.
An array with same shape and dtype as x
containing the rounded values.
Examples
>>> key = jax.random.key(42) >>> x = jax.random.uniform(key, (3, 3), minval=-10, maxval=10) >>> with jnp.printoptions(precision=2, suppress=True): ... print(x) [[-0.23 3.6 2.33] [ 1.22 -0.99 1.72] [-8.5 5.5 3.98]] >>> jnp.trunc(x) Array([[-0., 3., 2.], [ 1., -0., 1.], [-8., 5., 3.]], 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