---
title: PatternMatcher构造函数和析构函数
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/ascendgraphapi/atlasgeapi_07_0216.html
sourcePath: /source/zh/canncommercial/900/API/ascendgraphapi/atlasgeapi_07_0216.html
indexId: eb471c4b94686b86798fe2d2b4e3f73c9400e67f97363fd340b94e4338434ed272
---
# PatternMatcher构造函数和析构函数

#### 产品支持情况

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


#### 头文件/库文件

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


#### 功能说明

通过Pattern和Target Graph构造一个PatternMatcher。


#### 函数原型

```
explicit PatternMatcher(std::unique_ptr<Pattern> pattern, const GraphPtr &target_graph)
~PatternMatcher()
```


#### 参数说明

| 参数名 | 输入/输出 | 说明 |
| --- | --- | --- |
| pattern | 输入 | Pattern定义。构造完PatternMatcher后其生命周期由Matcher管理。 |
| target\_graph | 输入 | 待匹配的Graph。 |


#### 返回值说明

无


#### 约束说明

无
