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.
a (ArrayLike | SupportsShape) – array-like object, or any object with a shape
attribute.
An tuple of integers representing the shape of a
.
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