Clone a Functional or Sequential Model instance.

Used in the notebooks

Used in the guide Used in the tutorials

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.

Note that clone_model will not preserve the uniqueness of shared objects within the model (e.g. a single variable attached to two distinct layers will be restored as two separate variables).

model Instance of Model (could be a Functional model or a Sequential model).