GetVariables
Applicability
Product |
Supported or Not |
|---|---|
√ |
|
√ |
|
x |
|
√ |
|
√ |
Header File/Library File
- Header file: #include <ge/ge_api.h>
- Library file: libge_runner.so
Function Usage
Queries variables and obtains Tensor information of all variable operators or of a specified variable operator within a Session.
Prototype
APIs taking string arguments will be deprecated in future releases. Use APIs taking non-string arguments instead.
1 2 | Status GetVariables(const std::vector<std::string> &var_names, std::vector<Tensor> &var_values) Status GetVariables(const std::vector<AscendString> &var_names, std::vector<Tensor> &var_values) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
var_names |
Input |
Name of the variable operator. If this parameter is left empty, the values of all variable operators are returned. |
var_values |
Output |
Value of the variable operator, which is output in same format as tensor. The value must be the same as that of var_names. |
Returns
Parameter |
Type |
Description |
|---|---|---|
- |
Status |
SUCCESS: success. Other values: The variable operator name does not exist. The variable is not initialized. |
Restrictions
None