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
orderis supported only with default value"C". Parametersubokis supported only with default valueFalse.See also
dpnp.ones_likeReturn an array of ones with shape and type of input.
dpnp.zeros_likeReturn an array of zeros with shape and type of input.
dpnp.full_likeReturn a new array with shape of input filled with value.
dpnp.emptyReturn 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]