code: def test_independent_interdomain_conditional_bug_regression() -> None:
      """
      Regression test for https://github.com/GPflow/GPflow/issues/818
      Not an exhaustive test
      """
      cs = ShapeChecker().check_shape
  
      M = 31
      N = 11
      D_lat = 5
      D_inp = D_lat * 7
      L = 2
      P = 3
  
      X = cs(np.random.randn(N, D_inp), "[N, D_inp]")
      Zs = cs(
          [np.random.randn(M, D_lat) for _ in range(L)], "[L, M, D_lat]"
      )
      k = gpflow.kernels.SquaredExponential(lengthscales=np.ones(D_lat))
  
      @check_shapes(
          "Z: [M, D_lat]",
          "X: [N, D_inp]",
          "return: [P, M, N]",
      )
      def compute_Kmn(Z: tf.Tensor, X: tf.Tensor) -> tf.Tensor:
          return tf.stack(
              [
                  k(Z, X[:, i * D_lat : (i + 1) * D_lat])
                  for i in range(P)
              ]
          )
  
      @check_shapes(
          "X: [N, D_inp]",
          "return: [P, N]",
      )
      def compute_Knn(X: tf.Tensor) -> tf.Tensor:
          return tf.stack(
              [
                  k(X[:, i * D_lat : (i + 1) * D_lat], full_cov=False)
                  for i in range(P)
              ]
          )
  
      Kmm = cs(tf.stack([k(Z) for Z in Zs]), "[L, M, M]")
      Kmn = cs(
          tf.stack([compute_Kmn(Z, X) for Z in Zs]), "[L, P, M, N]"
      )
      Kmn = cs(tf.transpose(Kmn, [2, 0, 3, 1]), "[M, L, N, P]")
      Knn = cs(tf.transpose(compute_Knn(X)), "[N, P]")
      q_mu = cs(tf.convert_to_tensor(np.zeros((M, L))), "[M, L]")
      q_sqrt = cs(
          tf.convert_to_tensor(np.stack([np.eye(M) for _ in range(L)])),
          "[L, M, M]",
      )
  
      _, _ = independent_interdomain_conditional(
          Kmn,
          Kmm,
          Knn,
          q_mu,
          q_sqrt=q_sqrt,
          full_cov=False,
          full_output_cov=False,
      )
  
imports: from typing import Callable, List, Sequence, Tuple, cast
  import numpy
  import pytest
  import scipy
  import tensorflow
  from _pytest.fixtures import SubRequest
  from check_shapes import ShapeChecker, check_shapes
  import gpflow
  import gpflow.inducing_variables.multioutput
  import gpflow.kernels.multioutput
  from gpflow import set_trainable
  from gpflow.base import AnyNDArray, RegressionData
  from gpflow.conditionals import sample_conditional
  from gpflow.conditionals.util import fully_correlated_conditional, fully_correlated_conditional_repeat, independent_interdomain_conditional, sample_mvn
  from gpflow.config import default_float, default_jitter
  from gpflow.inducing_variables import InducingPoints
  from gpflow.kernels import SquaredExponential
  from gpflow.likelihoods import Gaussian
  from gpflow.models import SVGP
label_desc: Use image node_id 23 for calling a global function with example usage: test_independent_interdomain_conditional_bug_regression() and returns: tf, tf