def imag(x):
    """Returns the imaginary part of a complex tensor.

    :param x: The complex tensor
    :type x: torch.Tensor

    :returns: The imaginary part of `x`; will have one less dimension than `x`.
    :rtype: torch.Tensor
    """
    return x[1, ...]