---
title: GetRequiredInputTensor
description: "- 头文件：#include <exe_graph/runtime/eager_op_execution_context.h>"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/ascendgraphapi/atlasgeapi_07_0692.html
sourcePath: /source/zh/canncommercial/900/API/ascendgraphapi/atlasgeapi_07_0692.html
indexId: 202aa8653f36ccec0f835d3d6ced68e07115e82a2351e401dcc2e2b7efb5d11e72
---
# GetRequiredInputTensor

#### 头文件/库文件

- 头文件：#include <exe_graph/runtime/eager_op_execution_context.h>
- 库文件：liblowering.so


#### 功能说明

基于算子IR原型定义，获取REQUIRED_INPUT类型的输入Tensor指针。


#### 函数原型

```
const Tensor *GetRequiredInputTensor(size_t ir_index) const
```


#### 参数说明

| 参数名 | 输入/输出 | 描述 |
| --- | --- | --- |
| ir\_index | 输入 | IR原型定义中的index。 |


#### 返回值说明

Tensor指针，异常时返回空指针。


#### 约束说明

无
