def q_explained_variance(qpred, q):
    (_, vary) = tf.nn.moments(q, axes=[0, 1])
    (_, varpred) = tf.nn.moments((q - qpred), axes=[0, 1])
    check_shape([vary, varpred], ([[]] * 2))
    return (1.0 - (varpred / vary))
def q_explained_variance(qpred, q):
    (_, vary) = tf.nn.moments(q, axes=[0, 1])
    (_, varpred) = tf.nn.moments((q - qpred), axes=[0, 1])
    check_shape([vary, varpred], ([[]] * 2))
    return (1.0 - (varpred / vary))