warp.from_dlpack#

warp.from_dlpack(source, dtype=None, hint=None)[source]#

Convert a source array or DLPack capsule into a Warp array without copying.

Parameters:
  • source – A DLPack-compatible array or PyCapsule

  • dtype – An optional Warp data type to interpret the source data.

  • hint – A hint that helps to interpret opaque pointers. Currently supported hints are warp.Texture1D, warp.Texture2D, and warp.Texture3D when the opaque pointer is a cudaArray_t handle. Hints are ignored when the data type is not kDLOpaquePointer.

Returns:

A new Warp array or texture that uses the same underlying memory as the source.

Return type:

array | Texture