class_docstr: This kernel supports the LCM kernel. It allows the user to specify a list of
  base kernels to use, and individual `MultitaskKernel` objects are fit to each
  of them. The final kernel is the linear sum of the Kronecker product of all
  these base kernels with their respective `MultitaskKernel` objects.
  
  The returned object is of type :obj:`~linear_operator.operators.KroneckerProductLinearOperator`.
class_docstr_tok: ["This","kernel","supports","the","LCM","kernel",".","It","allows","the","user","to","specify","a","list","of","base","kernels","to","use",",","and","individual","`","MultitaskKernel","`","objects","are","fit","to","each","of","them",".","The","final","kernel","is","the","linear","sum","of","the","Kronecker","product","of","all","these","base","kernels","with","their","respective","`","MultitaskKernel","`","objects",".","The","returned","object","is","of","type",":","obj",":","`","~linear_operator.operators.KroneckerProductLinearOperator","`","."]
docstr: Args:
      base_kernels (:type: list of `Kernel` objects): A list of base kernels.
      num_tasks (int): The number of output tasks to fit.
      rank (int): Rank of index kernel to use for task covariance matrix for each
                  of the base kernels.
      task_covar_prior (:obj:`gpytorch.priors.Prior`): Prior to use for each
          task kernel. See :class:`gpytorch.kernels.IndexKernel` for details.
docstr_tok: ["Args",":","base_kernels","(",":","type",":","list","of","`","Kernel","`","objects",")",":","A","list","of","base","kernels",".","num_tasks","(","int",")",":","The","number","of","output","tasks","to","fit",".","rank","(","int",")",":","Rank","of","index","kernel","to","use","for","task","covariance","matrix","for","each","of","the","base","kernels",".","task_covar_prior","(",":","obj",":","`","gpytorch.priors.Prior","`",")",":","Prior","to","use","for","each","task","kernel",".","See",":","class",":","`","gpytorch.kernels.IndexKernel","`","for","details","."]
code: def __init__(
      self,
      base_kernels: List[Kernel],
      num_tasks: int,
      rank: Optional[Union[int, List]] = 1,
      task_covar_prior: Optional[Prior] = None,
  ):
      """
      Args:
          base_kernels (:type: list of `Kernel` objects): A list of base kernels.
          num_tasks (int): The number of output tasks to fit.
          rank (int): Rank of index kernel to use for task covariance matrix for each
                      of the base kernels.
          task_covar_prior (:obj:`gpytorch.priors.Prior`): Prior to use for each
              task kernel. See :class:`gpytorch.kernels.IndexKernel` for details.
      """
      if len(base_kernels) < 1:
          raise ValueError("At least one base kernel must be provided.")
      for k in base_kernels:
          if not isinstance(k, Kernel):
              raise ValueError(
                  "base_kernels must only contain Kernel objects"
              )
      if not isinstance(rank, list):
          rank = [rank] * len(base_kernels)
  
      super(LCMKernel, self).__init__()
      self.covar_module_list = ModuleList(
          [
              MultitaskKernel(
                  base_kernel,
                  num_tasks=num_tasks,
                  rank=r,
                  task_covar_prior=task_covar_prior,
              )
              for base_kernel, r in length_safe_zip(base_kernels, rank)
          ]
      )
  
file_path: gpytorch/gpytorch/kernels/lcm_kernel.py
imports: from copy import deepcopy
  from typing import List, Optional, Union
  from torch.nn import ModuleList
  from ..priors import Prior
  from ..utils.generic import length_safe_zip
  from .kernel import Kernel
  from .multitask_kernel import MultitaskKernel
label_desc: Use image node_id 1 to create a new LCMKernel object from inherited base classes: Kernel with example: obj = LCMKernel(base_kernels, num_tasks, rank, task_covar_prior)