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

jax.numpy.full — JAX documentation

jax.numpy.full#
jax.numpy.full(shape, fill_value, dtype=None, *, device=None)[source]#

Create an array full of a specified value.

JAX implementation of numpy.full().

Parameters:
  • shape (Any) – int or sequence of ints specifying the shape of the created array.

  • fill_value (Array | ndarray | bool | number | bool | int | float | complex) – scalar or array with which to fill the created array.

  • dtype (str | type[Any] | dtype | SupportsDType | None) – optional dtype for the created array; defaults to the dtype of the fill value.

  • device (Device | Sharding | None) – (optional) Device or Sharding to which the created array will be committed.

Returns:

Array of the specified shape and dtype, on the specified device if specified.

Return type:

Array

Examples

>>> jnp.full(4, 2, dtype=float)
Array([2., 2., 2., 2.], dtype=float32)
>>> jnp.full((2, 3), 0, dtype=bool)
Array([[False, False, False],
       [False, False, False]], dtype=bool)

fill_value may also be an array that is broadcast to the specified shape:

>>> jnp.full((2, 3), fill_value=jnp.arange(3))
Array([[0, 1, 2],
       [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.3