RegisterCallBackFunc
Applicability
Product |
Supported or Not |
|---|---|
√ |
|
√ |
|
x |
|
√ |
|
√ |
Header File/Library File
- Header file: #include <ge/ge_api.h>
- Library file: libge_runner.so
Function Usage
Registers a callback function.
Registers the specified Summary and Checkpoint callback function, which will be called by GE if the graph sent to GE contains Summary and Checkpoint operators.
Prototype
APIs taking string arguments will be deprecated in future releases. Use APIs taking non-string arguments instead.
1 2 | Status RegisterCallBackFunc(const std::string &key, const pCallBackFunc &callback) Status RegisterCallBackFunc(const char *key, const session::pCallBackFunc &callback) |
Parameters
Parameter |
Input/Output |
Description |
||
|---|---|---|---|---|
key |
Input |
Keyword of the callback function to be registered, indicating the callback function type. The value is a string or character, for example, Summary and Save. |
||
callback |
Input |
Information to be returned by the callback function.
|
Returns
Parameter |
Type |
Description |
|---|---|---|
- |
Status |
GE_SESSION_MANAGER_NOT_INIT: Session management is not initialized. SUCCESS: The callback function is successfully registered. FAILED: The callback function fails to be registered. |
Restrictions
- The callback function type can only be Summary or Save.
- If the function fails to be registered and the sent graph contains the Summary and Checkpoint operators, an error is reported.
- Currently, the callback function can be called only once after a graph is executed.