code: def test_load_performance(self):
      self.start_tests(name="load-performance")
  
      environment = Environment.create(environment="CartPole-v1")
  
      agent = dict(
          directory="test/data",
          filename="ppo-checkpoint",
          format="checkpoint",
      )
      runner = Runner(agent=agent, environment=environment)
      runner.run(num_episodes=10, use_tqdm=False, evaluation=True)
      self.assertTrue(
          all(
              episode_return == 500.0
              for episode_return in runner.episode_returns
          )
      )
      runner.close()
      self.finished_test()
  
      agent = dict(
          directory="test/data",
          filename="ppo-checkpoint",
          format="numpy",
      )
      runner = Runner(agent=agent, environment=environment)
      runner.run(num_episodes=10, use_tqdm=False, evaluation=True)
      self.assertTrue(
          all(
              episode_return == 500.0
              for episode_return in runner.episode_returns
          )
      )
      runner.close()
      self.finished_test()
  
      agent = dict(
          directory="test/data",
          filename="ppo-checkpoint",
          format="hdf5",
      )
      runner = Runner(agent=agent, environment=environment)
      runner.run(num_episodes=10, use_tqdm=False, evaluation=True)
      self.assertTrue(
          all(
              episode_return == 500.0
              for episode_return in runner.episode_returns
          )
      )
      runner.close()
      self.finished_test()
  
      agent = tf.saved_model.load(export_dir="test/data/ppo-checkpoint")
  
      # 10 episodes
      for _ in range(10):
          states = environment.reset()
          terminal = False
          episode_return = 0.0
          while not terminal:
              states = np.expand_dims(states, axis=0)
              auxiliaries = dict(mask=np.ones(shape=(1, 2), dtype=bool))
              actions = agent.act(states, auxiliaries, True)
              actions = actions.numpy().item()
              states, terminal, reward = environment.execute(
                  actions=actions
              )
              episode_return += reward
          self.assertEqual(episode_return, 500.0)
  
      environment.close()
      self.finished_test()
  
file_path: tensorforce/test/test_saving.py
imports: import os
  from tempfile import TemporaryDirectory
  import unittest
  import numpy
  import tensorflow
  from tensorforce import Agent, Environment, Runner
  from test.unittest_base import UnittestBase
label_desc: Use image node_id 4 for calling the TestSaving obj's underlying member method code with example usage: obj.test_load_performance() without return types