docstr: Feeds `inputs` (B x T x ..) through the Gru Unit.
  
  Returns the resulting outputs as a sequence (B x T x ...).
  Values are stored in self._cur_value in simple (B) shape (where B
  contains both the B and T dims!).
  
  Returns:
      NN Outputs (B x T x ...) as sequence.
      The state batches as a List of two items (c- and h-states).
docstr_tok: ["Feeds","`","inputs","`","(","B","x","T","x","..",")","through","the","Gru","Unit",".","Returns","the","resulting","outputs","as","a","sequence","(","B","x","T","x","...",")",".","Values","are","stored","in","self._cur_value","in","simple","(","B",")","shape","(","where","B","contains","both","the","B","and","T","dims","!",")",".","Returns",":","NN","Outputs","(","B","x","T","x","...",")","as","sequence",".","The","state","batches","as","a","List","of","two","items","(","c-","and","h-states",")","."]
code: def forward_rnn(self, inputs, state, seq_lens):
      """Feeds `inputs` (B x T x ..) through the Gru Unit.
  
      Returns the resulting outputs as a sequence (B x T x ...).
      Values are stored in self._cur_value in simple (B) shape (where B
      contains both the B and T dims!).
  
      Returns:
          NN Outputs (B x T x ...) as sequence.
          The state batches as a List of two items (c- and h-states).
      """
      x = nn.functional.relu(self.fc1(inputs))
      self._features, [h, c] = self.lstm(
          x,
          [torch.unsqueeze(state[0], 0), torch.unsqueeze(state[1], 0)],
      )
      action_out = self.action_branch(self._features)
      return action_out, [torch.squeeze(h, 0), torch.squeeze(c, 0)]
  
file_path: ray/python/ray/rllib/examples/models/rnn_model.py
imports: import numpy
  from ray.rllib.models.modelv2 import ModelV2
  from ray.rllib.models.preprocessors import get_preprocessor
  from ray.rllib.models.tf.recurrent_net import RecurrentNetwork
  from ray.rllib.models.torch.recurrent_net import RecurrentNetwork
  from ray.rllib.utils.annotations import override
  from ray.rllib.utils.framework import try_import_tf, try_import_torch
label_desc: Use image node_id 4 for calling the TorchRNNModel obj's underlying member method code with example usage: obj.forward_rnn(inputs, state, seq_lens) and returns: action_out,  list