主要内容

summary

Display input and output specifications of PyTorch ExportedProgram or LiteRT model

Since R2026a

    Description

    Add-On Required: This feature requires the MATLAB Coder Support Package for PyTorch and LiteRT Models add-on.

    summary(model) returns the input and output specifications of the specified model.

    Note

    Use this syntax to extract specifications of a model that contains only one function. If a model contains multiple functions, you must specify the name of the function for which to extract the specifications.

    summary(model,FcnName=FcnName) returns the input and output specifications of the specific function in the model.

    example

    Examples

    collapse all

    Use the loadLiteRTModel function to load a LiteRT model named multi_sig.tflite.

    myModel = loadLiteRTModel("multi_sig.tflite")
    Loading the model. This may take a few minutes.
    
    myModel = 
      LiteRTModel contained in multi_sig.tflite: 
    
    Contains 2 functions: adder, multiplier 
    
        properties: 
            ModelPath                         -      Path to the model file
            FcnNames                          -      Names of the functions in the model
        methods: 
            invoke                            -      Performs forward inference by invoking a function in the model
            inputSpecifications               -      Returns the input specifications of the model or of a specific function in the model
            outputSpecifications              -      Returns the output specifications of the model or of a specific function in the model
            summary                           -      Displays the input and output specifications of the model or of a specific function in the model
    
    

    myModel object contains two functions. Display the input and output specifications for the function named adder.

    summary(myModel,FcnName="adder")
                Input Specifications        
        ____________________________________
    
        Input    Name     Size        Type  
        _____    ____    _______    ________
                                            
          1      "x"     "1 x 1"    "single"
    
    
                  Output Specifications          
        _________________________________________
    
        Output      Name       Size        Type  
        ______    ________    _______    ________
                                                 
          1       "output"    "1 x 1"    "single"
    

    Input Arguments

    collapse all

    Input model, specified as either:

    Name of function for which to return the summary, specified as a character vector or string scalar.

    Example: "predict"

    Example: "plus_miso_3x4x5"

    Version History

    Introduced in R2026a