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 get_initial_state(self):
      # Place hidden states on same device as model.
      h = [
          list(self.cnn_model.modules())[-1]
          .weight.new(1, self.lstm_state_size)
          .zero_()
          .squeeze(0),
          list(self.cnn_model.modules())[-1]
          .weight.new(1, self.lstm_state_size)
          .zero_()
          .squeeze(0),
      ]
      return h
  
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 3 for calling the TorchMobileV2PlusRNNModel obj's underlying member method code with example usage: obj.get_initial_state() and returns: h