code: def test_oned(white: bool, dim: bool) -> None:
      """
      Check that the KL divergence matches a 1D by-hand calculation.
      """
      mu1d = Datum.mu[dim, :][None, :]  # [1, N]
      s1d = Datum.sqrt[:, dim, dim][:, None, None]  # [N, 1, 1]
      K1d = Datum.K_batch[:, dim, dim][:, None, None]  # [N, 1, 1]
  
      kl = gauss_kl(mu1d, s1d, K1d if not white else None)
      kl_1d = compute_kl_1d(
          tf.reshape(mu1d, (-1,)),  # N
          tf.reshape(s1d, (-1,)),  # N
          None if white else tf.reshape(K1d, (-1,)),
      )  # N
      np.testing.assert_allclose(kl, kl_1d)
  
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 12 for calling a global function with example usage: test_oned(white, dim) without return types