invoke
Run inference on a PyTorch ExportedProgram or LiteRT model input to compute output
Since R2026a
Syntax
Description
Add-On Required: This feature requires the MATLAB Coder Support Package for PyTorch and LiteRT Models add-on.
[Y1,...,YN] = invoke(___) returns the outputs
Y1, …, YN for models that have N outputs.
[___] = invoke(___,FcnName=
computes the outputs for the function, FcnName)FcnName, in the model.
Note
If the model contains multiple functions, you must specify the name of the function for which to calculate the outputs.
Note
Instead of using the invoke method, you can call object with an
argument as if it were a function. For example, Y = model(X) and
Y = invoke(model, X) perform equivalent operations.
Examples
Input Arguments
Output Arguments
Extended Capabilities
Version History
Introduced in R2026a