class_docstr: Base network for the :class:`ForkingSeq2SeqEstimator`.
  
  Parameters
  ----------
  encoder: Seq2SeqEncoder
      encoder block.
  enc2dec: Seq2SeqEnc2Dec
      encoder to decoder mapping block.
  decoder: Seq2SeqDecoder
      decoder block.
  quantile_output
      quantile output
  distr_output
      distribution output
  context_length: int,
      length of the encoding sequence.
  cardinality: List[int],
      number of values of each categorical feature.
  embedding_dimension: List[int],
      dimension of the embeddings for categorical features.
  scaling
      Whether to automatically scale the target values. (default: True)
  scaling_decoder_dynamic_feature
      Whether to automatically scale the dynamic features for the decoder.
      (default: False)
  dtype
      (default: np.float32)
  num_forking: int,
      decides how much forking to do in the decoder. 1 reduces to seq2seq and
      enc_len reduces to MQ-C(R)NN.
  kwargs: dict
      dictionary of Gluon HybridBlock parameters
class_docstr_tok: ["Base","network","for","the",":","class",":","`","ForkingSeq2SeqEstimator","`",".","Parameters","--","--","--","--","--","encoder",":","Seq2SeqEncoder","encoder","block",".","enc2dec",":","Seq2SeqEnc2Dec","encoder","to","decoder","mapping","block",".","decoder",":","Seq2SeqDecoder","decoder","block",".","quantile_output","quantile","output","distr_output","distribution","output","context_length",":","int",",","length","of","the","encoding","sequence",".","cardinality",":","List","[","int","]",",","number","of","values","of","each","categorical","feature",".","embedding_dimension",":","List","[","int","]",",","dimension","of","the","embeddings","for","categorical","features",".","scaling","Whether","to","automatically","scale","the","target","values",".","(","default",":","True",")","scaling_decoder_dynamic_feature","Whether","to","automatically","scale","the","dynamic","features","for","the","decoder",".","(","default",":","False",")","dtype","(","default",":","np.float32",")","num_forking",":","int",",","decides","how","much","forking","to","do","in","the","decoder",".","1","reduces","to","seq2seq","and","enc_len","reduces","to","MQ-C","(","R",")","NN",".","kwargs",":","dict","dictionary","of","Gluon","HybridBlock","parameters"]
docstr: Parameters
  ----------
  F: mx.symbol or mx.ndarray
      Gluon function space
  past_target: Tensor
      shape (batch_size, encoder_length, 1)
  past_feat_dynamic
      shape (batch_size, encoder_length, num_past_feat_dynamic)
  future_feat_dynamic
      shape (batch_size, num_forking, decoder_length, num_feat_dynamic)
  feat_static_cat
      shape (batch_size, num_feat_static_cat)
  past_observed_values: Tensor
      shape (batch_size, encoder_length, 1)
  Returns
  -------
  decoder output tensor of size (batch_size, num_forking, dec_len,
  decoder_mlp_dim_seq[0])
docstr_tok: ["Parameters","--","--","--","--","--","F",":","mx.symbol","or","mx.ndarray","Gluon","function","space","past_target",":","Tensor","shape","(","batch_size",",","encoder_length",",","1",")","past_feat_dynamic","shape","(","batch_size",",","encoder_length",",","num_past_feat_dynamic",")","future_feat_dynamic","shape","(","batch_size",",","num_forking",",","decoder_length",",","num_feat_dynamic",")","feat_static_cat","shape","(","batch_size",",","num_feat_static_cat",")","past_observed_values",":","Tensor","shape","(","batch_size",",","encoder_length",",","1",")","Returns","--","--","--","-","decoder","output","tensor","of","size","(","batch_size",",","num_forking",",","dec_len",",","decoder_mlp_dim_seq","[","0","]",")"]
code: def get_decoder_network_output(
      self,
      F,
      past_target: Tensor,
      past_feat_dynamic: Tensor,
      future_feat_dynamic: Tensor,
      feat_static_cat: Tensor,
      past_observed_values: Tensor,
  ) -> Tuple[Tensor, Tensor]:
      """
      Parameters
      ----------
      F: mx.symbol or mx.ndarray
          Gluon function space
      past_target: Tensor
          shape (batch_size, encoder_length, 1)
      past_feat_dynamic
          shape (batch_size, encoder_length, num_past_feat_dynamic)
      future_feat_dynamic
          shape (batch_size, num_forking, decoder_length, num_feat_dynamic)
      feat_static_cat
          shape (batch_size, num_feat_static_cat)
      past_observed_values: Tensor
          shape (batch_size, encoder_length, 1)
      Returns
      -------
      decoder output tensor of size (batch_size, num_forking, dec_len,
      decoder_mlp_dim_seq[0])
      """
  
      # scale shape: (batch_size, 1, 1)
      scaled_past_target, scale = self.scaler(
          past_target, past_observed_values
      )
  
      # (batch_size, sum(embedding_dimension) = num_feat_static_cat)
      embedded_cat = self.embedder(feat_static_cat)
  
      # in addition to embedding features, use the log scale as it can help
      # prediction too
      # (batch_size, num_feat_static = sum(embedding_dimension) + 1)
      feat_static_real = F.concat(embedded_cat, F.log(scale), dim=1)
  
      # Passing past_observed_values as a feature would allow the network to
      # make that distinction and possibly ignore the masked values.
      past_feat_dynamic_extended = F.concat(
          past_feat_dynamic, past_observed_values, dim=-1
      )
  
      # arguments: target, static_features, dynamic_features
      # enc_output_static shape: (batch_size, channels_seq[-1] + 1)
      # enc_output_dynamic shape:
      # (batch_size, encoder_length, channels_seq[-1] + 1)
      enc_output_static, enc_output_dynamic = self.encoder(
          scaled_past_target,
          feat_static_real,
          past_feat_dynamic_extended,
      )
  
      # TODO: This assumes that future_feat_dynamic has no missing values
      # TODO: Output the scale as well to be used by the decoder
      (
          scaled_future_feat_dynamic,
          _,
      ) = self.scaler_decoder_dynamic_feature(
          future_feat_dynamic, F.ones_like(future_feat_dynamic)
      )
  
      # arguments: encoder_output_static, encoder_output_dynamic,
      #   future_features
      # dec_input_static shape: (batch_size, channels_seq[-1] + 1)
      # dec_input_dynamic shape:(batch_size, num_forking, channels_seq[-1] +
      # 1 + decoder_length * num_feat_dynamic)
      dec_input_static, dec_input_dynamic = self.enc2dec(
          enc_output_static,
          # slice axis 1 from encoder_length = context_length to num_forking
          enc_output_dynamic.slice_axis(
              axis=1, begin=-self.num_forking, end=None
          ),
          scaled_future_feat_dynamic,
      )
  
      # arguments: dynamic_input, static_input
      # TODO: optimize what we pass to the decoder for the prediction case,
      # where we we only need to pass the encoder output for the last time
      # step
      dec_output = self.decoder(dec_input_static, dec_input_dynamic)
  
      # the output shape should be: (batch_size, num_forking, dec_len,
      # decoder_mlp_dim_seq[0])
      return dec_output, scale
  
imports: from typing import List, Optional, Tuple, Type
  import numpy
  from mxnet import gluon
  from gluonts.core.component import validated
  from gluonts.mx import Tensor
  from gluonts.mx.block.decoder import Seq2SeqDecoder
  from gluonts.mx.block.enc2dec import Seq2SeqEnc2Dec
  from gluonts.mx.block.encoder import Seq2SeqEncoder
  from gluonts.mx.block.feature import FeatureEmbedder
  from gluonts.mx.block.quantile_output import QuantileOutput
  from gluonts.mx.block.scaler import MeanScaler, NOPScaler
  from gluonts.mx.distribution import DistributionOutput
  from gluonts.mx.util import weighted_average
label_desc: Use image node_id 2 for calling the ForkingSeq2SeqNetworkBase obj's underlying member method code with example usage: obj.get_decoder_network_output(F, past_target, past_feat_dynamic, future_feat_dynamic, feat_static_cat, past_observed_values) and returns: dec_output,  scale