class_docstr: Applies Zoneout on base cell. The implementation follows [KMK16]_.
  
  Compared to mx.gluon.rnn.ZoneoutCell, this implementation uses the same
  mask for output and states[0], since for RNN cells, states[0] is the same
  as output, except for ResidualCell, where states[0] = input + ouptut
  
  Parameters
  ----------
  base_cell
      The cell on which to perform variational dropout.
  zoneout_outputs
      The dropout rate for outputs. Won't apply dropout if it equals 0.
  zoneout_states
      The dropout rate for state inputs on the first state channel.
      Won't apply dropout if it equals 0.
class_docstr_tok: ["Applies","Zoneout","on","base","cell",".","The","implementation","follows","[","KMK16","]","_",".","Compared","to","mx.gluon.rnn.ZoneoutCell",",","this","implementation","uses","the","same","mask","for","output","and","states","[","0","]",",","since","for","RNN","cells",",","states","[","0","]","is","the","same","as","output",",","except","for","ResidualCell",",","where","states","[","0","]","=","input","+","ouptut","Parameters","--","--","--","--","--","base_cell","The","cell","on","which","to","perform","variational","dropout",".","zoneout_outputs","The","dropout","rate","for","outputs",".","Wo","n't","apply","dropout","if","it","equals","0.","zoneout_states","The","dropout","rate","for","state","inputs","on","the","first","state","channel",".","Wo","n't","apply","dropout","if","it","equals","0","."]
code: def hybrid_forward(
      self, F, inputs: Tensor, states: Tensor
  ) -> Tuple[Tensor, Tensor]:
      def mask(p, like):
          return F.Dropout(F.ones_like(like), p=p)
  
      cell, p_outputs, p_states = (
          self.base_cell,
          self.zoneout_outputs,
          self.zoneout_states,
      )
      next_output, next_states = cell(inputs, states)
  
      prev_output = self._prev_output
      if prev_output is None:
          prev_output = F.zeros_like(next_output)
  
      output_mask = mask(p_outputs, next_output)
      output = (
          F.where(output_mask, next_output, prev_output)
          if p_outputs != 0.0
          else next_output
      )
  
      # only for RNN, the first element of states is output. Use the same
      # mask as output, instead of simply copy output to the first element
      # in case that the base cell is ResidualCell
      new_states = [
          F.where(output_mask, next_states[0], states[0])
          if p_outputs != 0.0
          else next_states[0]
      ]
      new_states.extend(
          [
              F.where(mask(p_states, new_s), new_s, old_s)
              for new_s, old_s in zip(next_states[1:], states[1:])
          ]
          if p_states != 0.0
          else next_states[1:]
      )
  
      self._prev_output = output
  
      return output, new_states
  
imports: from typing import Tuple
  from mxnet.gluon.rnn import BidirectionalCell, ModifierCell, RecurrentCell, SequentialRNNCell
  from gluonts.core.component import validated
  from gluonts.mx import Tensor
label_desc: Use image node_id 5 for calling the RNNZoneoutCell obj's underlying member method code with example usage: obj.hybrid_forward(F, inputs, states) and returns: output,  new_states, F