def unnormalize(tensor, mean, std):
    """
        Reverts image normalization transformation using mean and std.
    """
    for t, m, s in zip(tensor, mean, std):
        t.mul_(s).add_(m)
    return tensor