---
title: 简介
description: "用于做子图匹配的工具类，该类接收一个Pattern定义和待匹配的Graph。将使用Pattern对Graph进行匹配，提供MatchNext接口逐一返回匹配结果。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/ascendgraphapi/atlasgeapi_07_0215.html
sourcePath: /source/zh/canncommercial/900/API/ascendgraphapi/atlasgeapi_07_0215.html
indexId: 1ef3b8b5a8037d8fcd617d285db87ca978cf35a70705600ac7ee6032ad6379c672
---
# 简介

用于做子图匹配的工具类，该类接收一个Pattern定义和待匹配的Graph。将使用Pattern对Graph进行匹配，提供MatchNext接口逐一返回匹配结果。

#### 需要包含的头文件

```
#include <ge/fusion/pattern_matcher.h>
```


#### Public成员函数

```
explicit PatternMatcher(std::unique_ptr<Pattern> pattern, const GraphPtr &target_graph)
[[nodiscard]] std::unique_ptr<MatchResult> MatchNext()
```
