Dropout
Description
Dropout uses the input floating-point tensor, optional input ratio (floating-point scalar), and optional input training_mode (bool scalar). It generates two tensor outputs: output (floating-point tensor) and mask (optional). If training_mode is true, the output Y undergoes random dropout. This dropout scales the mask input data according to the following formula. Therefore, to convert the trained model to inference mode, you can simply omit the input or set it to false.

Input
- data: input tensor of type float16 or float.
- ratio (optional): random dropout ratio. The value range is [0, 1). The default value is 0.5. The data type can be float16 or float.
- training_mode (optional): If set to true, dropout is being used for training. Unless otherwise specified, the value is false. If it is false, ratio is ignored and the operation simulates the inference mode. In this mode, no content is deleted from the input data. If the mask is requested as the output, it contains all 1s. The data type is bool.
Output
- output: output tensor of the identical data type to the input.
- mask (optional): output tensor of type bool, specifying the output mask.
Constraints
None.
ONNX Opset Support
Opset v8/v9/v10/v11/v12/v13/v14/v15/v16/v17/v18
Parent topic: Supported ONNX Operators