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

#### 产品支持情况

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


#### 头文件/库文件

- 头文件：#include <ge/fusion/pattern.h>
- 库文件：libge_compiler.so


#### 功能说明

捕获Pattern中一个Tensor，从而在MatchResult中可以按序获取。

捕获Node的output，用于后续在MatchResult中通过捕获时的索引，快速获取到Node output，用户可以从Match Result中拿到Tensor描述做校验。


#### 函数原型

```
Pattern &CaptureTensor(const NodeIo &node_output)
```


#### 参数说明

| 参数名 | 输入/输出 | 说明 |
| --- | --- | --- |
| node\_output | 输入 | Tensor的来源，即来自某个Node的某个输出。 因node\_output可唯一标定一个图中Tensor，因此常用node\_output指代Tensor。 |


#### 返回值说明

| 参数名 | 类型 | 说明 |
| --- | --- | --- |
| \- | Pattern & | Pattern的引用，便于级联调用。 |


#### 约束说明

无
