def _filter_logdensities_warning(record):
    """Filter out specific useless warnings from gpflow.logdensities."""
    if (
        record.levelname == "WARNING"
        and record.msg == "Shape of x must be 2D at computation."
    ):
        # This warning unavoidable, triggered by a tensor with unknown shape.
        # The event is harmless.
        return 0
    return 1