code: def stochastic_kl_builder(posterior, prior, sample):
    
    return tf.subtract(
        tf.reduce_sum(posterior.log_prob(sample)),
        tf.reduce_sum(prior.log_prob(sample)))
docs: A pre-canned builder for a ubiquitous stochastic KL estimator.