mindspore.ops.Dropout
- class mindspore.ops.Dropout(*args, **kwargs)[source]
During training, randomly zeroes some of the elements of the input tensor with probability.
- Parameters
- Inputs:
input (Tensor) - The input of Dropout with data type of float16 or float32.
- Outputs:
output (Tensor) - with the same shape as the input tensor.
mask (Tensor) - with the same shape as the input tensor.
- Raises
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> dropout = ops.Dropout(keep_prob=0.5) >>> x = Tensor(((20, 16), (50, 50)), mindspore.float32) >>> output, mask = dropout(x) >>> print(output.shape) (2, 2)