@Distribution
def Polynomial(coefficients, name=None):
    assert 2 >= len(coefficients)

    for coeff in coefficients:
        assert isinstance(coeff, tf.Tensor)

    X = tf.placeholder(config.dtype, name=name)

    pdf = []
    for i, coeff in enumerate(coefficients):
        pdf.append(coeff * X**tf.constant(i, dtype=config.dtype))
    Distribution.logp = tf.log(tf.add_n(pdf))

    def integrate(lower, upper):
        result = []
        for i, coeff in enumerate(coefficients, start=1):
            order = tf.constant(i, dtype=config.dtype)
            result.append(coeff/order * (upper**order - lower**order))
        return tf.add_n(result)

    Distribution.integral = integrate

    return X
dataset/ETHPy150Open tensorprob/tensorprob/tensorprob/distributions/polynomial.py/Polynomial/swapped operands of `>=`