class_docstr: Sanity tests for A2C exec impl.
docstr: Test whether an A3C can be built with both frameworks.
code: def test_a3c_compilation(self):
      """Test whether an A3C can be built with both frameworks."""
      config = A3CConfig().rollouts(
          num_rollout_workers=2, num_envs_per_worker=2
      )
  
      num_iterations = 2
  
      # Test against all frameworks.
      for _ in framework_iterator(config):
          config.eager_tracing = False
          for env in ["CartPole-v1", "Pendulum-v1"]:
              print("env={}".format(env))
              config.model["use_lstm"] = env == "CartPole-v1"
              algo = config.build(env=env)
              for i in range(num_iterations):
                  results = algo.train()
                  check_train_results(results)
                  print(results)
              check_compute_single_action(
                  algo, include_state=config.model["use_lstm"]
              )
              algo.stop()
  
file_path: ray/rllib_contrib/a3c/tests/test_a3c.py
imports: import unittest
  from rllib_a3c.a3c import A3CConfig
  import ray
  from ray.rllib.policy.sample_batch import DEFAULT_POLICY_ID
  from ray.rllib.utils.metrics.learner_info import LEARNER_INFO, LEARNER_STATS_KEY
  from ray.rllib.utils.test_utils import check_compute_single_action, check_train_results, framework_iterator
label_desc: Use image node_id 3 for calling the TestA3C obj's underlying member method code with example usage: obj.test_a3c_compilation() without return types