ivy.to_dlpack(x, /, *, out=None)[source]#

Return PyCapsule Object.

  • object (x) – input (array) object.

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


ret – Return PyCapsule Object.


The returned array may be either a copy or a view. See data-interchange for details.

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.