dpnp.dpnp_array.dpnp_array.fill

method

dpnp_array.fill(value)[source]

Fill the array with a scalar value.

For full documentation refer to numpy.ndarray.fill.

Parameters:

value ({dpnp.ndarray, usm_ndarray, scalar}) -- All elements of a will be assigned this value.

Examples

>>> import dpnp as np
>>> a = np.array([1, 2])
>>> a.fill(0)
>>> a
array([0, 0])
>>> a = np.empty(2)
>>> a.fill(1)
>>> a
array([1.,  1.])