Create an array full of a specified value.
JAX implementation of numpy.full()
.
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.
Array of the specified shape and dtype, on the specified device if specified.
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