class_docstr: Implementation of "Training RNNs as Fast as CNNs"
  :cite:`DBLP:journals/corr/abs-1709-02755`
  
  TODO: turn to pytorch's implementation when it is available.
  
  This implementation is adpoted from the author of the paper:
  https://github.com/taolei87/sru/blob/master/cuda_functional.py.
  
  Args:
    input_size (int): input to model
    hidden_size (int): hidden dimension
    num_layers (int): number of layers
    dropout (float): dropout to use (stacked)
    rnn_dropout (float): dropout to use (recurrent)
    bidirectional (bool): bidirectional
    use_tanh (bool): activation
    use_relu (bool): activation
class_docstr_tok: ["Implementation","of","``","Training","RNNs","as","Fast","as","CNNs","''",":","cite",":","`","DBLP",":","journals\/corr\/abs-1709-02755","`","TODO",":","turn","to","pytorch","'s","implementation","when","it","is","available",".","This","implementation","is","adpoted","from","the","author","of","the","paper",":","https",":","\/\/github.com\/taolei87\/sru\/blob\/master\/cuda_functional.py",".","Args",":","input_size","(","int",")",":","input","to","model","hidden_size","(","int",")",":","hidden","dimension","num_layers","(","int",")",":","number","of","layers","dropout","(","float",")",":","dropout","to","use","(","stacked",")","rnn_dropout","(","float",")",":","dropout","to","use","(","recurrent",")","bidirectional","(","bool",")",":","bidirectional","use_tanh","(","bool",")",":","activation","use_relu","(","bool",")",":","activation"]
code: def forward(self, input, c0=None, return_hidden=True):
      assert input.dim() == 3  # (len, batch, n_in)
      dir_ = 2 if self.bidirectional else 1
      if c0 is None:
          zeros = input.data.new(
              input.size(1), self.n_out * dir_
          ).zero_()
          c0 = [zeros for i in range(self.depth)]
      else:
          if isinstance(c0, tuple):
              # RNNDecoderState wraps hidden as a tuple.
              c0 = c0[0]
          assert c0.dim() == 3  # (depth, batch, dir_*n_out)
          c0 = [h.squeeze(0) for h in c0.chunk(self.depth, 0)]
  
      prevx = input
      lstc = []
      for i, rnn in enumerate(self.rnn_lst):
          h, c = rnn(prevx, c0[i])
          prevx = h
          lstc.append(c)
  
      if self.bidirectional:
          # fh -> (layers*directions) x batch x dim
          fh = torch.cat(lstc)
      else:
          fh = torch.stack(lstc)
  
      if return_hidden:
          return prevx, fh
      else:
          return prevx
  
imports: import subprocess
  import platform
  import os
  import re
  import configargparse
  import torch
  import torch.nn
  from torch.autograd import Function
  from torch.cuda.amp import custom_fwd, custom_bwd
  from collections import namedtuple
label_desc: Use image node_id 3 for calling the SRU obj's underlying member method code with example usage: obj.forward(input, c0, return_hidden) and returns: prevx,  fh, prevx