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

#### 产品支持情况

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


#### 功能说明

指定哪些算子保持原有精度，如果原始网络模型中的算子精度在AI处理器上不支持，则系统内部自动采用算子支持的高精度来计算。


#### 函数原型

```
def keep_dtype_scope()
```


#### 参数说明

无


#### 使用约束

算子精度模式为保持原图精度（即precision_mode指定为must_keep_origin_dtype）时，该接口不生效。


#### 返回值

无


#### 调用示例

```
with npu_scope.keep_dtype_scope(): 
    X = tf.conv2d(a)
```
