GetResourceContext
产品支持情况
头文件
#include <graph/inference_context.h>
功能说明
通过资源标识key来获取对应的资源上下文对象。
函数原型
ResourceContext *GetResourceContext(const ge::AscendString &key)
参数说明
返回值说明
资源上下文对象。
基础定义如下,资源类算子可以基于此扩展。
struct ResourceContext { virtual ~ResourceContext() {}};
用于保存资源相关信息,如shape、datatype等。
约束说明
若使用Create接口创建InferenceContext时未传入resource context管理器指针,则该接口返回空指针,因此使用其返回值之前需要判空。