SetResourceContext
Applicability
Product |
Supported or Not |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
Header File
#include <graph/inference_context.h>
Function Usage
Sets the resource context object for the resource that is marked with key. The resource context object is managed by the resource context manager.
This API is generally called by resource operators of the write type, such as stack push.
Prototype
1 | graphStatus SetResourceContext(const ge::AscendString &key, ResourceContext *resource_context) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
key |
Input |
Unique resource key. |
resource_context |
Input |
Pointer to the resource context object. For details, see the return value description of the GetResourceContext API. |
Returns
graphStatus type. GRAPH_SUCCESS on success; GRAPH_FAILED on failure.
Constraints
This API will return a failure if the pointer to the resource context manager is not passed when InferenceContext is created using the Create API.