docstr: Test whether DQN can be built on all frameworks.
docstr_tok: ["Test","whether","DQN","can","be","built","on","all","frameworks","."]
code: def test_dqn_compilation(self):
      """Test whether DQN can be built on all frameworks."""
      num_iterations = 1
      config = (
          dqn.dqn.DQNConfig()
          .environment("CartPole-v1")
          .rollouts(num_rollout_workers=2)
          .training(num_steps_sampled_before_learning_starts=0)
      )
  
      for _ in framework_iterator(config):
          # Double-dueling DQN.
          print("Double-dueling")
          algo = config.build()
          for i in range(num_iterations):
              results = algo.train()
              check_train_results(results)
              print(results)
  
          check_compute_single_action(algo)
          algo.stop()
  
          # Rainbow.
          print("Rainbow")
          rainbow_config = deepcopy(config).training(
              num_atoms=10,
              noisy=True,
              double_q=True,
              dueling=True,
              n_step=5,
          )
          algo = rainbow_config.build()
          for i in range(num_iterations):
              results = algo.train()
              check_train_results(results)
              print(results)
  
          check_compute_single_action(algo)
  
          algo.stop()
  
file_path: ray/rllib/algorithms/dqn/tests/test_dqn.py
imports: from copy import deepcopy
  import numpy
  import unittest
  import ray
  import ray.rllib.algorithms.dqn
  from ray.rllib.utils.test_utils import check, check_compute_single_action, check_train_results, framework_iterator
label_desc: Use image node_id 3 for calling the TestDQN obj's underlying member method code with example usage: obj.test_dqn_compilation() without return types