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

#### 产品支持情况

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


#### 头文件/库文件

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


#### 功能说明

基于算子类型，获取缓存在Graph中的所有指定类型的op对象。


#### 函数原型

数据类型为string的接口后续版本会废弃，建议使用数据类型为非string的接口。


```
graphStatus FindOpByType(const std::string &type, std::vector<ge::Operator> &ops) const
graphStatus FindOpByType(const char_t *type, std::vector<ge::Operator> &ops) const
```


#### 参数说明

| 参数名 | 输入/输出 | 说明 |
| --- | --- | --- |
| type | 输入 | 需要获取的算子类型。 |
| ops | 输出 | 返回用户所需要的op对象。 |


#### 返回值说明

| 参数名 | 类型 | 说明 |
| --- | --- | --- |
| \- | graphStatus | GRAPH\_SUCCESS(0)：成功。 其他值：失败。 |


#### 约束说明

无
