docstr: Returns the distribution predicted by the model on the range of
  past_target and future_target.
  
  The distribution is obtained by unrolling the network with the true
  target, this is also the distribution that is being minimized during
  training. This can be used in anomaly detection, see for instance
  examples/anomaly_detection.py.
  
  Input arguments are the same as for the hybrid_forward method.
  
  Returns
  -------
  Distribution
      a distribution object whose mean has shape:
      (batch_size, context_length + prediction_length).
  Tensor
      (optional) when return_rnn_outputs=True, rnn_outputs will be
      returned so that it could be used for regularization
docstr_tok: ["Returns","the","distribution","predicted","by","the","model","on","the","range","of","past_target","and","future_target",".","The","distribution","is","obtained","by","unrolling","the","network","with","the","true","target",",","this","is","also","the","distribution","that","is","being","minimized","during","training",".","This","can","be","used","in","anomaly","detection",",","see","for","instance","examples\/anomaly_detection.py",".","Input","arguments","are","the","same","as","for","the","hybrid_forward","method",".","Returns","--","--","--","-","Distribution","a","distribution","object","whose","mean","has","shape",":","(","batch_size",",","context_length","+","prediction_length",")",".","Tensor","(","optional",")","when","return_rnn_outputs=True",",","rnn_outputs","will","be","returned","so","that","it","could","be","used","for","regularization"]
code: def distribution(
      self,
      feat_static_cat: Tensor,
      feat_static_real: Tensor,
      past_time_feat: Tensor,
      past_target: Tensor,
      past_observed_values: Tensor,
      past_is_pad: Tensor,
      future_time_feat: Tensor,
      future_target: Tensor,
      future_observed_values: Tensor,
      return_rnn_outputs: bool = False,
  ) -> Union[Distribution, Tuple[Distribution, Tensor]]:
      """
      Returns the distribution predicted by the model on the range of
      past_target and future_target.
  
      The distribution is obtained by unrolling the network with the true
      target, this is also the distribution that is being minimized during
      training. This can be used in anomaly detection, see for instance
      examples/anomaly_detection.py.
  
      Input arguments are the same as for the hybrid_forward method.
  
      Returns
      -------
      Distribution
          a distribution object whose mean has shape:
          (batch_size, context_length + prediction_length).
      Tensor
          (optional) when return_rnn_outputs=True, rnn_outputs will be
          returned so that it could be used for regularization
      """
      # unroll the decoder in "training mode"
      # i.e. by providing future data as well
      F = getF(feat_static_cat)
      rnn_outputs, _, scale, _, _ = self.unroll_encoder(
          F=F,
          feat_static_cat=feat_static_cat,
          feat_static_real=feat_static_real,
          past_time_feat=past_time_feat,
          past_target=past_target,
          past_observed_values=past_observed_values,
          past_is_pad=past_is_pad,
          future_observed_values=future_observed_values,
          future_time_feat=future_time_feat,
          future_target=future_target,
      )
  
      distr_args = self.proj_distr_args(rnn_outputs)
  
      # return the output of rnn layers if return_rnn_outputs=True, so that
      # it can be used for regularization later assume no dropout for
      # outputs, so can be directly used for activation regularization
      return (
          (
              self.distr_output.distribution(distr_args, scale=scale),
              rnn_outputs,
          )
          if return_rnn_outputs
          else self.distr_output.distribution(distr_args, scale=scale)
      )
  
imports: from typing import List, Optional, Tuple, Union, Type
  import mxnet
  import numpy
  from mxnet.gluon.contrib.rnn import VariationalDropoutCell
  from mxnet.gluon.rnn import ZoneoutCell
  from gluonts.core.component import validated
  from gluonts.itertools import prod
  from gluonts.mx import Tensor
  from gluonts.mx.block.dropout import RNNZoneoutCell, VariationalZoneoutCell
  from gluonts.mx.block.feature import FeatureEmbedder
  from gluonts.mx.block.regularization import ActivationRegularizationLoss, TemporalActivationRegularizationLoss
  from gluonts.mx.block.scaler import MeanScaler, NOPScaler
  from gluonts.mx.distribution import Distribution, DistributionOutput
  from gluonts.mx.distribution.distribution import getF
  from gluonts.mx.util import weighted_average, mx_switch
  from mxnet import autograd
label_desc: Use image node_id 2 for calling the DeepARTrainingNetwork obj's underlying member method code with example usage: obj.distribution(feat_static_cat, feat_static_real, past_time_feat, past_target, past_observed_values, past_is_pad, future_time_feat, future_target, future_observed_values, return_rnn_outputs) and returns: unknown