---
title: disable_autofuse
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/TensorFlowCommercial/latest/migration/tfmigr1/tfmigr1_tfadapi_0134.html
sourcePath: /source/zh/TensorFlowCommercial/900/migration/tfmigr1/tfmigr1_tfadapi_0134.html
indexId: a1f2f454d5f88399b09840355f679ca44b5b3c7ea88d7ac17694f5d5551f89c879
---
# disable_autofuse

#### 产品支持情况

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


#### 功能说明

TensorFlow网络在CANN平台运行时，会自动根据图结构进行多个算子的自动融合，以获取更优的性能。若开发者不想让某些算子进行自动融合，可通过此接口进行标识。


#### 函数原型

```
def disable_autofuse()
```


#### 参数说明

无


#### 返回值

无


#### 约束说明

“disable_autofuse”接口需要通过with语句调用，仅在对应作用域内的算子不进行自动融合。


#### 调用示例

```
import tensorflow as tf
from npu_bridge.npu_init import *

a = tf.placeholder(tf.float32, (5, 1))
b = tf.constant([1, 2, 3, 4, 5], dtype=tf.float32, shape=(5, 1))
add_0 = tf.add(a, b)
mul_0 = tf.multiply(add_0, b)

with disable_scope():
    # 此作用域中的算子不参与自动融合
    abs_0 = tf.abs(mul_0)
    div_0 = tf.divide(a, abs_0)

with tf.Session() as sess:
    result = sess.run(div_0, feed_dict={a: [[1], [2], [3], [4], [5]]})
    print(result)
```
