docstr: Test whether an ESAlgorithm can be built on all frameworks.
docstr_tok: ["Test","whether","an","ESAlgorithm","can","be","built","on","all","frameworks","."]
code: def test_es_compilation(self):
      """Test whether an ESAlgorithm can be built on all frameworks."""
      config = es.ESConfig()
      # Keep it simple.
      config.training(
          model={
              "fcnet_hiddens": [10],
              "fcnet_activation": None,
          },
          noise_size=2500000,
          episodes_per_batch=10,
          train_batch_size=100,
      )
      config.rollouts(num_rollout_workers=1)
      # Test eval workers ("normal" WorkerSet, unlike ES' list of
      # RolloutWorkers used for collecting train batches).
      config.evaluation(evaluation_interval=1, evaluation_num_workers=2)
  
      num_iterations = 1
  
      for _ in framework_iterator(config):
          for env in ["CartPole-v1", "Pendulum-v1"]:
              algo = config.build(env=env)
              for i in range(num_iterations):
                  results = algo.train()
                  print(results)
  
              check_compute_single_action(algo)
              algo.stop()
      ray.shutdown()
  
file_path: ray/rllib_contrib/es/tests/test_es.py
imports: import unittest
  import numpy
  import rllib_es.es.es
  import ray
  from ray.rllib.utils.test_utils import check_compute_single_action, framework_iterator
label_desc: Use image node_id 3 for calling the TestES obj's underlying member method code with example usage: obj.test_es_compilation() without return types