code: def logit_normal_variance_trapezoid(loc, scale):
      """Brute-force the variance of LogitNormal(loc, scale) by quadrature."""
      dist = normal.Normal(loc, scale)
      grid, compute = logit_normal_trapezoid_rule(loc, scale)
      probs = dist.prob(grid)
      sigmoids = tf.sigmoid(grid)
      mean = compute(sigmoids * probs)
      return compute((sigmoids - mean) ** 2 * probs)
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import bernoulli
  from tensorflow_probability.python.distributions import kullback_leibler
  from tensorflow_probability.python.distributions import logitnormal
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 3 for calling a global function with example usage: logit_normal_variance_trapezoid(loc, scale) and returns: compute