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

#### 产品支持情况

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


#### 功能说明

和tf.nn.dropout功能相同。以概率keep_prob（保留概率）将输入Tensor中的元素置零，未被丢弃的元素值按“1/keep_prob”缩放，最终输出Tensor的shape与输入Tensor保持一致。


#### 函数原型

```
def dropout(x, keep_prob, noise_shape=None, seed=None, name=None)
```


#### 参数说明

| 参数名 | 输入/输出 | 描述 |
| --- | --- | --- |
| x | 输入 | 输入Tensor，float类型。 |
| keep\_prob | 输入 | 标量Tensor，float类型。代表每个元素保留的概率。 |
| noise\_shape | 输入 | 一维Tensor，int32类型。表示随机生成的keep\_drop标志的形状。 |
| seed | 输入 | 随机数种子。 |
| name | 输入 | 网络层的名称。 |


#### 返回值

tensor：对输入x执行完dropout操作之后的输出Tensor。


#### 调用示例

```
from npu_bridge.npu_init import *
layers = npu_ops.dropout()
```
