def _rfft_1d(
    input_real: Var,
    n: Optional[Var],
    dim: Optional[Var],
    norm: Optional[Var],
) -> Tuple[Var, Var]:
    """
    It's similar to fft, but as the input is real data, the redundant info (the conjugate part) is
    removed in the result.
    """
    input_imag = mb.fill(
        shape=mb.shape(x=input_real),
        value=0.0,
    )
    real_data, imag_data = _fft_1d(input_real, input_imag, n, dim, norm)
    remain_len = real_data.shape[dim.val] // 2 + 1
    remain_indices = mb.range_1d(start=0, end=remain_len, step=1)
    real_data = mb.gather(x=real_data, indices=remain_indices, axis=dim.val)
    imag_data = mb.gather(x=imag_data, indices=remain_indices, axis=dim.val)

    return real_data, imag_data

    It's similar to fft, but as the input is real data, the redundant info (the conjugate part) is
    removed in the result.
    
coremltools/converters/mil/mil/passes/defs/lower_complex_dialect_ops.py