class_docstr: Baseline model that uses last known target value to make prediction.
  
  Example:
  
  .. code-block:: python
  
      from pytorch_forecasting import BaseModel, MAE
  
      # generating predictions
      predictions = Baseline().predict(dataloader)
  
      # calculate baseline performance in terms of mean absolute error (MAE)
      metric = MAE()
      model = Baseline()
      for x, y in dataloader:
          metric.update(model(x), y)
  
      metric.compute()
code: def forward_one_target(
      self,
      encoder_lengths: torch.Tensor,
      decoder_lengths: torch.Tensor,
      encoder_target: torch.Tensor,
  ):
      max_prediction_length = decoder_lengths.max()
      assert (
          encoder_lengths.min() > 0
      ), "Encoder lengths of at least 1 required to obtain last value"
      last_values = encoder_target[
          torch.arange(encoder_target.size(0)), encoder_lengths - 1
      ]
      prediction = last_values[:, None].expand(
          -1, max_prediction_length
      )
      return prediction
  
file_path: pytorch-forecasting/pytorch_forecasting/models/baseline.py
imports: from typing import Any, Dict
  import torch
  from pytorch_forecasting.models import BaseModel
label_desc: Use image node_id 2 for calling the Baseline obj's underlying member method code with example usage: obj.forward_one_target(encoder_lengths, decoder_lengths, encoder_target) and returns: prediction