code: def _add_existing_weight(self, weight, trainable=None):
      
      if trainable is None: trainable = weight.trainable
      self.add_weight(name=weight.name, shape=weight.shape, dtype=weight.dtype,
                      trainable=trainable, getter=lambda *_, **__: weight)
docs: Calls add_weight() to register but not create an existing weight.