Get Started
Since R2026a
With MATLAB Coder Support Package for PyTorch and LiteRT Models, you can:
Load PyTorch ExportedProgram and LiteRT (TensorFlow Lite or TFLite) models to MATLAB code and Simulink® models. You can load a variety of pretrained deep learning networks, including YOLOv11, Whisper, DINOv2, Depth Anything, and SAM2.
Generate code for TensorFlow or Keras models by converting them to LiteRT format.
Generate and deploy target-independent C and C++ code for PyTorch ExportedProgram and LiteRT models.
Generate optimized plain CUDA® code by using GPU Coder™.
Use code replacement libraries to incorporate processor-specific intrinsics for target hardware.
To get this support package, perform the steps described in Install MATLAB Coder Support Package for PyTorch and LiteRT Models.
Functions
coder.torchSetup | Install third-party tools for PyTorch code generation |
Topics
- Install MATLAB Coder Support Package for PyTorch and LiteRT Models
Install the support package and tools for code generation for PyTorch and LiteRT models.
- Prepare PyTorch Models for MATLAB and Simulink Code Generation
Export a PyTorch model as a ExportedProgram file to be loaded with loadPyTorchExportedProgram.
- Verify Numerical Consistency of a LiteRT or PyTorch ExportedProgram Model in Python
Verify numerical consistency between Python® and MATLAB.