GetResourceContext
Applicability
Product |
Supported or Not |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
Header File
#include <graph/inference_context.h>
Function Usage
Obtains a resource context object based on a resource key.
Prototype
1 | ResourceContext *GetResourceContext(const ge::AscendString &key) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
key |
Input |
Unique resource key, which is specified by the InferShape function of the resource operator. |
Returns
Resource context object.
The basic definition is as follows, based on which the resource operator can be extended.
struct ResourceContext { virtual ~ResourceContext() {}};
Used to store resource information, such as shape and data type.
Constraints
Check that the return is not a null pointer before using it, as this API will return a null pointer if the pointer to the resource context manager is not passed when creating InferenceContext using the Create API.