docstr: Test whether AlphaZero can be built with all frameworks.
docstr_tok: ["Test","whether","AlphaZero","can","be","built","with","all","frameworks","."]
code: def test_alpha_zero_compilation(self):
      """Test whether AlphaZero can be built with all frameworks."""
      config = (
          az.AlphaZeroConfig()
          .environment(env=CartPoleSparseRewards)
          .training(model={"custom_model": DenseModel})
      )
      num_iterations = 1
  
      # Only working for torch right now.
      for _ in framework_iterator(config, frameworks="torch"):
          algo = config.build()
          for i in range(num_iterations):
              results = algo.train()
              check_train_results(results)
              print(results)
          algo.stop()
  
file_path: ray/rllib_contrib/alpha_zero/tests/test_alpha_zero.py
imports: import unittest
  import rllib_alpha_zero.alpha_zero
  from rllib_alpha_zero.alpha_zero.custom_torch_models import DenseModel
  import ray
  from ray.rllib.examples.env.cartpole_sparse_rewards import CartPoleSparseRewards
  from ray.rllib.utils.test_utils import check_train_results, framework_iterator
label_desc: Use image node_id 3 for calling the TestAlphaZero obj's underlying member method code with example usage: obj.test_alpha_zero_compilation() without return types