class_docstr: Abstract base class for forecasting models.
  
  Derived classes must implement the :meth:`model` method.
class_docstr_tok: ["Abstract","base","class","for","forecasting","models",".","Derived","classes","must","implement","the",":","meth",":","`","model","`","method","."]
code: def forward(self, data, covariates):
      assert data.dim() >= 2
      assert covariates.dim() >= 2
      t_obs = data.size(-2)
      t_cov = covariates.size(-2)
      assert t_obs <= t_cov
  
      try:
          self._data = data
          self._time_plate = pyro.plate("time", t_cov, dim=-1)
          if t_obs == t_cov:  # training
              zero_data = data.new_zeros(()).expand(data.shape)
          else:  # forecasting
              zero_data = data.new_zeros(()).expand(
                  data.shape[:-2]
                  + covariates.shape[-2:-1]
                  + data.shape[-1:]
              )
          self._forecast = None
  
          self.model(zero_data, covariates)
  
          assert (
              self._forecast is not None
          ), ".predict() was not called by .model()"
          return self._forecast
      finally:
          self._data = None
          self._time_plate = None
          self._forecast = None
  
imports: import logging
  from abc import ABCMeta, abstractmethod
  from contextlib import ExitStack
  import torch
  import torch.nn
  import pyro
  import pyro.distributions
  import pyro.poutine
  from pyro.infer import MCMC, NUTS, SVI, Trace_ELBO
  from pyro.infer.autoguide import AutoNormal, init_to_sample
  from pyro.infer.predictive import _guess_max_plate_nesting
  from pyro.nn.module import PyroModule
  from pyro.optim import DCTAdam
  from .util import MarkDCTParamMessenger, PrefixConditionMessenger, PrefixReplayMessenger, PrefixWarmStartMessenger, reshape_batch, time_reparam_dct, time_reparam_haar
label_desc: Use image node_id 5 for calling the ForecastingModel obj's underlying member method code with example usage: obj.forward(data, covariates) and returns: self