def hamming_distance(x, y, *args, **kwargs):
    """
    Compute the Hamming distance.
    
    Parameters
    ----------
    x : torch.Tensor (dtype=torch.bool)
    y : torch.Tensor (dtype=torch.bool)
    *args
        Passed to sum
    *kwargs
        Passed to sum
    
    Returns
    -------
    z : torch.Tensor (dtype=torch.int64)
        The Hamming distance between x and y
    """
    
    z = (x^y).sum(*args, **kwargs)
    return z