code: def _make_X_full(
      X: Tensor, output_indices: List[int], tf: int
  ) -> Tensor:
      r"""Helper to construct input tensor with task indices.
  
      Args:
          X: The raw input tensor (without task information).
          output_indices: The output indices to generate (passed in via `posterior`).
          tf: The task feature index.
  
      Returns:
          Tensor: The full input tensor for the multi-task model, including task
              indices.
      """
      index_shape = X.shape[:-1] + torch.Size([1])
      indexers = (
          torch.full(
              index_shape, fill_value=i, device=X.device, dtype=X.dtype
          )
          for i in output_indices
      )
      X_l, X_r = X[..., :tf], X[..., tf:]
      return torch.cat(
          [
              torch.cat([X_l, indexer, X_r], dim=-1)
              for indexer in indexers
          ],
          dim=-2,
      )
  
imports: from __future__ import annotations
  import warnings
  from contextlib import contextmanager, ExitStack
  from typing import Iterator, List, Optional, Tuple
  import torch
  from botorch import settings
  from botorch.exceptions import InputDataError, InputDataWarning
  from botorch.settings import _Flag
  from gpytorch import settings
  from gpytorch.module import Module
  from torch import Tensor
label_desc: Use image node_id 1 for calling a global function with example usage: _make_X_full(X, output_indices, tf) and returns: torch