class_docstr: The Latent Context Embedding Additive (LCE-A) Kernel.
  
  This kernel is similar to the SACKernel, and is used when context breakdowns are
  unbserverable. It assumes the same additive structure and a spatial kernel shared
  across contexts. Rather than assuming independence, LCEAKernel models the
  correlation in the latent functions for each context through learning context
  embeddings.
docstr: Generate embedding features of contexts when model has multiple batches.
  
  Returns:
      a (ns) x num_contexts x n_embs tensor. ns is the batch size i.e num of
      posterior samples; n_embs is the sum of embedding dimensions i.e.
      sum(embs_dim_list).
docstr_tok: ["Generate","embedding","features","of","contexts","when","model","has","multiple","batches",".","Returns",":","a","(","ns",")","x","num_contexts","x","n_embs","tensor",".","ns","is","the","batch","size","i.e","num","of","posterior","samples",";","n_embs","is","the","sum","of","embedding","dimensions","i.e",".","sum","(","embs_dim_list",")","."]
code: def _task_embeddings_batch(self) -> Tensor:
      """Generate embedding features of contexts when model has multiple batches.
  
      Returns:
          a (ns) x num_contexts x n_embs tensor. ns is the batch size i.e num of
          posterior samples; n_embs is the sum of embedding dimensions i.e.
          sum(embs_dim_list).
      """
      context_features = torch.cat(
          [
              self.context_cat_feature[i, :].unsqueeze(0)
              for i in range(self.num_contexts)
          ]
      )
      embeddings = []
      for b in range(self.batch_shape.numel()):  # pyre-ignore
          for i in range(len(self.emb_weight_matrix_list)):
              # loop over emb layer and concat embs from each layer
              embeddings.append(
                  torch.cat(
                      [
                          torch.nn.functional.embedding(
                              context_features[:, 0].to(
                                  dtype=torch.long, device=self.device
                              ),
                              self.emb_weight_matrix_list[i][b, :],
                          ).unsqueeze(0)
                      ],
                      dim=1,
                  )
              )
      embeddings = torch.cat(embeddings, dim=0)
      # add given embeddings if any
      if self.context_emb_feature is not None:
          embeddings = torch.cat(
              [
                  embeddings,
                  self.context_emb_feature.expand(
                      *self.batch_shape + self.context_emb_feature.shape
                  ),
              ],
              dim=-1,
          )
      return embeddings
  
imports: from typing import Any, Dict, List, Optional
  import torch
  from gpytorch.constraints import Positive
  from gpytorch.kernels.kernel import Kernel
  from gpytorch.kernels.matern_kernel import MaternKernel
  from gpytorch.priors.torch_priors import GammaPrior
  from linear_operator.operators import DiagLinearOperator
  from linear_operator.operators.dense_linear_operator import DenseLinearOperator
  from torch import Tensor
  from torch.nn import ModuleList
label_desc: Use image node_id 10 for calling the LCEAKernel obj's underlying member method code with example usage: obj._task_embeddings_batch() and returns: embeddings