dpnp.from_dlpack

dpnp.from_dlpack(obj, /)[source]

Create a dpnp array from a Python object implementing the __dlpack__ protocol.

See https://dmlc.github.io/dlpack/latest/ for more details.

Parameters:

obj (object) -- A Python object representing an array that implements the __dlpack__ and __dlpack_device__ methods.

Returns:

out -- Returns a new dpnp array containing the data from another array (obj) with the __dlpack__ method on the same device as object.

Return type:

dpnp_array