docstr: This will impute the target at unrolling step i if the value is not
  observed. If the target value is a padded dummy value, it will be set
  to zero. We will keep the target value otherwise.
  
  Parameters
  ----------
  F
  output
      RNN outputs to construct the distribution at unrolling step i.
  scale
      Scale of the time series.
  current_target
      Tensor containing the current target.
  current_observed_indicator
      Tensor containing the current observed value indicator
  is_pad
      Tensor containing the current padding indicator.
  
  Returns
  -------
  Target (imputed/zero if unobserved).
docstr_tok: ["This","will","impute","the","target","at","unrolling","step","i","if","the","value","is","not","observed",".","If","the","target","value","is","a","padded","dummy","value",",","it","will","be","set","to","zero",".","We","will","keep","the","target","value","otherwise",".","Parameters","--","--","--","--","--","F","output","RNN","outputs","to","construct","the","distribution","at","unrolling","step","i.","scale","Scale","of","the","time","series",".","current_target","Tensor","containing","the","current","target",".","current_observed_indicator","Tensor","containing","the","current","observed","value","indicator","is_pad","Tensor","containing","the","current","padding","indicator",".","Returns","--","--","--","-","Target","(","imputed\/zero","if","unobserved",")","."]
code: def impute_target_if_unobserved(
      self,
      F,
      output,
      scale,
      current_target,
      current_observed_indicator,
      is_pad,
  ) -> Tensor:
      """
      This will impute the target at unrolling step i if the value is not
      observed. If the target value is a padded dummy value, it will be set
      to zero. We will keep the target value otherwise.
  
      Parameters
      ----------
      F
      output
          RNN outputs to construct the distribution at unrolling step i.
      scale
          Scale of the time series.
      current_target
          Tensor containing the current target.
      current_observed_indicator
          Tensor containing the current observed value indicator
      is_pad
          Tensor containing the current padding indicator.
  
      Returns
      -------
      Target (imputed/zero if unobserved).
      """
      distr_args = self.proj_distr_args(output)
      distr = self.distr_output.distribution(distr_args, scale=scale)
  
      with autograd.pause():
          sample = distr.sample(
              num_samples=self.num_imputation_samples, dtype=self.dtype
          ).mean(axis=0)
  
      target_value = mx_switch(
          F,
          (current_observed_indicator, current_target),
          (is_pad, F.zeros_like(sample)),
          sample,
      )
      return target_value
  
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 5 for calling the DeepARNetwork obj's underlying member method code with example usage: obj.impute_target_if_unobserved(F, output, scale, current_target, current_observed_indicator, is_pad) and returns: target_value