Model

Function Usage

Constructor of the model class.

Prototype

1
2
3
4
Model::Model(std::string &modelPath, const int32_t deviceId = 0); // When the construction fails, the "std::runtime_error" exception occurs.
Model::Model(const Model&) = delete;   // Do not copy the construct.
Model::Model &operate=(const Model&) = delete;  // Do not assign value to the construct.
Model::Model(ModelLoadOptV2 &mdlLoadOpt, const int32_t deviceId = 0);// When the construction fails, the "std::runtime_error" exception occurs.

Parameters

Parameter

Input/Output

Description

modelPath

Input

Model path. A maximum model size can be 4 GB, the model owner must be the current user, with 640 or lower permission on the model file. (For MindIR models, only static shapes and dynamic batches are supported.)

deviceId

Input

Device where the model is deployed. The default value is 0. (The value -1 indicates that the model is deployed on the host. In this case, this field is reserved and cannot be used.)

mdlLoadOpt

Input

Specifies the method for loading an inference model. For details, see ModelLoadOptV2.