import torch


def flip_cihp(tail_list):
    """
        Swap channels in a probability map so that "left foot" becomes "right foot" etc.

        tail_list: (B x n_class x h x w)
    """
    return torch.cat((
        tail_list[:, :14],
        tail_list[:, 14:15],
        tail_list[:, 15:16],
        tail_list[:, 17:18],
        tail_list[:, 16:17],
        tail_list[:, 19:20],
        tail_list[:, 18:19]), dim=1)