class_docstr: A kernel that takes nested structures as inputs.
  
  The inputs are flattened and concatenated, and then passed to the base kernel.
code: def _apply(self, x1, x2, example_ndims=0):
      def _flatten_and_concat(x):
          flat = tf.nest.flatten(
              tf.nest.map_structure(
                  lambda t, nd: tf.reshape(  # pylint: disable=g-long-lambda
                      t, ps.concat([ps.shape(t)[:-nd], [-1]], axis=0)
                  ),
                  x,
                  self.feature_ndims,
              )
          )
          # Broadcast shapes of flattened components together.
          broadcasted_flat = [
              flat[0] + tf.zeros_like(flat[1][..., :1]),
              flat[1] + tf.zeros_like(flat[0][..., :1]),
          ]
          return tf.concat(broadcasted_flat, axis=-1)
  
      x1 = _flatten_and_concat(x1)
      x2 = _flatten_and_concat(x2)
      return self.kernel._apply(x1, x2, example_ndims=example_ndims)
  
file_path: probability/tensorflow_probability/python/math/psd_kernels/internal/test_util.py
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.internal import parameter_properties
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.math.psd_kernels import positive_semidefinite_kernel
label_desc: Use image node_id 4 for calling the MultipartTestKernel obj's underlying member method code with example usage: obj._apply(x1, x2, example_ndims) and returns: self, tf