docstr: Test whether SimpleQ can be built on all frameworks.
docstr_tok: ["Test","whether","SimpleQ","can","be","built","on","all","frameworks","."]
code: def test_simple_q_compilation(self):
      """Test whether SimpleQ can be built on all frameworks."""
      # Run locally and with compression
      config = (
          simple_q.SimpleQConfig()
          .rollouts(num_rollout_workers=0, compress_observations=True)
          .training(num_steps_sampled_before_learning_starts=0)
      )
  
      num_iterations = 2
  
      for _ in framework_iterator(config, with_eager_tracing=True):
          algo = config.build(env="CartPole-v1")
          rw = algo.workers.local_worker()
          for i in range(num_iterations):
              sb = rw.sample()
              assert sb.count == config.rollout_fragment_length
              results = algo.train()
              check_train_results(results)
              print(results)
  
          check_compute_single_action(algo)
  
file_path: ray/rllib_contrib/simple_q/tests/test_simple_q.py
imports: import unittest
  import numpy
  import rllib_simple_q.simple_q.simple_q
  from rllib_simple_q.simple_q.simple_q_tf_policy import SimpleQTF2Policy
  from rllib_simple_q.simple_q.simple_q_torch_policy import SimpleQTorchPolicy
  import ray
  from ray.rllib.policy.sample_batch import SampleBatch
  from ray.rllib.utils.framework import try_import_tf
  from ray.rllib.utils.metrics.learner_info import DEFAULT_POLICY_ID, LEARNER_INFO, LEARNER_STATS_KEY
  from ray.rllib.utils.numpy import fc, huber_loss, one_hot
  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 TestSimpleQ obj's underlying member method code with example usage: obj.test_simple_q_compilation() without return types