class_docstr: Standard fully batched RNN decoder with attention.
  
  Faster implementation, uses CuDNN for implementation.
  See :class:`~onmt.decoders.decoder.RNNDecoderBase` for options.
  
  
  Based around the approach from
  "Neural Machine Translation By Jointly Learning To Align and Translate"
  :cite:`Bahdanau2015`
  
  
  Implemented without input_feeding and currently with no `coverage_attn`
  or `copy_attn` support.
class_docstr_tok: ["Standard","fully","batched","RNN","decoder","with","attention",".","Faster","implementation",",","uses","CuDNN","for","implementation",".","See",":","class",":","`","~onmt.decoders.decoder.RNNDecoderBase","`","for","options",".","Based","around","the","approach","from","''","Neural","Machine","Translation","By","Jointly","Learning","To","Align","and","Translate","''",":","cite",":","`","Bahdanau2015","`","Implemented","without","input_feeding","and","currently","with","no","`","coverage_attn","`","or","`","copy_attn","`","support","."]
docstr: Private helper for running the specific RNN forward pass.
  Must be overriden by all subclasses.
  
  Args:
      tgt (LongTensor): a sequence of input tokens tensors
          ``(batch, tgt_len, nfeats)``.
      enc_out (FloatTensor): output(tensor sequence) from the
          encoder RNN of size ``(batch, src_len, hidden_size)``.
      src_len (LongTensor): the source enc_out lengths.
  
  Returns:
      (Tensor, List[FloatTensor], Dict[str, List[FloatTensor]):
  
      * dec_state: final hidden state from the decoder.
      * dec_outs: an array of output of every time
        step from the decoder.
      * attns: a dictionary of different
        type of attention Tensor array of every time
        step from the decoder.
docstr_tok: ["Private","helper","for","running","the","specific","RNN","forward","pass",".","Must","be","overriden","by","all","subclasses",".","Args",":","tgt","(","LongTensor",")",":","a","sequence","of","input","tokens","tensors","``","(","batch",",","tgt_len",",","nfeats",")","``",".","enc_out","(","FloatTensor",")",":","output","(","tensor","sequence",")","from","the","encoder","RNN","of","size","``","(","batch",",","src_len",",","hidden_size",")","``",".","src_len","(","LongTensor",")",":","the","source","enc_out","lengths",".","Returns",":","(","Tensor",",","List","[","FloatTensor","]",",","Dict","[","str",",","List","[","FloatTensor","]",")",":","*","dec_state",":","final","hidden","state","from","the","decoder",".","*","dec_outs",":","an","array","of","output","of","every","time","step","from","the","decoder",".","*","attns",":","a","dictionary","of","different","type","of","attention","Tensor","array","of","every","time","step","from","the","decoder","."]
code: def _run_forward_pass(self, tgt, enc_out, src_len=None):
      """
      Private helper for running the specific RNN forward pass.
      Must be overriden by all subclasses.
  
      Args:
          tgt (LongTensor): a sequence of input tokens tensors
              ``(batch, tgt_len, nfeats)``.
          enc_out (FloatTensor): output(tensor sequence) from the
              encoder RNN of size ``(batch, src_len, hidden_size)``.
          src_len (LongTensor): the source enc_out lengths.
  
      Returns:
          (Tensor, List[FloatTensor], Dict[str, List[FloatTensor]):
  
          * dec_state: final hidden state from the decoder.
          * dec_outs: an array of output of every time
            step from the decoder.
          * attns: a dictionary of different
            type of attention Tensor array of every time
            step from the decoder.
      """
  
      assert self.copy_attn is None  # TODO, no support yet.
      assert not self._coverage  # TODO, no support yet.
  
      attns = {}
      emb = self.embeddings(tgt)
  
      if isinstance(self.rnn, nn.GRU):
          rnn_out, dec_state = self.rnn(emb, self.state["hidden"][0])
      else:
          rnn_out, dec_state = self.rnn(emb, self.state["hidden"])
  
      tgt_batch, tgt_len, _ = tgt.size()
  
      # Calculate the attention.
      if not self.attentional:
          dec_outs = rnn_out
      else:
          dec_outs, p_attn = self.attn(
              rnn_out, enc_out, src_len=src_len
          )
          attns["std"] = p_attn
  
      # Calculate the context gate.
      if self.context_gate is not None:
          dec_outs = self.context_gate(
              emb.view(-1, emb.size(2)),
              rnn_out.view(-1, rnn_out.size(2)),
              dec_outs.view(-1, dec_outs.size(2)),
          )
          dec_outs = dec_outs.view(tgt_batch, tgt_len, self.hidden_size)
  
      dec_outs = self.dropout(dec_outs)
  
      return dec_state, dec_outs, attns
  
imports: import torch
  import torch.nn
  from onmt.modules.stacked_rnn import StackedLSTM, StackedGRU
  from onmt.modules import context_gate_factory, GlobalAttention
  from onmt.utils.rnn_factory import rnn_factory
label_desc: Use image node_id 1 for calling the StdRNNDecoder obj's underlying member method code with example usage: obj._run_forward_pass(tgt, enc_out, src_len) and returns: dec_state,  dec_outs,  attns