empty#

ivy.empty(shape, *, dtype=None, device=None, out=None)[source]#

Return a new array of given shape and type, filled with zeros.

Parameters:
  • shape (Union[Shape, NativeShape]) – output array shape.

  • dtype (Optional[Union[Dtype, NativeDtype]]) – output array data type. If dtype is None, the output array data type must be the (default: None) default floating-point data type. Default: None.

  • device (Optional[Union[Device, NativeDevice]]) – device on which to place the created array. Default: None. (default: None)

  • out (Optional[Array]) – optional output array, for writing the result to. It must have a shape that the (default: None) inputs broadcast to.

Return type:

Array

Returns:

ret – an uninitialized array having a specified shape

This function conforms to the Array API Standard. This docstring is an extension of the docstring # noqa in the standard.

Both the description and the type hints above assumes an array input for simplicity, but this function is nestable, and therefore also accepts ivy.Container instances in place of any of the arguments.