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_weights(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)
  
      for _ in framework_iterator(config):
          algo = config.build(env="CartPole-v1")
  
          weights = np.zeros_like(algo.get_weights())
          algo.set_weights(weights=weights)
          new_weights = algo.get_weights()
  
          self.assertTrue(np.array_equal(weights, new_weights))
  
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 4 for calling the TestES obj's underlying member method code with example usage: obj.test_es_weights() without return types