import torch


def _is_type_tensor(tensor, types):
    """Checks whether the elements of the input tensor are of a given type"""
    if torch.is_tensor(tensor):
        if any(tensor.dtype == type_ for type_ in types):
            return True
    return False