code: def compute_kl_1d(
      q_mu: TensorType, q_sigma: TensorType, p_var: TensorType = 1.0
  ) -> TensorType:
      p_var = tf.ones_like(q_sigma) if p_var is None else p_var
      q_var = tf.square(q_sigma)
      kl = 0.5 * (
          q_var / p_var
          + tf.square(q_mu) / p_var
          - 1
          + tf.math.log(p_var / q_var)
      )
      return tf.reduce_sum(kl)
  
imports: from unittest.mock import patch
  import numpy
  import pytest
  import tensorflow
  from check_shapes import ShapeChecker, check_shapes
  from numpy.testing import assert_allclose, assert_almost_equal
  import gpflow
  from gpflow import Parameter, default_float, default_jitter
  from gpflow.base import AnyNDArray, TensorType
  from gpflow.inducing_variables import InducingPoints
  from gpflow.kernels import Kernel
  from gpflow.kullback_leiblers import gauss_kl, prior_kl
  from gpflow.utilities.bijectors import triangular
label_desc: Use image node_id 6 for calling a global function with example usage: compute_kl_1d(q_mu, q_sigma, p_var) and returns: tf