Function: get_desc_from_mem

Applicability

Product

Supported (√/x)

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas training products

Atlas inference products

Atlas 200I/500 A2 inference products

Function Usage

Obtains model description from memory.

Prototype

  • C Prototype
    1
    aclError aclmdlGetDescFromMem(aclmdlDesc *modelDesc, const void *model, size_t modelSize)
    
  • Python Function
    1
    ret = acl.mdl.get_desc_from_mem(model_desc, model, model_size)
    

Parameter Description

Parameter

Description

model

Int, pointer address of the memory for storing model data.

Allocate memory on the host or device based on where the application runs. For details about the memory allocation APIs, see Memory Management.

model_size

Int, size of the model data in the memory, in bytes.

model_desc

Int, pointer to data of the aclmdlDesc type. You need to call the create_desc API to create data of the aclmdlDesc type in advance. After the call is successful, the content in the pointer address is updated.

Return Value Description

Return Value

Description

ret

Int, 0 on success; else, failure.

Restrictions

The model description obtained using this API cannot be used for the get_op_attr and get_cur_output_dims APIs.