---
title: RegisterReliedOnResourceKey
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/ascendgraphapi/atlasgeapi_07_0602.html
sourcePath: /source/zh/canncommercial/900/API/ascendgraphapi/atlasgeapi_07_0602.html
indexId: 39e35875f8cf6cf142f86a864ab6bf7a401cb942afe4e9e01b704f1eb5d20fb972
---
# RegisterReliedOnResourceKey

#### 产品支持情况

| 产品 | 是否支持 |
| --- | --- |
| Atlas 350 加速卡 | √ |
| Atlas A3 训练系列产品 / Atlas A3 推理系列产品 | √ |
| Atlas A2 训练系列产品 / Atlas A2 推理系列产品 | √ |
| Atlas 200I/500 A2 推理产品 | √ |
| Atlas 推理系列产品 | √ |
| Atlas 训练系列产品 | √ |


#### 头文件/库文件

- 头文件：#include <graph/inference_context.h>
- 库文件：libgraph.so


#### 功能说明

注册依赖的资源。

一般由读类型的算子调用，如stack pop。因读类型算子的shape依赖资源算子，调用该接口注册依赖的资源标识。

若资源算子shape变化可触发读类型算子的重新推导。


#### 函数原型

```
graphStatus RegisterReliedOnResourceKey(const ge::AscendString &key)
```


#### 参数说明

| 参数名 | 输入/输出 | 描述 |
| --- | --- | --- |
| key | 输入 | 资源的唯一标识。 |


#### 返回值说明

graphStatus类型：GRAPH_SUCCESS，代表成功；GRAPH_FAILED，代表失败。


#### 约束说明

无。
