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 __init__(
      self,
      obs_space,
      action_space,
      num_outputs,
      model_config,
      name,
      cnn_shape,
  ):
      TorchRNN.__init__(
          self, obs_space, action_space, num_outputs, model_config, name
      )
      nn.Module.__init__(self)
  
      self.lstm_state_size = 16
      self.cnn_shape = list(cnn_shape)
      self.visual_size_in = cnn_shape[0] * cnn_shape[1] * cnn_shape[2]
      # MobileNetV2 has a flat output of (1000,).
      self.visual_size_out = 1000
  
      # Load the MobileNetV2 from torch.hub.
      self.cnn_model = torch.hub.load(
          "pytorch/vision:v0.6.0", "mobilenet_v2", pretrained=True
      )
  
      self.lstm = nn.LSTM(
          self.visual_size_out, self.lstm_state_size, batch_first=True
      )
  
      # Postprocess LSTM output with another hidden layer and compute values.
      self.logits = SlimFC(self.lstm_state_size, self.num_outputs)
      self.value_branch = SlimFC(self.lstm_state_size, 1)
      # Holds the current "base" output (before logits layer).
      self._features = None
  
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 1 to create a new TorchMobileV2PlusRNNModel object from inherited base classes: TorchRNN, nn with example: obj = TorchMobileV2PlusRNNModel(obs_space, action_space, num_outputs, model_config, name, cnn_shape)