class_docstr: The Multi-Task GP with the latent context embedding multioutput (LCE-M)
  kernel. See [Feng2020HDCPS]_ for a reference on the model and its use in Bayesian
  optimization.
docstr: generate embedding features for all contexts.
docstr_tok: ["generate","embedding","features","for","all","contexts","."]
code: def _task_embeddings(self) -> Tensor:
      """generate embedding features for all contexts."""
      embeddings = [
          emb_layer(
              self.context_cat_feature[:, i].to(
                  dtype=torch.long, device=self.device
              )  # pyre-ignore
          )
          for i, emb_layer in enumerate(self.emb_layers)
      ]
      embeddings = torch.cat(embeddings, dim=1)
  
      # add given embeddings if any
      if self.context_emb_feature is not None:
          embeddings = torch.cat(
              [embeddings, self.context_emb_feature.to(self.device)],
              dim=1,  # pyre-ignore
          )
      return embeddings
  
imports: import warnings
  from typing import List, Optional
  import torch
  from botorch.models.multitask import MultiTaskGP
  from botorch.models.transforms.input import InputTransform
  from botorch.models.transforms.outcome import OutcomeTransform
  from gpytorch.constraints import Interval
  from gpytorch.distributions.multivariate_normal import MultivariateNormal
  from gpytorch.kernels.rbf_kernel import RBFKernel
  from linear_operator.operators import InterpolatedLinearOperator, LinearOperator
  from torch import Tensor
  from torch.nn import ModuleList
label_desc: Use image node_id 3 for calling the LCEMGP obj's underlying member method code with example usage: obj._task_embeddings() and returns: embeddings