empty_like¶
- empty_like(x: array, /, *, dtype: Optional[dtype] = None, device: Optional[device] = None) array ¶
Returns an uninitialized array with the same
shape
as an input arrayx
.- Parameters
x (array) – input array from which to derive the output array shape.
dtype (Optional[dtype]) – output array data type. If
dtype
isNone
, the output array data type must be inferred fromx
. Default:None
.device (Optional[device]) – device on which to place the created array. If
device
isNone
, the output array device must be inferred fromx
. Default:None
.
- Returns
out (array) – an array having the same shape as
x
and containing uninitialized data.