class_docstr: Defines RNN encoder that uses covariates and target as input to the RNN if
  desired.
  
  Parameters
  ----------
  mode
      type of the RNN. Can be either: rnn_relu (RNN with relu activation),
      rnn_tanh, (RNN with tanh activation), lstm or gru.
  hidden_size
      number of units per hidden layer.
  num_layers
      number of hidden layers.
  bidirectional
      toggle use of bi-directional RNN as encoder.
  use_static_feat
      flag to toggle whether to use use_static_feat as input to the encoder
  use_dynamic_feat
      flag to toggle whether to use use_dynamic_feat as input to the encoder
class_docstr_tok: ["Defines","RNN","encoder","that","uses","covariates","and","target","as","input","to","the","RNN","if","desired",".","Parameters","--","--","--","--","--","mode","type","of","the","RNN",".","Can","be","either",":","rnn_relu","(","RNN","with","relu","activation",")",",","rnn_tanh",",","(","RNN","with","tanh","activation",")",",","lstm","or","gru",".","hidden_size","number","of","units","per","hidden","layer",".","num_layers","number","of","hidden","layers",".","bidirectional","toggle","use","of","bi-directional","RNN","as","encoder",".","use_static_feat","flag","to","toggle","whether","to","use","use_static_feat","as","input","to","the","encoder","use_dynamic_feat","flag","to","toggle","whether","to","use","use_dynamic_feat","as","input","to","the","encoder"]
code: def __init__(
      self,
      mode: str,
      hidden_size: int,
      num_layers: int,
      bidirectional: bool,
      use_static_feat: bool = False,
      use_dynamic_feat: bool = False,
      **kwargs,
  ) -> None:
      assert (
          num_layers > 0
      ), "`num_layers` value must be greater than zero"
      assert (
          hidden_size > 0
      ), "`hidden_size` value must be greater than zero"
  
      super().__init__(**kwargs)
  
      self.mode = mode
      self.hidden_size = hidden_size
      self.num_layers = num_layers
      self.bidirectional = bidirectional
      self.use_static_feat = use_static_feat
      self.use_dynamic_feat = use_dynamic_feat
  
      with self.name_scope():
          self.rnn = RNN(mode, hidden_size, num_layers, bidirectional)
  
imports: from typing import List, Tuple
  from mxnet.gluon import nn
  from gluonts.core.component import validated
  from gluonts.mx import Tensor
  from gluonts.mx.block.cnn import CausalConv1D
  from gluonts.mx.block.mlp import MLP
  from gluonts.mx.block.rnn import RNN
label_desc: Use image node_id 1 to create a new RNNEncoder object from inherited base classes: Seq2SeqEncoder with example: obj = RNNEncoder(mode, hidden_size, num_layers, bidirectional, use_static_feat, use_dynamic_feat)