class_docstr: Test the abstract base class behaviors.
class_docstr_tok: ["Test","the","abstract","base","class","behaviors","."]
code: def testMultipartKernelFeatureNdims(self, **feature_ndims):
      k0 = TestKernel(multiplier=3.0)
      mk0 = psd_kernel_test_util.MultipartTestKernel(
          k0, feature_ndims=feature_ndims
      )
      k1 = TestKernel(multiplier=2.0)
      mk1 = psd_kernel_test_util.MultipartTestKernel(
          k1, feature_ndims=feature_ndims
      )
  
      # Define inputs to the multipart kernel. `x` has batch shape, `y` does not.
      x = {
          "foo": np.random.normal(
              size=[3, 4] + [5] * feature_ndims["foo"]
          ).astype(np.float32),
          "bar": np.random.normal(
              size=[4] + [6] * feature_ndims["bar"]
          ).astype(np.float32),
      }
      y = {
          "foo": np.random.normal(
              size=[5] * feature_ndims["foo"]
          ).astype(np.float32),
          "bar": np.random.normal(
              size=[6] * feature_ndims["bar"]
          ).astype(np.float32),
      }
  
      # Reshape and concatenate the inputs for the simple kernel.
      x_ = tf.concat(
          [
              tf.reshape(x["foo"], [3, 4, -1]),
              tf.stack([tf.reshape(x["bar"], [4, -1])] * 3, axis=0),
          ],
          axis=-1,
      )
      y_ = tf.concat(
          [tf.reshape(y["foo"], [-1]), tf.reshape(y["bar"], [-1])],
          axis=-1,
      )
  
      self.assertAllClose(k0.apply(x_, y_), mk0.apply(x, y), rtol=1e-5)
      self.assertAllClose(
          (k0 + k1).apply(x_, y_), (mk0 + mk1).apply(x, y), rtol=1e-5
      )
      self.assertAllClose(
          (k0 * k1).apply(x_, y_), (mk0 * mk1).apply(x, y), rtol=1e-5
      )
  
imports: import functools
  import operator
  from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import parameter_properties
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math.psd_kernels import positive_semidefinite_kernel
  from tensorflow_probability.python.math.psd_kernels.internal import test_util
  from tensorflow_probability.python.math.psd_kernels.internal import util
label_desc: Use image node_id 24 for calling the PositiveSemidefiniteKernelTest obj's underlying member method code with example usage: obj.testMultipartKernelFeatureNdims() without return types