docstr: Given the tensor `past_target`, first we normalize it by the
  `past_observed_values` which is an indicator tensor with 0 or 1 values.
  Then it outputs the result of LSTNet.
  
  Parameters
  ----------
  F
  past_target
      Tensor of shape (batch_size, num_series, context_length)
  past_observed_values
      Tensor of shape (batch_size, num_series, context_length)
  
  Returns
  -------
  Tensor
      Shape (batch_size, num_series, 1) if `horizon` was specified
      and of shape (batch_size, num_series, prediction_length)
      if `prediction_length` was provided
docstr_tok: ["Given","the","tensor","`","past_target","`",",","first","we","normalize","it","by","the","`","past_observed_values","`","which","is","an","indicator","tensor","with","0","or","1","values",".","Then","it","outputs","the","result","of","LSTNet",".","Parameters","--","--","--","--","--","F","past_target","Tensor","of","shape","(","batch_size",",","num_series",",","context_length",")","past_observed_values","Tensor","of","shape","(","batch_size",",","num_series",",","context_length",")","Returns","--","--","--","-","Tensor","Shape","(","batch_size",",","num_series",",","1",")","if","`","horizon","`","was","specified","and","of","shape","(","batch_size",",","num_series",",","prediction_length",")","if","`","prediction_length","`","was","provided"]
code: def hybrid_forward(
      self, F, past_target: Tensor, past_observed_values: Tensor
  ) -> Tensor:
      """
      Given the tensor `past_target`, first we normalize it by the
      `past_observed_values` which is an indicator tensor with 0 or 1 values.
      Then it outputs the result of LSTNet.
  
      Parameters
      ----------
      F
      past_target
          Tensor of shape (batch_size, num_series, context_length)
      past_observed_values
          Tensor of shape (batch_size, num_series, context_length)
  
      Returns
      -------
      Tensor
          Shape (batch_size, num_series, 1) if `horizon` was specified
          and of shape (batch_size, num_series, prediction_length)
          if `prediction_length` was provided
      """
      context_target = past_target.slice_axis(
          axis=2, begin=-self.context_length, end=None
      )
      context_observed = past_observed_values.slice_axis(
          axis=2, begin=-self.context_length, end=None
      )
  
      scaled_context, scale = self.scaler(
          context_target, context_observed
      )
      cnn_inputs = F.concat(
          scaled_context.expand_dims(axis=1),
          context_observed.expand_dims(axis=1),
          dim=1,
      )
      c = self.cnn(cnn_inputs)
      c = self.dropout(c)
      c = F.squeeze(c, axis=2)  # NCT
  
      r = F.transpose(c, axes=(2, 0, 1))  # TNC
      if F is mx.ndarray:
          ctx = (
              r.context
              if isinstance(r, mx.gluon.tensor_types)
              else r[0].context
          )
          with ctx:
              rnn_begin_state = self.rnn.begin_state(
                  func=F.zeros, dtype=self.dtype, batch_size=r.shape[1]
              )
      else:
          rnn_begin_state = self.rnn.begin_state(
              func=F.zeros, dtype=self.dtype, batch_size=0
          )
  
      r, _ = self.rnn.unroll(
          inputs=r,
          length=min(self.conv_out, self.context_length),
          layout="TNC",
          merge_outputs=True,
          begin_state=rnn_begin_state,
      )
      r = F.squeeze(
          F.slice_axis(r, axis=0, begin=-1, end=None), axis=0
      )  # NC
      s = self._skip_rnn_layer(F, c)
      # make fc broadcastable for output
      fc = self.fc(F.concat(r, s, dim=1)).expand_dims(
          axis=2
      )  # N x num_series x 1
      if self.prediction_length:
          fc = F.tile(
              fc, reps=(1, 1, self.prediction_length)
          )  # N x num_series x prediction_length
      ar = self._ar_highway(F, scaled_context, context_observed)
      out = fc + ar
      if self.output_activation is None:
          return out, scale
      return (
          (
              F.sigmoid(out)
              if self.output_activation == "sigmoid"
              else F.tanh(out)
          ),
          scale,
      )
  
imports: from typing import Optional, Type
  import mxnet
  from mxnet.gluon import loss, nn
  from gluonts.core.component import validated
  from gluonts.mx import Tensor
  from gluonts.mx.block.scaler import MeanScaler, NOPScaler
label_desc: Use image node_id 5 for calling the LSTNetBase obj's underlying member method code with example usage: obj.hybrid_forward(F, past_target, past_observed_values) and returns: unknown,  scale, out,  scale