Function: unload

Applicable Products

  • Ascend 950PR&950DT products: Supported
  • Atlas A3 products: Supported
  • Atlas A2 products: Supported
  • Atlas 200I/500 A2 inference products: Supported
  • Atlas inference products: Supported
  • Atlas training products: Supported

Function

Uninstalls the model and releases resources after the model inference is complete.

Prototype

  • C Prototype

    aclError aclmdlUnload(uint32_t modelId)
    
  • Python Function

    ret = acl.mdl.unload(model_id)
    

Parameters

Parameter Description
model_id Int, ID of the model to unload.

Return Values

Return Value Description
ret Int, error code: 0 on success; else, failure.

Constraints

  • When calling acl.mdl.unload to unload a specified model, ensure that the model is not used by other APIs.
  • The operations of loading, executing, and unloading a model must be performed in the same context. For details about how to create a context, see acl.rt.set_device and acl.rt.create_context.

Reference

For the API calling process, see API Calling Process.