code: def load_checkpoint(path, model_fn):
      """Loads a model checkpoint from the given path.
  
      Args:
        path: The path to the model checkpoint.
        model_fn: A callable which builds the model structure.
  
      Returns:
        A model which weights are restored from the checkpoint.
      """
      logging.info("Loading checkpoint: %s", path)
      model = model_fn()
      ckpt = tf.train.Checkpoint(model=model)
      ckpt.restore(path)
      return model
  
file_path: neural-structured-learning/research/multi_representation_adversary/multi_representation_adversary/helper.py
imports: from absl import logging
  from multi_representation_adversary import attacks
  from multi_representation_adversary import transforms
  import tensorflow.compat.v2
label_desc: Use image node_id 4 for calling a global function with example usage: load_checkpoint(path, model_fn) and returns: model