メインコンテンツ

MATLAB での PyTorch モデルおよび LiteRT モデルのコード生成

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 ExportedProgam 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

注目の例