class_docstr: Abstract base class for Multi-Task Kernels.
  
  A `MultiTaskKernel` is defined as a positive-semidefinite kernel over tuples
  `(o, x) x (o', x')`, where `o` is an integer representing a "task" while
  `x` lies in some ambient space. Typically, `o` is from a finite set of
  integers `{1, ..., N}` where `N` represents the number of tasks. Another
  way to phrase this, is a `MultiTaskKernel` represents a finite collection
  of positive-semidefinite kernels one for each "task" in `{1, ..., N}`.
  
  `MultiTaskKernel` offers a public method `matrix_over_all_tasks`.
  
  `matrix_over_all_tasks` computes the value of the kernel *pairwise* on two
  batches of inputs, for every pair of tasks.
  
  An instance of this class is required to pass in `num_tasks` (which is `N`).
class_docstr_tok: ["Abstract","base","class","for","Multi-Task","Kernels",".","A","`","MultiTaskKernel","`","is","defined","as","a","positive-semidefinite","kernel","over","tuples","`","(","o",",","x",")","x","(","o","'",",","x","'",")","`",",","where","`","o","`","is","an","integer","representing","a","``","task","''","while","`","x","`","lies","in","some","ambient","space",".","Typically",",","`","o","`","is","from","a","finite","set","of","integers","`","{","1",",","...",",","N","}","`","where","`","N","`","represents","the","number","of","tasks",".","Another","way","to","phrase","this",",","is","a","`","MultiTaskKernel","`","represents","a","finite","collection","of","positive-semidefinite","kernels","one","for","each","``","task","''","in","`","{","1",",","...",",","N","}","`",".","`","MultiTaskKernel","`","offers","a","public","method","`","matrix_over_all_tasks","`",".","`","matrix_over_all_tasks","`","computes","the","value","of","the","kernel","*","pairwise","*","on","two","batches","of","inputs",",","for","every","pair","of","tasks",".","An","instance","of","this","class","is","required","to","pass","in","`","num_tasks","`","(","which","is","`","N","`",")","."]
docstr: Constructs a MultiTaskKernel instance.
  
  Args:
    num_tasks: Python `integer` indicating the number of tasks.
    dtype: `DType` on which this kernel operates.
    feature_ndims: Python `integer` indicating the number of dims (the rank)
      of the feature space this kernel acts on.
    name: Python `str` name prefixed to Ops created by this class. Default:
      subclass name.
    validate_args: Python `bool`, default `False`. When `True` kernel
      parameters are checked for validity despite possibly degrading runtime
      performance. When `False` invalid inputs may silently render incorrect
      outputs.
    parameters: Python `dict` of constructor arguments.
  
  Raises:
    ValueError: if `num_tasks` is not an integer greater than 0.
docstr_tok: ["Constructs","a","MultiTaskKernel","instance",".","Args",":","num_tasks",":","Python","`","integer","`","indicating","the","number","of","tasks",".","dtype",":","`","DType","`","on","which","this","kernel","operates",".","feature_ndims",":","Python","`","integer","`","indicating","the","number","of","dims","(","the","rank",")","of","the","feature","space","this","kernel","acts","on",".","name",":","Python","`","str","`","name","prefixed","to","Ops","created","by","this","class",".","Default",":","subclass","name",".","validate_args",":","Python","`","bool","`",",","default","`","False","`",".","When","`","True","`","kernel","parameters","are","checked","for","validity","despite","possibly","degrading","runtime","performance",".","When","`","False","`","invalid","inputs","may","silently","render","incorrect","outputs",".","parameters",":","Python","`","dict","`","of","constructor","arguments",".","Raises",":","ValueError",":","if","`","num_tasks","`","is","not","an","integer","greater","than","0","."]
code: def __init__(
      self,
      num_tasks,
      dtype,
      feature_ndims=1,
      name=None,
      validate_args=False,
      parameters=None,
  ):
      """Constructs a MultiTaskKernel instance.
  
      Args:
        num_tasks: Python `integer` indicating the number of tasks.
        dtype: `DType` on which this kernel operates.
        feature_ndims: Python `integer` indicating the number of dims (the rank)
          of the feature space this kernel acts on.
        name: Python `str` name prefixed to Ops created by this class. Default:
          subclass name.
        validate_args: Python `bool`, default `False`. When `True` kernel
          parameters are checked for validity despite possibly degrading runtime
          performance. When `False` invalid inputs may silently render incorrect
          outputs.
        parameters: Python `dict` of constructor arguments.
  
      Raises:
        ValueError: if `num_tasks` is not an integer greater than 0.
      """
  
      if not (isinstance(num_tasks, int) and num_tasks > 0):
          raise ValueError(
              "`num_tasks` must be a Python `integer` greater than zero. "
              + f"Got: {num_tasks}"
          )
      self._num_tasks = num_tasks
  
      super(MultiTaskKernel, self).__init__(
          feature_ndims,
          dtype=dtype,
          name=name,
          validate_args=validate_args,
          parameters=parameters,
      )
  
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import nest_util
  from tensorflow_probability.python.internal import parameter_properties
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.math.psd_kernels import positive_semidefinite_kernel
label_desc: Use image node_id 1 to create a new MultiTaskKernel object from inherited base classes: psd_kernel with example: obj = MultiTaskKernel(num_tasks, dtype, feature_ndims, name, validate_args, parameters)