warp.empty_like#

warp.empty_like(src, device=None, requires_grad=None, pinned=None)[source]#

Return an uninitialized array with the same type and dimension of another array

Parameters:
  • src (Array) – The template array to use for shape, data type, and device

  • device (Device | str | None) – The device where the new array will be created (defaults to src.device)

  • requires_grad (bool | None) – Whether the array will be tracked for back propagation

  • pinned (bool | None) – Whether the array uses pinned host memory (only applicable to CPU arrays)

Returns:

A warp.array object representing the allocation

Return type:

array