docstr: performs the prediction step
  
  batch
      output of Darts' :class:`InferenceDataset` - tuple of ``(past_target, past_covariates,
      historic_future_covariates, future_covariates, future_past_covariates, input_timeseries)``
  batch_idx
      the batch index of the current batch
  dataloader_idx
      the dataloader index
docstr_tok: ["performs","the","prediction","step","batch","output","of","Darts","'",":","class",":","`","InferenceDataset","`","-","tuple","of","``","(","past_target",",","past_covariates",",","historic_future_covariates",",","future_covariates",",","future_past_covariates",",","input_timeseries",")","``","batch_idx","the","batch","index","of","the","current","batch","dataloader_idx","the","dataloader","index"]
code: def predict_step(
      self,
      batch: Tuple,
      batch_idx: int,
      dataloader_idx: Optional[int] = None,
  ) -> Sequence[TimeSeries]:
      """performs the prediction step
  
      batch
          output of Darts' :class:`InferenceDataset` - tuple of ``(past_target, past_covariates,
          historic_future_covariates, future_covariates, future_past_covariates, input_timeseries)``
      batch_idx
          the batch index of the current batch
      dataloader_idx
          the dataloader index
      """
      input_data_tuple, batch_input_series, batch_pred_starts = (
          batch[:-2],
          batch[-2],
          batch[-1],
      )
  
      # number of individual series to be predicted in current batch
      num_series = input_data_tuple[0].shape[0]
  
      # number of times the input tensor should be tiled to produce predictions for multiple samples
      # this variable is larger than 1 only if the batch_size is at least twice as large as the number
      # of individual time series being predicted in current batch (`num_series`)
      batch_sample_size = min(
          max(self.pred_batch_size // num_series, 1),
          self.pred_num_samples,
      )
  
      # counts number of produced prediction samples for every series to be predicted in current batch
      sample_count = 0
  
      # repeat prediction procedure for every needed sample
      batch_predictions = []
      while sample_count < self.pred_num_samples:
          # make sure we don't produce too many samples
          if sample_count + batch_sample_size > self.pred_num_samples:
              batch_sample_size = self.pred_num_samples - sample_count
  
          # stack multiple copies of the tensors to produce probabilistic forecasts
          input_data_tuple_samples = self._sample_tiling(
              input_data_tuple, batch_sample_size
          )
  
          # get predictions for 1 whole batch (can include predictions of multiple series
          # and for multiple samples if a probabilistic forecast is produced)
          batch_prediction = self._get_batch_prediction(
              self.pred_n, input_data_tuple_samples, self.pred_roll_size
          )
  
          # reshape from 3d tensor (num_series x batch_sample_size, ...)
          # into 4d tensor (batch_sample_size, num_series, ...), where dim 0 represents the samples
          out_shape = batch_prediction.shape
          batch_prediction = batch_prediction.reshape(
              (
                  batch_sample_size,
                  num_series,
              )
              + out_shape[1:]
          )
  
          # save all predictions and update the `sample_count` variable
          batch_predictions.append(batch_prediction)
          sample_count += batch_sample_size
  
      # concatenate the batch of samples, to form self.pred_num_samples samples
      batch_predictions = torch.cat(batch_predictions, dim=0)
      batch_predictions = batch_predictions.cpu().detach().numpy()
  
      ts_forecasts = Parallel(n_jobs=self.pred_n_jobs)(
          delayed(_build_forecast_series)(
              [
                  batch_prediction[batch_idx]
                  for batch_prediction in batch_predictions
              ],
              input_series,
              custom_columns=self.likelihood.likelihood_components_names(
                  input_series
              )
              if self.predict_likelihood_parameters
              else None,
              with_static_covs=False
              if self.predict_likelihood_parameters
              else True,
              with_hierarchy=False
              if self.predict_likelihood_parameters
              else True,
              pred_start=pred_start,
          )
          for batch_idx, (input_series, pred_start) in enumerate(
              zip(batch_input_series, batch_pred_starts)
          )
      )
      return ts_forecasts
  
imports: from abc import ABC, abstractmethod
  from functools import wraps
  from typing import Any, Dict, Optional, Sequence, Tuple, Union
  import pytorch_lightning
  import torch
  import torch.nn
  import torchmetrics
  from joblib import Parallel, delayed
  from darts.logging import get_logger, raise_if, raise_log
  from darts.models.components.layer_norm_variants import RINorm
  from darts.timeseries import TimeSeries
  from darts.utils.likelihood_models import Likelihood
  from darts.utils.timeseries_generation import _build_forecast_series
  from darts.utils.torch import MonteCarloDropout
label_desc: Use image node_id 6 for calling the PLForecastingModule obj's underlying member method code with example usage: obj.predict_step(batch, batch_idx, dataloader_idx) and returns: ts_forecasts