code: def testSaveRestore(self):
      metrics = [
          py_metrics.AverageReturnMetric(),
          py_metrics.AverageEpisodeLengthMetric(),
          py_metrics.EnvironmentSteps(),
          py_metrics.NumberOfEpisodes(),
      ]
  
      for metric in metrics:
          metric(trajectory.boundary((), (), (), 0.0, 1.0))
          metric(trajectory.mid((), (), (), 1.0, 1.0))
          metric(trajectory.mid((), (), (), 2.0, 1.0))
          metric(trajectory.last((), (), (), 3.0, 0.0))
  
      checkpoint = tf.train.Checkpoint(**{m.name: m for m in metrics})
      prefix = self.get_temp_dir() + "/ckpt"
      save_path = checkpoint.save(prefix)
      for metric in metrics:
          metric.reset()
          self.assertEqual(0, metric.result())
      checkpoint.restore(save_path).assert_consumed()
      for metric in metrics:
          self.assertGreater(metric.result(), 0)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  import numpy
  import tensorflow
  from tf_agents.metrics import py_metrics
  from tf_agents.trajectories import time_step
  from tf_agents.trajectories import trajectory
  from tf_agents.utils import nest_utils
label_desc: Use image node_id 10 for calling the PyMetricsTest obj's underlying member method code with example usage: obj.testSaveRestore() without return types