import torch


def gen_exponential(lam):
    """
    Draws one sample from Exp(lam) (lam is the rate)

    :param lam: rate for the exponential dist
    :return: one sample from Exp(lam)
    """
    return -torch.rand(1).log() / lam