class_docstr: - Shared: we use the same kernel for each latent GP
  - Independent: Latents are uncorrelated a priori.
  
  .. warning::
     This class is created only for testing and comparison purposes.
     Use `gpflow.kernels` instead for more efficient code.
class_docstr_tok: ["-","Shared",":","we","use","the","same","kernel","for","each","latent","GP","-","Independent",":","Latents","are","uncorrelated","a","priori",".","..","warning",":",":","This","class","is","created","only","for","testing","and","comparison","purposes",".","Use","`","gpflow.kernels","`","instead","for","more","efficient","code","."]
code: def K_diag(
      self, X: TensorType, full_output_cov: bool = True
  ) -> tf.Tensor:
      K = cs(self.kernel.K_diag(X), "[batch..., N]")
      rank = tf.rank(X) - 1
      ones = tf.ones((rank,), dtype=tf.int32)
      multiples = tf.concat([ones, [self.output_dim]], 0)
      Ks = cs(tf.tile(K[..., None], multiples), "[batch..., N, P]")
      return tf.linalg.diag(Ks) if full_output_cov else Ks
  
imports: import abc
  from typing import Optional, Sequence, Tuple
  import tensorflow
  from check_shapes import check_shape
  from check_shapes import check_shapes, inherit_check_shapes
  from ...base import Parameter, TensorType
  from ..base import Combination, Kernel
label_desc: Use image node_id 5 for calling the SharedIndependent obj's underlying member method code with example usage: obj.K_diag(X, full_output_cov) and returns: unknown