import torch


def any_nan(tensor: torch.Tensor) -> bool:
    """Returns true if the tensor contains a NaN

    Args:
        tensor (torch.Tensor): the input tensor

    Returns:
        bool: true if contains a NaN
    """
    return bool(torch.isnan(tensor).any().item())