def METHOD_NAME(nd_tensor):
    """A helper function to transfer a NDArray to torch.tensor."""
    if nd_tensor.dtype == "bool":
        # DLPack does not support boolean so it can't be handled by
        # torch.utils.dlpack.from_pack. Workaround by going through
        # numpy, although this brings additional data copy overhead.
        return torch.from_numpy(nd_tensor.numpy())
    return torch.utils.dlpack.from_dlpack(nd_tensor.to_dlpack())