def match_lab_lightness(outputs, targets):
    """
    Replace the L layer of LAB image in outputs 
    by the ones in targets
    """
    outputs = outputs.permute(0, 2, 3, 1)
    targets = targets.permute(0, 2, 3, 1)
    outputs[..., 0] = targets[..., 0]
    return outputs.permute(0, 3, 1, 2)