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.trunc.html below:

jax.numpy.trunc — JAX documentation

jax.numpy.trunc#
jax.numpy.trunc(x)[source]#

Round input to the nearest integer towards zero.

JAX implementation of numpy.trunc().

Parameters:

x (ArrayLike) – input array or scalar.

Returns:

An array with same shape and dtype as x containing the rounded values.

Return type:

Array

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