aclmdlBundleInitFromFile

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product / Atlas A3 inference product

Atlas A2 training product / Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

Function Usage

Initializes a model from a model file if variables need to be dynamically updated during model execution.

Prototype

1
aclError aclmdlBundleInitFromFile(const char* modelPath, void *varWeightPtr, size_t varWeightSize, uint32_t *bundleId)

Parameters

Parameter

Input/Output

Description

modelPath

Input

Pointer to the model file path, which contains the file name. The user who runs the app must have enough permission to access the directory.

The model file is built using the graph build API. Call aclgrphBundleBuildModel to compile the model, and call aclgrphBundleSaveModel to save the model. For details about the APIs, see aclgrphBundleBuildModel in Graph Development.

varWeightPtr

Input

Pointer to the address of the refreshable weight memory required by the model. The memory is managed by the user and cannot be freed during model execution.

If a null pointer is passed, the memory is managed by the system.

varWeightSize

Input

Size of the refreshable weight memory required by the model, in bytes. Invalid when varWeightPtr is a null pointer.

bundleId

Output

Bundle ID returned after the model is successfully initialized. The bundle ID is used for model identification in subsequent operations.

Returns

0 on success; else, failure. For details, see aclError.

Example

For details about the API call sequence and sample code, see Weight update (user-managed memory).