code: def test_config(self):
      # FEATURES.MD
      self.start_tests(name="config")
  
      with TemporaryDirectory() as directory:
          # save: before first timestep
          update = dict(unit="episodes", batch_size=1)
          saver = dict(directory=directory, frequency=1)
          agent, environment = self.prepare(
              update=update,
              saver=saver,
              config=dict(
                  device="CPU",
                  eager_mode=False,
                  create_debug_assertions=True,
                  tf_log_level=20,
              ),
          )
          weights0 = agent.model.policy.network.layers[0][
              1
          ].weights.numpy()
          states = environment.reset()
          actions = agent.act(states=states)
          states, terminal, reward = environment.execute(
              actions=actions
          )
          updated = agent.observe(terminal=terminal, reward=reward)
          agent.close()
          self.finished_test()
  
          # load: from given directory
          agent = Agent.load(
              directory=directory, environment=environment
          )
          x = agent.model.policy.network.layers[0][1].weights.numpy()
          self.assertTrue(np.allclose(x, weights0))
          self.assertEqual(agent.timesteps, 0)
          while not terminal:
              actions = agent.act(states=states)
              states, terminal, reward = environment.execute(
                  actions=actions
              )
              updated = agent.observe(terminal=terminal, reward=reward)
          self.assertTrue(updated)
          weights1 = agent.model.policy.network.layers[0][
              1
          ].weights.numpy()
          self.assertTrue(not np.allclose(weights1, weights0))
          timesteps = agent.timesteps
          agent.close()
          self.finished_test()
  
          # load: from given directory
          agent = Agent.load(
              directory=directory, environment=environment
          )
          x = agent.model.policy.network.layers[0][1].weights.numpy()
          self.assertTrue(np.allclose(x, weights1))
          self.assertEqual(agent.timesteps, timesteps)
          agent.close()
          environment.close()
          self.finished_test()
  
          # create, not load
          agent, environment = self.prepare(
              update=update,
              saver=saver,
              config=dict(
                  device="CPU",
                  eager_mode=False,
                  create_debug_assertions=True,
                  tf_log_level=20,
              ),
          )
          x = agent.model.policy.network.layers[0][1].weights.numpy()
          self.assertTrue(not np.allclose(x, weights0))
          self.assertTrue(not np.allclose(x, weights1))
          self.assertEqual(agent.timesteps, 0)
          states = environment.reset()
          terminal = False
          while not terminal:
              actions = agent.act(states=states)
              states, terminal, reward = environment.execute(
                  actions=actions
              )
              updated = agent.observe(terminal=terminal, reward=reward)
          self.assertTrue(updated)
          weights2 = agent.model.policy.network.layers[0][
              1
          ].weights.numpy()
          agent.close()
          self.finished_test()
  
          # load: from given directory
          agent = Agent.load(
              directory=directory, environment=environment
          )
          x = agent.model.policy.network.layers[0][1].weights.numpy()
          self.assertTrue(np.allclose(x, weights2))
          agent.close()
          environment.close()
          self.finished_test()
  
          files = set(os.listdir(path=directory))
          self.assertTrue(
              files
              == {
                  "agent.json",
                  "agent-0.data-00000-of-00001",
                  "agent-0.index",
                  "agent-1.data-00000-of-00001",
                  "agent-1.index",
                  "checkpoint",
              }
          )
  
      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 3 for calling the TestSaving obj's underlying member method code with example usage: obj.test_config() without return types