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

jax.numpy.shape — JAX documentation

jax.numpy.shape#
jax.numpy.shape(a)[source]#

Return the shape an array.

JAX implementation of numpy.shape(). Unlike np.shape, this function raises a TypeError if the input is a collection such as a list or tuple.

Parameters:

a (ArrayLike | SupportsShape) – array-like object, or any object with a shape attribute.

Returns:

An tuple of integers representing the shape of a.

Return type:

tuple[int, …]

Examples

Shape for arrays:

>>> x = jnp.arange(10)
>>> jnp.shape(x)
(10,)
>>> y = jnp.ones((2, 3))
>>> jnp.shape(y)
(2, 3)

This also works for scalars:

For arrays, this can also be accessed via the jax.Array.shape property:


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