import tensorflow as tf

    means = tf.concat([
        tf.reshape(means[:, :, :, 0, :],
                   [inputs_shape[0], inputs_shape[1], inputs_shape[2], 1, nr_mix]), m2, m3
    ],
                      axis=3)
    centered_inputs = inputs - means
    inv_stdv = tf.exp(-log_scales)
    plus_in = inv_stdv * (centered_inputs + 1. / 255.)
    cdf_plus = tf.nn.sigmoid(plus_in)
    min_in = inv_stdv * (centered_inputs - 1. / 255.)
    cdf_min = tf.nn.sigmoid(min_in)
    log_cdf_plus = plus_in - tf.nn.softplus(plus_in)
