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]], default: None) – output array data type. If dtype is None, the output array data type must be the default floating-point data type. Default: None.

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

  • out (Optional[Array], default: None) – optional output array, for writing the result to. It must have a shape that the 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 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.