def cross_entropy_multi_derivative(backend, outputs, targets, temp, scale=1.0):
    """
    Applies derivative of the cross entropy to the pairwise elements from
    outputs and targets.

    Arguments:
        backend (Backend): The backend class to use for computation.
        outputs (Tensor): predicted output values to be compared.
        targets (Tensor): known outcome values to be compared against.
        temp (Tensor): temporary buffers.

    Returns:
        Tensor: Calculated cross entropy values for each element.
    """
    backend.divide(targets, outputs, out=temp[0])
    backend.multiply(temp[0], -scale, out=temp[0])
    return temp[0]