class_docstr: - Separate: we use different kernel for each output latent
  - Independent: Latents are uncorrelated a priori.
class_docstr_tok: ["-","Separate",":","we","use","different","kernel","for","each","output","latent","-","Independent",":","Latents","are","uncorrelated","a","priori","."]
code: def K_diag(
      self, X: TensorType, full_output_cov: bool = False
  ) -> tf.Tensor:
      stacked = cs(
          tf.stack([k.K_diag(X) for k in self.kernels], axis=-1),
          "[batch..., N, P]",
      )
      if full_output_cov:
          return cs(tf.linalg.diag(stacked), "[batch..., N, P, P]")
      else:
          return stacked
  
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 SeparateIndependent obj's underlying member method code with example usage: obj.K_diag(X, full_output_cov) and returns: cs, stacked