Function: unload

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

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

Prototype

  • C Prototype
    1
    aclError aclmdlUnload(uint32_t modelId)
    
  • Python Function
    1
    ret = acl.mdl.unload(model_id)
    

Parameter Description

Parameter

Description

model_id

Int, ID of the model to unload.

Return Value Description

Return Value

Description

ret

Int, error code: 0 on success; else, failure.

Restrictions

  • 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 call sequence, see API Call Sequence.