def relu(x):
    """
    Used in conjunction with :class:`_NonLinearityLayer` to create a rectified
    linear unit layer.  The user does not instantiate this directly, but instead
    passes the class as the ``activation`` or ``weight_init`` argument to
    :class:`NN` either  when creating it or adding
    certain kinds of layers.

    :param float x: input to the rectified linear unit
    :return: 0 if x < 0, otherwise x
    :rtype: float
    """
    return x * (x > 0)
