주요 콘텐츠

LiteRTModel

R2026b

LiteRT 모델

R2026a 이후

    설명

    Add-On Required: 이 기능을 사용하려면 MATLAB Coder Support Package for PyTorch and LiteRT Models 애드온이 필요합니다.

    LiteRTModel 객체를 사용하여 MATLAB® 또는 Simulink®에서 모델을 실행하거나 코드를 생성할 수 있습니다.

    생성

    loadLiteRTModel 함수를 사용하여 LiteRTModel 객체를 만듭니다.

    속성

    모두 확장

    모델 경로로, 문자형 벡터로 지정됩니다.

    함수 이름으로, 문자형 벡터로 구성된 셀형 배열로 지정됩니다.

    객체 함수

    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

    예제

    모두 축소

    하나의 입력을 받고 하나의 출력을 반환하는 siso.tflite라는 이름의 LiteRT 모델이 있다고 가정하겠습니다. LiteRTModel 객체를 만듭니다.

    myModel = loadLiteRTModel("siso.tflite")
    Loading model...
    Model loaded.
    
    myModel = 
      LiteRTModel contained in siso.tflite: 
    
                              Input Specifications                       
        _________________________________________________________________
    
        Input     Name                    Size                     Type  
        _____    _______    _________________________________    ________
                                                                         
          1      "image"    "<variable-size> x 128 x 128 x 3"    "single"
    
    
                          Output Specifications                  
        _________________________________________________________
    
        Output       Name               Size               Type  
        ______    __________    _____________________    ________
                                                                 
          1       "output_0"    "<variable-size> x 1"    "single"
    
    
        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
    
    

    확장 기능

    모두 확장

    C/C++ 코드 생성
    MATLAB® Coder™를 사용하여 C 코드나 C++ 코드를 생성할 수 있습니다.

    GPU 코드 생성
    GPU Coder™를 사용하여 NVIDIA® GPU용 CUDA® 코드를 생성할 수 있습니다.

    버전 내역

    R2026a에 개발됨