pydlpack
R2026bSyntax
Description
converts the specified MATLAB® array to a Python® DLPack capsule.dlp = pydlpack(mla)
You can use the output DLPack capsule to exchange data between MATLAB and Python frameworks, including TensorFlow™. To transfer data to PyTorch®, use the arrayToTorchTensor (Deep Learning Toolbox) function instead.
Note
The pydlpack function supports sending
data to Python environments running in out-of-process execution mode only. To configure the
Python interpreter to use out-of-process execution mode, call the pyenv function and
set the ExecutionMode name-value argument to
"OutOfProcess".
Examples
Input Arguments
Output Arguments
Limitations
Sparse arrays are not supported.
Extended Capabilities
Version History
Introduced in R2026b