class_docstr: Runs Wavenet generation in an auto-regressive manner using caching for
  speedup [PKC+16]_.
  
  Same arguments as WaveNet. In addition
  
  Parameters
  ----------
  pred_length
      Length of the prediction horizon
  num_samples
      Number of sample paths to generate in parallel in the graph
  temperature
      If set to 1.0 (default), sample according to estimated probabilities,
      if set to 0.0 most likely sample at each step is chosen.
  post_transform
      An optional post transform that will be applied to the samples
class_docstr_tok: ["Runs","Wavenet","generation","in","an","auto-regressive","manner","using","caching","for","speedup","[","PKC+16","]","_",".","Same","arguments","as","WaveNet",".","In","addition","Parameters","--","--","--","--","--","pred_length","Length","of","the","prediction","horizon","num_samples","Number","of","sample","paths","to","generate","in","parallel","in","the","graph","temperature","If","set","to","1.0","(","default",")",",","sample","according","to","estimated","probabilities",",","if","set","to","0.0","most","likely","sample","at","each","step","is","chosen",".","post_transform","An","optional","post","transform","that","will","be","applied","to","the","samples"]
docstr: Computes the training loss for the wavenet model.
  
  Parameters
  ----------
  F
  feat_static_cat
      Static categorical features: (batch_size, num_cat_features)
  past_target
      Past target: (batch_size, receptive_field)
  past_observed_values
      Observed value indicator for the past target: (batch_size,
      receptive_field)
  past_time_feat
      Past time features: (batch_size, num_time_features,
      receptive_field)
  future_time_feat
      Future time features: (batch_size, num_time_features, pred_length)
  scale
      scale of the time series: (batch_size, 1)
  
  Returns
  -------
  Tensor
      Prediction samples with shape (batch_size, num_samples,
      pred_length)
docstr_tok: ["Computes","the","training","loss","for","the","wavenet","model",".","Parameters","--","--","--","--","--","F","feat_static_cat","Static","categorical","features",":","(","batch_size",",","num_cat_features",")","past_target","Past","target",":","(","batch_size",",","receptive_field",")","past_observed_values","Observed","value","indicator","for","the","past","target",":","(","batch_size",",","receptive_field",")","past_time_feat","Past","time","features",":","(","batch_size",",","num_time_features",",","receptive_field",")","future_time_feat","Future","time","features",":","(","batch_size",",","num_time_features",",","pred_length",")","scale","scale","of","the","time","series",":","(","batch_size",",","1",")","Returns","--","--","--","-","Tensor","Prediction","samples","with","shape","(","batch_size",",","num_samples",",","pred_length",")"]
code: def hybrid_forward(
      self,
      F,
      feat_static_cat: Tensor,
      past_target: Tensor,
      past_observed_values: Tensor,
      past_time_feat: Tensor,
      future_time_feat: Tensor,
      scale: Tensor,
  ) -> Tensor:
      """
      Computes the training loss for the wavenet model.
  
      Parameters
      ----------
      F
      feat_static_cat
          Static categorical features: (batch_size, num_cat_features)
      past_target
          Past target: (batch_size, receptive_field)
      past_observed_values
          Observed value indicator for the past target: (batch_size,
          receptive_field)
      past_time_feat
          Past time features: (batch_size, num_time_features,
          receptive_field)
      future_time_feat
          Future time features: (batch_size, num_time_features, pred_length)
      scale
          scale of the time series: (batch_size, 1)
  
      Returns
      -------
      Tensor
          Prediction samples with shape (batch_size, num_samples,
          pred_length)
      """
  
      def blow_up(u):
          """
          Expand to (batch_size x num_samples)
          """
          return F.repeat(u, repeats=self.num_samples, axis=0)
  
      past_target = past_target.astype("int32")
      full_features = self.get_full_features(
          F,
          feat_static_cat=feat_static_cat,
          past_observed_values=past_observed_values,
          past_time_feat=past_time_feat,
          future_time_feat=future_time_feat,
          future_observed_values=None,
          scale=scale,
      )
  
      # To compute queues for the first step, we need features from
      # -self.pred_length - self.receptive_field + 1 to -self.pred_length + 1
      features_end_ix = (
          -self.pred_length + 1 if self.pred_length > 1 else None
      )
      queues = self.get_initial_conv_queues(
          F,
          past_target=F.slice_axis(
              past_target,
              begin=-self.receptive_field,
              end=None,
              axis=-1,
          ),
          features=F.slice_axis(
              full_features,
              begin=-self.pred_length - self.receptive_field + 1,
              end=features_end_ix,
              axis=-1,
          ),
      )
      queues = [blow_up(queue) for queue in queues]
  
      res = F.slice_axis(past_target, begin=-2, end=None, axis=-1)
      res = blow_up(res)
      for n in range(self.pred_length):
          # Generate one-step ahead predictions. The input consists of target
          # and features corresponding to the last two time steps.
          current_target = F.slice_axis(
              res, begin=-2, end=None, axis=-1
          )
          current_features = F.slice_axis(
              full_features,
              begin=self.receptive_field + n - 1,
              end=self.receptive_field + n + 1,
              axis=-1,
          )
          embedding = self.target_feature_embedding(
              F,
              target=current_target,
              features=blow_up(current_features),
          )
  
          # (batch_size, 1, num_bins) where 1 corresponds to the time axis.
          unnormalized_outputs, queues = self.base_net(
              F, embedding, one_step_prediction=True, queues=queues
          )
          if self.temperature > 0:
              # (batch_size, 1, num_bins) where 1 corresponds to the time
              # axis.
              probs = F.softmax(
                  unnormalized_outputs / self.temperature, axis=-1
              )
              # (batch_size, 1)
              y = F.sample_multinomial(probs)
          else:
              # (batch_size, 1)
              y = F.argmax(unnormalized_outputs, axis=-1)
          y = y.astype("int32")
          res = F.concat(res, y, num_args=2, dim=-1)
      samples = F.slice_axis(
          res, begin=-self.pred_length, end=None, axis=-1
      )
      samples = samples.reshape(
          shape=(-1, self.num_samples, self.pred_length)
      )
      samples = self.post_transform(samples)
      samples = F.broadcast_mul(scale.expand_dims(axis=1), samples)
      return samples
  
imports: import math
  from typing import List, Optional
  import mxnet
  from mxnet import gluon
  from mxnet.gluon import nn
  from gluonts.core.component import validated
  from gluonts.mx import Tensor
  from gluonts.mx.block.feature import FeatureEmbedder
label_desc: Use image node_id 3 for calling the WaveNetSampler obj's underlying member method code with example usage: obj.hybrid_forward(F, feat_static_cat, past_target, past_observed_values, past_time_feat, future_time_feat, scale) and returns: samples, F