import torch


def rgba_to_rgb(rgba: torch.Tensor):
    """
    Converts tensor from 3 channels into 4.
    Multiplies first 3 channels with the last channel.
    [... 4 H W] -> [... 3 H W]
    """
    return rgba[..., :-1, :, :] * rgba[..., -1:, :, :]