code: def test_kl_coeff_changes(self):
      initial_kl_coeff = 0.01
      config = (
          appo.APPOConfig()
          .experimental(_enable_new_api_stack=True)
          .environment("CartPole-v1")
          # Asynchronous Algo, make sure we have some results after 1 iteration.
          .reporting(min_time_s_per_iteration=10)
          .rollouts(
              num_rollout_workers=0,
              rollout_fragment_length=frag_length,
          )
          .resources(num_gpus=0)
          .training(
              gamma=0.99,
              model=dict(
                  fcnet_hiddens=[10, 10],
                  fcnet_activation="linear",
                  vf_share_layers=False,
              ),
              use_kl_loss=True,
              kl_coeff=initial_kl_coeff,
          )
          .exploration(exploration_config={})
      )
      for _ in framework_iterator(config, frameworks=("torch", "tf2")):
          algo = config.build()
          # Call train while results aren't returned because this is
          # a asynchronous algorithm and results are returned asynchronously.
          while True:
              results = algo.train()
              if (
                  results.get("info", {})
                  .get(LEARNER_INFO, {})
                  .get(DEFAULT_POLICY_ID)
              ):
                  break
          curr_kl_coeff = results["info"][LEARNER_INFO][
              DEFAULT_POLICY_ID
          ][LEARNER_RESULTS_CURR_KL_COEFF_KEY]
          self.assertNotEqual(curr_kl_coeff, initial_kl_coeff)
  
file_path: ray/rllib/algorithms/appo/tests/test_appo_learner.py
imports: import unittest
  import numpy
  import tree
  import ray
  import ray.rllib.algorithms.appo
  from ray.rllib.algorithms.appo.tf.appo_tf_learner import LEARNER_RESULTS_CURR_KL_COEFF_KEY
  from ray.rllib.policy.sample_batch import SampleBatch, DEFAULT_POLICY_ID
  from ray.rllib.utils.metrics.learner_info import LEARNER_INFO
  from ray.rllib.utils.framework import try_import_tf
  from ray.rllib.utils.test_utils import framework_iterator
  from ray.rllib.utils.torch_utils import convert_to_torch_tensor
label_desc: Use image node_id 4 for calling the TestAPPOTfLearner obj's underlying member method code with example usage: obj.test_kl_coeff_changes() without return types