Model.copy()

Contents

Model.copy()#

Model.copy(clear_state=False)[source]#

Returns a new model filled with deep copies of all model nodes and variables.

Parameters:

clear_state (bool, default: False) – If True, the model state will be cleared before constructing the parental submodel, i.e., all values will be removed. This can be used to save memory, if only the model structure is required.

Return type:

Model