docstr: Predicts samples given the trained DeepVAR model.
  All tensors should have NTC layout.
  Parameters
  ----------
  feat_static_cat
  
  feat_static_real
  
  past_time_feat
      Dynamic features of past time series (batch_size, history_length,
      num_features)
  past_target_cdf
      Past marginal CDF transformed target values (batch_size,
      history_length, target_dim)
  past_observed_values
      Indicator whether or not the values were observed (batch_size,
      history_length, target_dim)
  past_is_pad
      Indicator whether the past target values have been padded
      (batch_size, history_length)
  future_time_feat
      Future time features (batch_size, prediction_length, num_features)
  
  Returns
  -------
  sample_paths : Tensor
      A tensor containing sampled paths (1, num_sample_paths,
      prediction_length, target_dim).
  mean: mean of the produced distribution
  scale: scale factor
docstr_tok: ["Predicts","samples","given","the","trained","DeepVAR","model",".","All","tensors","should","have","NTC","layout",".","Parameters","--","--","--","--","--","feat_static_cat","feat_static_real","past_time_feat","Dynamic","features","of","past","time","series","(","batch_size",",","history_length",",","num_features",")","past_target_cdf","Past","marginal","CDF","transformed","target","values","(","batch_size",",","history_length",",","target_dim",")","past_observed_values","Indicator","whether","or","not","the","values","were","observed","(","batch_size",",","history_length",",","target_dim",")","past_is_pad","Indicator","whether","the","past","target","values","have","been","padded","(","batch_size",",","history_length",")","future_time_feat","Future","time","features","(","batch_size",",","prediction_length",",","num_features",")","Returns","--","--","--","-","sample_paths",":","Tensor","A","tensor","containing","sampled","paths","(","1",",","num_sample_paths",",","prediction_length",",","target_dim",")",".","mean",":","mean","of","the","produced","distribution","scale",":","scale","factor"]
code: def forward(
      self,
      feat_static_cat: torch.Tensor,
      feat_static_real: torch.Tensor,
      past_time_feat: torch.Tensor,
      past_target_cdf: torch.Tensor,
      past_observed_values: torch.Tensor,
      past_is_pad: torch.Tensor,
      future_time_feat: torch.Tensor,
  ) -> torch.Tensor:
      """
      Predicts samples given the trained DeepVAR model.
      All tensors should have NTC layout.
      Parameters
      ----------
      feat_static_cat
  
      feat_static_real
  
      past_time_feat
          Dynamic features of past time series (batch_size, history_length,
          num_features)
      past_target_cdf
          Past marginal CDF transformed target values (batch_size,
          history_length, target_dim)
      past_observed_values
          Indicator whether or not the values were observed (batch_size,
          history_length, target_dim)
      past_is_pad
          Indicator whether the past target values have been padded
          (batch_size, history_length)
      future_time_feat
          Future time features (batch_size, prediction_length, num_features)
  
      Returns
      -------
      sample_paths : Tensor
          A tensor containing sampled paths (1, num_sample_paths,
          prediction_length, target_dim).
      mean: mean of the produced distribution
      scale: scale factor
  
      """
  
      # mark padded data as unobserved
      # (batch_size, target_dim, seq_len)
      # print((past_is_pad.unsqueeze(-1)).shape)
      # if past_observed_values.ndim == 4:
      #     past_observed_values = past_observed_values.view(past_observed_values.shape[:3])
      past_observed_values = torch.min(
          past_observed_values, 1 - past_is_pad.unsqueeze(-1)
      )
  
      # unroll the decoder in "prediction mode", i.e. with past data only
      _, state, scale, _, _ = self.unroll_encoder(
          feat_static_real=feat_static_real,
          past_time_feat=past_time_feat,
          past_target_cdf=past_target_cdf,
          past_observed_values=past_observed_values,
          past_is_pad=past_is_pad,
          future_time_feat=None,
          future_target_cdf=None,
          feat_static_cat=feat_static_cat,
      )
      samples = self.sampling_decoder(
          past_target_cdf=past_target_cdf,
          feat_static_cat=feat_static_cat,
          feat_static_real=feat_static_real,
          time_feat=future_time_feat,
          scale=scale,
          begin_states=state,
      )
      return samples
  
imports: from turtle import distance
  from typing import List, Optional, Tuple, Union
  from matplotlib.pyplot import sca
  import torch
  import torch.nn
  from gluonts.core.component import validated
  from gluonts.torch.modules.distribution_output import DistributionOutput
  from pts.model import weighted_average
  from pts.modules import MeanScaler, NOPScaler, FeatureEmbedder
  from torch.distributions import AffineTransform, Beta, Distribution, Gamma, NegativeBinomial, Normal, Poisson, StudentT, TransformedDistribution
label_desc: Use image node_id 3 for calling the DeepVARPredictionNetwork obj's underlying member method code with example usage: obj.forward(feat_static_cat, feat_static_real, past_time_feat, past_target_cdf, past_observed_values, past_is_pad, future_time_feat) and returns: samples