def variational_dropout(units, keep_prob, fixed_mask_dims=(<NUM_LIT:1>,)):
units_shape = tf.shape(units)<EOL>noise_shape = [units_shape[n] for n in range(len(units.shape))]<EOL>for dim in fixed_mask_dims:<EOL><INDENT>noise_shape[dim] = <NUM_LIT:1><EOL><DEDENT>return tf.nn.dropout(units, keep_prob, noise_shape)<EOL>
Dropout with the same drop mask for all fixed_mask_dims

    Args:
        units: a tensor, usually with shapes [B x T x F], where
            B - batch size
            T - tokens dimension
            F - feature dimension
        keep_prob: keep probability
        fixed_mask_dims: in these dimensions the mask will be the same

    Returns:
        dropped units tensor