code: def testSingleChangePoint(self):
      amplitude = 5.0
      length_scale = 0.2
  
      k1 = exponentiated_quadratic.ExponentiatedQuadratic(
          amplitude, length_scale
      )
      k2 = matern.MaternThreeHalves(amplitude, length_scale)
  
      x = np.random.uniform(-1, 1, size=[30, 1]).astype(np.float32)
      y = np.random.uniform(-1, 1, size=[30, 1]).astype(np.float32)
  
      locs = np.array([0.0], dtype=np.float32)
      slopes = np.array([3.0], dtype=np.float32)
      k = changepoint.ChangePoint([k1, k2], slopes=slopes, locs=locs)
  
      weights_x = tf.math.sigmoid(slopes * (x - locs))[..., 0]
      weights_y = tf.math.sigmoid(slopes * (y - locs))[..., 0]
      expected_kernel = (
          k1.apply(x, y, example_ndims=1)
          * (1 - weights_x)
          * (1 - weights_y)
          + k2.apply(x, y, example_ndims=1) * weights_x * weights_y
      )
      actual_kernel = k.apply(x, y, example_ndims=1)
      self.assertAllClose(
          self.evaluate(expected_kernel), self.evaluate(actual_kernel)
      )
  
      expected_kernel = (
          k1.matrix(x, y)
          * (1 - weights_x)[..., tf.newaxis]
          * (1 - weights_y)
          + k2.matrix(x, y) * weights_x[..., tf.newaxis] * weights_y
      )
      actual_kernel = k.matrix(x, y)
  
      self.assertAllClose(
          self.evaluate(expected_kernel), self.evaluate(actual_kernel)
      )
  
file_path: probability/tensorflow_probability/python/math/psd_kernels/changepoint_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math.psd_kernels import changepoint
  from tensorflow_probability.python.math.psd_kernels import exponentiated_quadratic
  from tensorflow_probability.python.math.psd_kernels import matern
label_desc: Use image node_id 2 for calling the ChangePointTest obj's underlying member method code with example usage: obj.testSingleChangePoint() without return types