Generate Code for PyTorch and LiteRT Models in MATLAB
Generate generic C, C++, and plain CUDA code from MATLAB® code
Since R2026a
Since R2026a
You can load a PyTorch® ExportedProgram or LiteRT model into MATLAB and generate generic C/C++ code.
If you have a GPU Coder™ license, you can also generate CUDA® code.
Functions
loadLiteRTModel | Load pretrained LiteRT model file |
loadPyTorchExportedProgram | Load PyTorch ExportedProgram model file |
summary | Display input and output specifications of PyTorch ExportedProgram or LiteRT model |
inputSpecifications | Return input specifications for functions in PyTorch ExportedProgam or LiteRT model |
outputSpecifications | Return output specifications for functions in PyTorch ExportedProgram or LiteRT model |
invoke | Run inference on a PyTorch ExportedProgram or LiteRT model input to compute output |
Objects
PyTorchExportedProgram | PyTorch ExportedProgram model |
LiteRTModel | LiteRT model |


