Function: set_config_opt
C Prototype |
aclError aclmdlSetConfigOpt(aclmdlConfigHandle *handle, aclmdlConfigAttr attr, const void *attrValue, size_t valueSize) |
|---|---|
Python Function |
ret = acl.mdl.set_config_opt(config_handle, attr, attrValue) |
Function Usage |
Set the value of an attribute in the configuration object for loading a model, including the model execution priority, model file directory or memory address, and memory size. |
Input Description |
config_handle: int, pointer address to the configuration object for loading a model. Call acl.mdl.create_config_handle to create the pointer address in advance. attr: int, attribute to be set. For details about the value, see aclmdlConfigAttr. attrValue: int, attribute value. |
Return Value |
ret: int, error code.
|
Restrictions |
This API needs to work with the following APIs to load models:
|
API |
acl.mdl.set_config_opt and acl.mdl.load_with_config, however, are more complicated. The caller needs to set the attributes in the configuration object passed to the API call to decide how the model will be loaded and who will manage the memory. By choosing from the following pyACL APIs, you can directly determine whether to load a model from a file or from memory and whether the memory is managed by the system or the user. |