docstr: Compute and return full kernel matrix between arrays x and y. 
docstr_tok: ["Compute","and","return","full","kernel","matrix","between","arrays","x","and","y","."]
code: def kernel_matrix(
      self,
      x: Union[np.ndarray, tf.Tensor],
      y: Union[np.ndarray, tf.Tensor],
  ) -> tf.Tensor:
      """Compute and return full kernel matrix between arrays x and y."""
      k_xy = self.kernel(x, y, self.infer_sigma)
      k_xx = (
          self.k_xx
          if self.k_xx is not None and self.update_x_ref is None
          else self.kernel(x, x)
      )
      k_yy = self.kernel(y, y)
      kernel_mat = tf.concat(
          [
              tf.concat([k_xx, k_xy], 1),
              tf.concat([tf.transpose(k_xy, (1, 0)), k_yy], 1),
          ],
          0,
      )
      return kernel_mat
  
file_path: alibi-detect/alibi_detect/cd/tensorflow/mmd.py
imports: import logging
  import numpy
  import tensorflow
  from typing import Callable, Dict, Optional, Tuple, Union
  from alibi_detect.cd.base import BaseMMDDrift
  from alibi_detect.utils.tensorflow.distance import mmd2_from_kernel_matrix
  from alibi_detect.utils.tensorflow.kernels import GaussianRBF
  from alibi_detect.utils.warnings import deprecated_alias
  from alibi_detect.utils.frameworks import Framework
label_desc: Use image node_id 2 for calling the MMDDriftTF obj's underlying member method code with example usage: obj.kernel_matrix(x, y) and returns: kernel_mat