unsqueeze_like#

pytorch_forecasting.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