code: def test_rollouts(self):
      # TODO: Add FrozenLake-v1 to cover LSTM case.
      frameworks = ["torch", "tf2"]
      env_names = ["CartPole-v1", "Pendulum-v1", "ALE/Breakout-v5"]
      fwd_fns = ["forward_exploration", "forward_inference"]
      lstm = [True, False]
      config_combinations = [frameworks, env_names, fwd_fns, lstm]
      for config in itertools.product(*config_combinations):
          fw, env_name, fwd_fn, lstm = config
          if lstm and fw == "tf2":
              # LSTM not implemented in TF2 yet
              continue
          print(
              f"[FW={fw} | [ENV={env_name}] | [FWD={fwd_fn}] | LSTM"
              f"={lstm}"
          )
          env = gym.make(env_name)
  
          preprocessor_cls = get_preprocessor(env.observation_space)
          preprocessor = preprocessor_cls(env.observation_space)
  
          module = _get_ppo_module(
              framework=fw,
              env=env,
              lstm=lstm,
              observation_space=preprocessor.observation_space,
          )
          obs, _ = env.reset()
          obs = preprocessor.transform(obs)
  
          batch = _get_input_batch_from_obs(fw, obs, lstm)
  
          if lstm:
              state_in = module.get_initial_state()
              if fw == "torch":
                  state_in = convert_to_torch_tensor(state_in)
              state_in = tree.map_structure(lambda x: x[None], state_in)
              batch[STATE_IN] = state_in
  
          if fwd_fn == "forward_exploration":
              module.forward_exploration(batch)
          else:
              module.forward_inference(batch)
  
imports: import itertools
  import unittest
  import gymnasium
  import numpy
  import tree
  import ray
  from ray.rllib import SampleBatch
  from ray.rllib.algorithms.ppo.ppo_catalog import PPOCatalog
  from ray.rllib.algorithms.ppo.tf.ppo_tf_rl_module import PPOTfRLModule
  from ray.rllib.algorithms.ppo.torch.ppo_torch_rl_module import PPOTorchRLModule
  from ray.rllib.core.models.base import STATE_IN, STATE_OUT
  from ray.rllib.core.rl_module.rl_module import RLModuleConfig
  from ray.rllib.models.preprocessors import get_preprocessor
  from ray.rllib.utils.framework import try_import_tf, try_import_torch
  from ray.rllib.utils.numpy import convert_to_numpy
  from ray.rllib.utils.torch_utils import convert_to_torch_tensor
label_desc: Use image node_id 3 for calling the TestPPO obj's underlying member method code with example usage: obj.test_rollouts() without return types