import torch


def deltaE(lab1, lab2):
    """Delta E (CIE 1976).

    lab1: Bx3xHxW
    lab2: Bx3xHxW
    return: Bx1xHxW

    >>> lab1 = torch.tensor([100., 75., 50.]).view(1, 3, 1, 1)
    >>> lab2 = torch.tensor([50., 50., 100.]).view(1, 3, 1, 1)
    >>> deltaE(lab1, lab2).item()
    75.0

    """
    return torch.norm(lab1 - lab2, 2, 1, keepdim=True)