unsqueeze_like#

pytorch_forecasting.utils._utils.unsqueeze_like(tensor: Tensor, like: Tensor)[source]#

Unsqueeze last dimensions of tensor to match another tensor’s number of dimensions.

Parameters:
  • tensor (torch.Tensor) – Tensor to unsqueeze.

  • like (torch.Tensor) – Tensor whose dimensions to match.