dpnp.empty_like

dpnp.empty_like(prototype, dtype=None, order='C', subok=False, shape=None)[source]

Return a new array with the same shape and type as a given array.

For full documentation refer to numpy.empty_like.

Limitations

Parameter order is supported only with default value "C". Parameter subok is supported only with default value False.

See also

dpnp.ones_like

Return an array of ones with shape and type of input.

dpnp.zeros_like

Return an array of zeros with shape and type of input.

dpnp.full_like

Return a new array with shape of input filled with value.

dpnp.empty

Return a new uninitialized array.

Examples

>>> import dpnp as np
>>> prototype = np.array([1, 2, 3])
>>> x = np.empty_like(prototype)
>>> [i for i in x]
[0, 0, 0]