mindspore.ops.DropoutGenMask
- class mindspore.ops.DropoutGenMask(*args, **kwargs)[source]
Generates the mask value for the input shape.
- Parameters
- Inputs:
shape (tuple[int]) - The shape of target mask.
keep_prob (Tensor) - The keep rate, greater than 0 and less equal than 1, e.g. keep_prob = 0.9, means dropping out 10% of input units.
- Outputs:
Tensor, the value of generated mask for input shape.
- Raises
- Supported Platforms:
Ascend
Examples
>>> dropout_gen_mask = ops.DropoutGenMask() >>> shape = (2, 4, 5) >>> keep_prob = Tensor(0.5, mindspore.float32) >>> output = dropout_gen_mask(shape, keep_prob) >>> print(output.shape) (16,)