class_docstr: A conv. + recurrent torch net example using a pre-trained MobileNet.
class_docstr_tok: ["A","conv",".","+","recurrent","torch","net","example","using","a","pre-trained","MobileNet","."]
code: def forward_rnn(self, inputs, state, seq_lens):
      # Create image dims.
      vision_in = torch.reshape(inputs, [-1] + self.cnn_shape)
      vision_out = self.cnn_model(vision_in)
      # Flatten.
      vision_out_time_ranked = torch.reshape(
          vision_out,
          [inputs.shape[0], inputs.shape[1], vision_out.shape[-1]],
      )
      if len(state[0].shape) == 2:
          state[0] = state[0].unsqueeze(0)
          state[1] = state[1].unsqueeze(0)
      # Forward through LSTM.
      self._features, [h, c] = self.lstm(vision_out_time_ranked, state)
      # Forward LSTM out through logits layer and value layer.
      logits = self.logits(self._features)
      return logits, [h.squeeze(0), c.squeeze(0)]
  
file_path: ray/python/ray/rllib/examples/models/mobilenet_v2_with_lstm_models.py
imports: import numpy
  from ray.rllib.models.modelv2 import ModelV2
  from ray.rllib.models.tf.recurrent_net import RecurrentNetwork
  from ray.rllib.models.torch.misc import SlimFC
  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 2 for calling the TorchMobileV2PlusRNNModel obj's underlying member method code with example usage: obj.forward_rnn(inputs, state, seq_lens) and returns: logits,  list