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

jax.numpy.ogrid — JAX documentation

jax.numpy.ogrid#
jax.numpy.ogrid = <jax._src.numpy.index_tricks._Ogrid object>#

Return open multi-dimensional “meshgrid”.

LAX-backend implementation of numpy.ogrid. This is a convenience wrapper for functionality provided by jax.numpy.meshgrid() with sparse=True.

See also

jnp.mgrid: dense version of jnp.ogrid

Examples

Pass [start:stop:step] to generate values similar to jax.numpy.arange():

>>> jnp.ogrid[0:4:1]
Array([0, 1, 2, 3], dtype=int32)

Passing an imaginary step generates values similar to jax.numpy.linspace():

>>> jnp.ogrid[0:1:4j]
Array([0.        , 0.33333334, 0.6666667 , 1.        ], dtype=float32)

Multiple slices can be used to create sparse grids of indices:

>>> jnp.ogrid[:2, :3]
[Array([[0],
        [1]], dtype=int32),
 Array([[0, 1, 2]], dtype=int32)]

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