tf.keras.models.clone_model

View source on GitHub

Clone any Model instance.

tf.keras.models.clone_model(
    model, input_tensors=None, clone_function=None
)

Model cloning is similar to calling a model on new inputs, except that it creates new layers (and thus new weights) instead of sharing the weights of the existing layers.

Arguments:

Returns:

An instance of Model reproducing the behavior of the original model, on top of new inputs tensors, using newly instantiated weights. The cloned model might behave differently from the original model if a custom clone_function modifies the layer.

Raises: