---
title: TbeDynamicElemwiseReduceFusionPass
description: "该融合规则在动态shape场景下将如下pattern子图进行UB融合。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/maintenref/graphubfusionref/atlasrr_30_0213.html
sourcePath: /source/zh/canncommercial/900/maintenref/graphubfusionref/atlasrr_30_0213.html
indexId: 8814c59c3b35201f65ba536702b7f5621b5eeef1ca7beadb45ea258ea7db1e7d78
---
# TbeDynamicElemwiseReduceFusionPass

#### 融合模式

该融合规则在动态shape场景下将如下pattern子图进行UB融合。

模式一：


模式二：


#### 使用约束

模式一的约束如下：

- 仅支持动态场景。
- Elemwise1必须有且数量为1。
- CommReduce必须有且数量为1。
- Elemwise2、Elemwise3数量可无，最多分别不超过5个。
- Elemwise2、Elemwise3不支持为多输入节点。

模式二的约束如下：

- 仅支持动态场景。
- CommReduce必须有且数量为1。
- Elemwise4数量至少含有一个，最多不超过5。
- Elemwise4不能为多输入节点。
