import torch


def conj(input):
    """
    Returns the complex conjugate of the input complex tensor.
    """

    assert (torch.is_tensor(input) and input.size(-1) == 2), "Input is expected " \
                                                          + "to be a complex tensor."

    out = input.clone()
    out[..., 1] = -out[..., 1]
    return out