Skip to main content
AJabe.1
Visitor II
September 14, 2020
Question

Using "ai__create(ai_handle* network, const ai_buffer* network_config)"

  • September 14, 2020
  • 1 reply
  • 807 views

I want to use my converted model, and the first step as is mentioned in the instructions, is to use this function. But I don't exactly understand what should I pass as the first argument (network) to the function. should I pass "ai_linearmodel_data_weights_get()" ??

    This topic has been closed for replies.

    1 reply

    ST Employee
    September 15, 2020

    Hello,

    ai__create() is the first function which must be called to create an instance of the generated c-model. This first parameter is "just" a reference to an ai_handle object which will be initialized by the "create" function and used by the other ai__*** functions as handle of the created instance.

    /* Global handle to reference a instantiated C-model */
    static ai_handle network = AI_HANDLE_NULL;
     
     
     /* 1 - Create an instance of the model */
     err = ai_network_create(&network, AI_NETWORK_DATA_CONFIG);

    Complete snipped code example is available in the provided documentation available in the installed pack: "Embedded inference client API" article

    C:\Users\\STM32Cube\Repository\Packs\STMicroelectronics\X-CUBE-AI\5.1.2\Documentation\index.html

    br,

    Jean-Michel