SetResourceContext

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

Header File/Library File

  • Header file: #include <graph/inference_context.h>
  • Library file: libgraph.so

Function Usage

Sets the resource context object for the resource identified by the key and hands it over to the resource context manager for management.

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.

Restrictions

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.