code: def test_restore_on_create(self, golden, replicator_fn):
      replicator = self.replicator_or_skip(
          replicator_fn, use_function=False
      )
  
      # Save a checkpoint from a non-distributed model.
      module = golden.create_module()
      normal_variables = golden.create_all_variables(module)
      for index, variable in enumerate(normal_variables):
          variable.assign(
              goldens.range_like(variable, start=(index + 1))
          )
      checkpoint = TestCheckpoint(module=module)
      checkpoint.save()
      golden.forward(module)
  
      # Create the same model (new params) in the replicator scope.
      with replicator.scope():
          module = golden.create_module()
          checkpoint = TestCheckpoint(module=module)
          status = checkpoint.restore_latest(assert_consumed=False)
          golden.forward(module)
          status.assert_consumed()
          replicator_variables = module.variables
  
      for normal, distributed in zip(
          normal_variables, replicator_variables
      ):
          self.assertAllEqual(
              normal.read_value(),
              distributed.read_value(),
              msg=normal.name,
          )
  
imports: import os
  from absl import logging
  from absl.testing import absltest
  from absl.testing import parameterized
  from sonnet.src import test_utils
  from sonnet.src.conformance import goldens
  from sonnet.src.distribute import replicator
  from sonnet.src.distribute import replicator_test_utils
  import tensorflow
  import tree
label_desc: Use image node_id 5 for calling the ReplicatorCheckpointTest obj's underlying member method code with example usage: obj.test_restore_on_create(golden, replicator_fn) without return types