code: def testValuesAreCorrectAgainstBinary(self, dtype, feature_ndims):
      cont_dim = 3
      cat_dim = 5
      base_kernel = matern.MaternFiveHalves(
          amplitude=np.ones([], dtype=dtype),
          feature_ndims=feature_ndims,
      )
      inverse_scale_diag = np.random.uniform(
          size=[cont_dim + cat_dim]
      ).astype(dtype)
      kernel = fswc.FeatureScaledWithCategorical(
          base_kernel,
          inverse_scale_diag=fswc.ContinuousAndCategoricalValues(
              *tf.split(
                  inverse_scale_diag, [cont_dim, cat_dim], axis=-1
              )
          ),
          validate_args=True,
      )
      feature_scaled_kernel = feature_scaled.FeatureScaled(
          base_kernel,
          inverse_scale_diag=inverse_scale_diag,
          validate_args=True,
      )
  
      x1_cat = np.random.randint(2, size=(3, 1, 4, cat_dim))
      x2_cat = np.random.randint(2, size=(3, 4, cat_dim))
      x1_cont = np.random.normal(size=(3, 1, 4, cont_dim)).astype(dtype)
      x2_cont = np.random.normal(size=(3, 4, cont_dim)).astype(dtype)
  
      x1 = fswc.ContinuousAndCategoricalValues(x1_cont, x1_cat)
      x2 = fswc.ContinuousAndCategoricalValues(x2_cont, x2_cat)
  
      x1_ = np.concatenate([x1_cont, x1_cat.astype(dtype)], axis=-1)
      x2_ = np.concatenate([x2_cont, x2_cat.astype(dtype)], axis=-1)
  
      # When there are only two categories, 0 and 1, the categorical distance is
      # the same as the Euclidean distance.
      expected_kern_mat = self.evaluate(
          feature_scaled_kernel.matrix(x1_, x2_)
      )
      actual_kern_mat = self.evaluate(kernel.matrix(x1, x2))
      self.assertAllClose(expected_kern_mat, actual_kern_mat)
      self.assertDTypeEqual(actual_kern_mat, dtype)
  
      expected_kern_apply = self.evaluate(
          feature_scaled_kernel.apply(x1_, x2_)
      )
      actual_kern_apply = self.evaluate(kernel.apply(x1, x2))
      self.assertAllClose(expected_kern_apply, actual_kern_apply)
      self.assertDTypeEqual(actual_kern_apply, dtype)
  
      expected_kern_tensor = self.evaluate(
          feature_scaled_kernel.tensor(
              x1_, x2_, x1_example_ndims=2, x2_example_ndims=1
          )
      )
      actual_kern_tensor = self.evaluate(
          kernel.tensor(x1, x2, x1_example_ndims=2, x2_example_ndims=1)
      )
      self.assertAllClose(expected_kern_tensor, actual_kern_tensor)
      self.assertDTypeEqual(actual_kern_tensor, dtype)
  
file_path: probability/tensorflow_probability/python/experimental/psd_kernels/feature_scaled_with_categorical_test.py
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.experimental.psd_kernels import feature_scaled_with_categorical
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math.psd_kernels import exponentiated_quadratic
  from tensorflow_probability.python.math.psd_kernels import feature_scaled
  from tensorflow_probability.python.math.psd_kernels import matern
label_desc: Use image node_id 3 for calling the FeatureScaledWithCategoricalTest obj's underlying member method code with example usage: obj.testValuesAreCorrectAgainstBinary(dtype, feature_ndims) without return types