class_docstr: Distribution class for the model MQF2 proposed in the paper
  ``Multivariate Quantile Function Forecaster``
  by Kan, Aubet, Januschowski, Park, Benidis, Ruthotto, Gasthaus
  Parameters
  ----------
  picnn
      A SequentialNet instance of a
      partially input convex neural network (picnn)
  hidden_state
      hidden_state obtained by unrolling the RNN encoder
      shape = (batch_size, context_length, hidden_size) in training
      shape = (batch_size, hidden_size) in inference
  prediction_length
      Length of the prediction horizon
  is_energy_score
      If True, use energy score as objective function
      otherwise use maximum likelihood as
      objective function (normalizing flows)
  es_num_samples
      Number of samples drawn to approximate the energy score
  beta
      Hyperparameter of the energy score (power of the two terms)
  threshold_input
      Clamping threshold of the (scaled) input when maximum
      likelihood is used as objective function
      this is used to make the forecaster more robust
      to outliers in training samples
  validate_args
      Sets whether validation is enabled or disabled
      For more details, refer to the descriptions in
      torch.distributions.distribution.Distribution
docstr: Auxiliary function for loss computation
  Unfolds the observations by sliding a window of size prediction_length
  over the observations z
  Then, reshapes the observations into a 2-dimensional tensor for
  further computation
  Parameters
  ----------
  z
      A batch of time series with shape
      (batch_size, context_length + prediction_length - 1)
  Returns
  -------
  Tensor
      Unfolded time series with shape
      (batch_size * context_length, prediction_length)
docstr_tok: ["Auxiliary","function","for","loss","computation","Unfolds","the","observations","by","sliding","a","window","of","size","prediction_length","over","the","observations","z","Then",",","reshapes","the","observations","into","a","2-dimensional","tensor","for","further","computation","Parameters","--","--","--","--","--","z","A","batch","of","time","series","with","shape","(","batch_size",",","context_length","+","prediction_length","-","1",")","Returns","--","--","--","-","Tensor","Unfolded","time","series","with","shape","(","batch_size","*","context_length",",","prediction_length",")"]
code: def stack_sliding_view(self, z: torch.Tensor) -> torch.Tensor:
      """
      Auxiliary function for loss computation
      Unfolds the observations by sliding a window of size prediction_length
      over the observations z
      Then, reshapes the observations into a 2-dimensional tensor for
      further computation
      Parameters
      ----------
      z
          A batch of time series with shape
          (batch_size, context_length + prediction_length - 1)
      Returns
      -------
      Tensor
          Unfolded time series with shape
          (batch_size * context_length, prediction_length)
      """
  
      z = z.unfold(dimension=-1, size=self.prediction_length, step=1)
      z = z.reshape(-1, z.shape[-1])
  
      return z
  
imports: from typing import List, Optional, Tuple
  from cpflows.flows import DeepConvexFlow, SequentialFlow
  import torch
  from torch.distributions import AffineTransform, Distribution, Normal, TransformedDistribution
  import torch.nn.functional
label_desc: Use image node_id 2 for calling the MQF2Distribution obj's underlying member method code with example usage: obj.stack_sliding_view(z) and returns: z