Function: get_desc_from_mem

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product / Atlas A3 inference product

Atlas A2 training product / Atlas A2 inference product

Atlas training product

Atlas inference product

Atlas 200I/500 A2 inference product

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)
    

Parameters

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.

Returns

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.