tsicl.utils.task_utils.prepare_context_tensors#

tsicl.utils.task_utils.prepare_context_tensors(grid: torch.Tensor, series_c: torch.Tensor, covariates: torch.Tensor | None = None) Dict[str, torch.Tensor]#

Prepare context tensors for forward pass.

Parameters:
  • grid (torch.Tensor) – Raw time grid of shape (bs, T, 1).

  • series_c (torch.Tensor) – Tensor of past values of shape (bs, T, 1).

  • covariates (torch.Tensor, optional) – Tensor of covariates of shape (bs, c, T, 1).

Returns:

out – Dict with keys coords_c (context coordinates), series_c (context values), covar_c (context covariates, if any).

Return type:

Dict[str, torch.Tensor]