torchTensorToArray
R2026bSyntax
Description
converts a PyTorch® Tensor to a MATLAB® numeric array.matlabArray = torchTensorToArray(torchTensor)
uses additional arguments to specify permutation and MATLAB datatype.matlabArray = torchTensorToArray(torchTensor,Name=Value)
Examples
Input Arguments
Name-Value Arguments
Output Arguments
Extended Capabilities
Version History
Introduced in R2026b
See Also
Functions
arrayToTorchTensor|forward|addFunction|callFunction|export|reload|importNetworkFromPyTorch
Objects
PyTorchModel|dlarray|(Parallel Computing Toolbox)gpuArray
Topics
- Use PyTorch and MATLAB for Deep Learning Workflows
- Pass GPU Data Between MATLAB and Python (Parallel Computing Toolbox)