aclgrphSaveModel
Applicability
|
Product |
Supported or Not |
|---|---|
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
Header File/Library File
- Header file: #include <ge/ge_ir_build.h>
- Library file: libge_compiler.so
Function Usage
Serializes an offline model to a file.
Prototype
APIs taking string arguments will be deprecated in future releases. Use APIs taking non-string arguments instead.
1 2 |
graphStatus aclgrphSaveModel(const std::string &output_file, const ModelBufferData &model) graphStatus aclgrphSaveModel(const char_t *output_file, const ModelBufferData &model) |
Parameters
|
Parameter |
Input/Output |
Description |
||
|---|---|---|---|---|
|
model |
Input |
Buffer of the offline model. For details, see ModelBufferData.
data points to the generated model data, and length indicates the actual model size. |
||
|
output_file |
Input |
File name. The name of the generated offline model file automatically ends with .om, for example, ir_build_sample.om or ir_build_sample_linux_x86_64.om. If the name of an .om file contains the OS and architecture, the file can be used only in the operating environment with the OS and architecture. |
Returns
Restrictions
If the name of the generated .om model file contains the OS and architecture, but the OS and architecture are inconsistent with those of the model operating environment, this API must be used together with OPTION_HOST_ENV_OS and OPTION_HOST_ENV_CPU to set the OS type and architecture of the model operating environment. For details about the parameters, see aclgrphBuildInitialize Configuration Parameters.