mlx.core.from_dlpack#
- from_dlpack(x: DLPackCompatible, /, *, copy: bool | None = None) array#
Create an array from an object that supports DLPack.
- Parameters:
x – Input object implementing
__dlpack__and__dlpack_device__.copy (bool, optional) – Whether to copy the input. If
True, always copy. IfFalse, never copy. IfNone, share memory when possible and copy otherwise. Zero-copy imports preserve the DLPack strides.
- Returns:
An array containing the input data.
- Return type: