docstr: Unrolls the RNN and imputes missing values with samples from the
  current model such that later unrolling steps get model imputed values
  as lags.
  
  Parameters
  ----------
  F
  begin_state
      Begin state of the RNN.
  sequence
      Target sequence. (history_length + prediction_length)
      during training, history_length else.
  sequence_length
      Length of the target sequence. (history_length + prediction_length)
      during training, history_length else.
  subsequences_length
      Length of the subsequence (context_length + prediction_length)
      during training, context_length else.
  scale
      Tensor containing the time series scales.
  target
      Target sequence of subsequence length.
  target_observed_values
      Observed value indicators of the target tensor.
  time_feat
      Time features.
  repeated_static_feat
      Repeated static cat features.
  is_padded_indicator
      Indicator whether the sequence is padded.
  
  Returns
  -------
  RNN output tensor, state, and sequence with imputed values
docstr_tok: ["Unrolls","the","RNN","and","imputes","missing","values","with","samples","from","the","current","model","such","that","later","unrolling","steps","get","model","imputed","values","as","lags",".","Parameters","--","--","--","--","--","F","begin_state","Begin","state","of","the","RNN",".","sequence","Target","sequence",".","(","history_length","+","prediction_length",")","during","training",",","history_length","else",".","sequence_length","Length","of","the","target","sequence",".","(","history_length","+","prediction_length",")","during","training",",","history_length","else",".","subsequences_length","Length","of","the","subsequence","(","context_length","+","prediction_length",")","during","training",",","context_length","else",".","scale","Tensor","containing","the","time","series","scales",".","target","Target","sequence","of","subsequence","length",".","target_observed_values","Observed","value","indicators","of","the","target","tensor",".","time_feat","Time","features",".","repeated_static_feat","Repeated","static","cat","features",".","is_padded_indicator","Indicator","whether","the","sequence","is","padded",".","Returns","--","--","--","-","RNN","output","tensor",",","state",",","and","sequence","with","imputed","values"]
code: def imputation_rnn_unroll(
      self,
      F,
      begin_state: List[Tensor],
      sequence: Tensor,
      sequence_length: int,
      subsequences_length: int,
      scale: Tensor,
      target: Tensor,
      target_observed_values: Tensor,
      time_feat: Tensor,
      repeated_static_feat: Tensor,
      is_padded_indicator: Tensor,
  ) -> Tuple[Tensor, Tensor, Tensor]:
      """
      Unrolls the RNN and imputes missing values with samples from the
      current model such that later unrolling steps get model imputed values
      as lags.
  
      Parameters
      ----------
      F
      begin_state
          Begin state of the RNN.
      sequence
          Target sequence. (history_length + prediction_length)
          during training, history_length else.
      sequence_length
          Length of the target sequence. (history_length + prediction_length)
          during training, history_length else.
      subsequences_length
          Length of the subsequence (context_length + prediction_length)
          during training, context_length else.
      scale
          Tensor containing the time series scales.
      target
          Target sequence of subsequence length.
      target_observed_values
          Observed value indicators of the target tensor.
      time_feat
          Time features.
      repeated_static_feat
          Repeated static cat features.
      is_padded_indicator
          Indicator whether the sequence is padded.
  
      Returns
      -------
      RNN output tensor, state, and sequence with imputed values
      """
      state = begin_state
      imputed_sequence = sequence
      outputs = list()
      for i in range(0, subsequences_length):
          # unroll encoder
          input_data = self.prepare_inputs_imputation_step(
              F,
              i=i,
              imputed_sequence=imputed_sequence,
              begin_state=begin_state,
              state=state,
              sequence_length=sequence_length,
              subsequences_length=subsequences_length,
              scale=scale,
              target=target,
              target_observed_values=target_observed_values,
              time_feat=time_feat,
              repeated_static_feat=repeated_static_feat,
              is_padded_indicator=is_padded_indicator,
          )
  
          (
              inputs,
              is_pad,
              current_observed_indicator,
              current_target,
              pre_sequence,
              post_sequence,
              state,
          ) = input_data
  
          output, state = self.rnn.unroll(
              inputs=inputs.slice_axis(axis=1, begin=i, end=i + 1),
              length=1,
              layout="NTC",
              merge_outputs=True,
              begin_state=state,
          )
  
          target_value = self.impute_target_if_unobserved(
              F,
              output=output,
              scale=scale,
              current_target=current_target,
              current_observed_indicator=current_observed_indicator,
              is_pad=is_pad,
          )
  
          imputed_sequence = self.insert_imputed_target(
              F,
              i=i,
              subsequences_length=subsequences_length,
              pre_sequence=pre_sequence,
              post_sequence=post_sequence,
              target_value=target_value,
          )
  
          outputs.append(output)
      return outputs, state, imputed_sequence
  
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 3 for calling the DeepARNetwork obj's underlying member method code with example usage: obj.imputation_rnn_unroll(F, begin_state, sequence, sequence_length, subsequences_length, scale, target, target_observed_values, time_feat, repeated_static_feat, is_padded_indicator) and returns: outputs,  state,  imputed_sequence