code: def test_rl2_ppo_pendulum_adapted_policy(self):
      with TFTrainer(snapshot_config, sess=self.sess):
          algo = RL2PPO(
              meta_batch_size=self.meta_batch_size,
              task_sampler=self.tasks,
              env_spec=self.env_spec,
              policy=self.policy,
              baseline=self.baseline,
              sampler=self.sampler,
              discount=0.99,
              gae_lambda=0.95,
              lr_clip_range=0.2,
              optimizer_args=dict(
                  batch_size=32,
                  max_optimization_epochs=10,
              ),
              stop_entropy_gradient=True,
              entropy_method="max",
              policy_ent_coeff=0.02,
              center_adv=False,
              episodes_per_trial=self.episode_per_task,
          )
  
          exploration_policy = algo.get_exploration_policy()
          adapted_policy = algo.adapt_policy(exploration_policy, [])
          (params, hidden) = adapted_policy.get_param_values()
          expected_new_params = np.zeros_like(params)
          expected_hidden = np.zeros_like(hidden)
          adapted_policy.set_param_values(
              (expected_new_params, expected_hidden)
          )
          (new_params, new_hidden) = adapted_policy.get_param_values()
          assert np.array_equal(expected_new_params, new_params)
          assert np.array_equal(expected_hidden, new_hidden)
  
imports: import numpy
  import pytest
  from garage.envs import GymEnv, normalize
  from garage.experiment import task_sampler
  from garage.experiment.meta_evaluator import MetaEvaluator
  from garage.np.baselines import LinearFeatureBaseline
  from garage.sampler import LocalSampler
  from garage.tf.algos import RL2PPO
  from garage.tf.algos.rl2 import RL2Env, RL2Worker
  from garage.tf.policies import GaussianGRUPolicy
  from garage.trainer import TFTrainer
  from tests.fixtures import snapshot_config, TfGraphTestCase
  from garage.envs.mujoco import HalfCheetahDirEnv
label_desc: Use image node_id 5 for calling the TestRL2PPO obj's underlying member method code with example usage: obj.test_rl2_ppo_pendulum_adapted_policy() without return types