def METHOD_NAME(self, inputs, training=None):
    if isinstance(self.rate, numbers.Real) and self.rate == 0:
        return tf.identity(inputs)
    if training is None:
        training = backend.learning_phase()
    def dropped_inputs():
        return self._random_generator.dropout(
            inputs, self.rate, noise_shape=self._get_noise_shape(inputs)
        )
    output = control_flow_util.smart_cond(
        training, dropped_inputs, lambda: tf.identity(inputs)
    )
    return output