code: def testPairwiseSquareDistanceMatrix(self, feature_ndims, dims):
      batch_shape = [2, 3]
      seed_stream = test_util.test_seed_stream(
          "pairwise_square_distance"
      )
      x1 = tf.random.normal(
          dtype=np.float64,
          shape=batch_shape + [dims] * feature_ndims,
          seed=seed_stream(),
      )
      x2 = tf.random.normal(
          dtype=np.float64,
          shape=batch_shape + [dims] * feature_ndims,
          seed=seed_stream(),
      )
      pairwise_square_distance = util.pairwise_square_distance_matrix(
          x1, x2, feature_ndims
      )
  
      x1_pad = util.pad_shape_with_ones(
          x1, ndims=1, start=-(feature_ndims + 1)
      )
      x2_pad = util.pad_shape_with_ones(
          x2, ndims=1, start=-(feature_ndims + 2)
      )
      actual_square_distance = (
          util.sum_rightmost_ndims_preserving_shape(
              tf.math.squared_difference(x1_pad, x2_pad), feature_ndims
          )
      )
      (
          pairwise_square_distance_,
          actual_square_distance_,
      ) = self.evaluate(
          [pairwise_square_distance, actual_square_distance]
      )
      self.assertAllClose(
          pairwise_square_distance_, actual_square_distance_
      )
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math.gradient import value_and_gradient
  from tensorflow_probability.python.math.psd_kernels.internal import util
label_desc: Use image node_id 12 for calling the UtilTest obj's underlying member method code with example usage: obj.testPairwiseSquareDistanceMatrix(feature_ndims, dims) without return types