'Parameters
input : tensor
output from the previous layer
deterministic : bool
If true dropout and scaling is disabled, see notes'

def get_output_for(self, input, deterministic=False, **kwargs):

    if (deterministic or (self.p == 0)):
        return input
    else:
        retain_prob = (1.0 - self.p)
        if self.rescale:
            input /= retain_prob
        return tf.nn.dropout(input, keep_prob=retain_prob)
