主要内容

本页翻译不是最新的。点击此处可查看最新英文版本。

在 MATLAB 中为 PyTorch 和 LiteRT 模型生成代码

R2026a
从 MATLAB® 代码生成通用 C、C++ 和纯 CUDA 代码
自 R2026a 起

您可以将 PyTorch® ExportedProgram 或 LiteRT 模型加载到 MATLAB 中,并生成通用 C/C++ 代码。

如果您拥有 GPU Coder™ 许可证,您还可以生成 CUDA® 代码。

函数

loadLiteRTModelLoad pretrained LiteRT model file
loadPyTorchExportedProgramLoad PyTorch ExportedProgram model file
summaryDisplay input and output specifications of PyTorch ExportedProgram or LiteRT model
inputSpecificationsReturn input specifications for functions in PyTorch ExportedProgram or LiteRT model
outputSpecificationsReturn output specifications for functions in PyTorch ExportedProgram or LiteRT model
invokeRun inference on a PyTorch ExportedProgram or LiteRT model input to compute output

对象

PyTorchExportedProgramPyTorch ExportedProgram model
LiteRTModelLiteRT model

精选示例