ott.solvers.nn.models.ModelBase.clone#
- ModelBase.clone(*, parent=None, _deep_clone=False, **updates)#
Creates a clone of this Module, with optionally updated arguments.
- Parameters
parent (
Union
[Scope
,Module
,None
]) – The parent of the clone. The clone will have no parent if no explicit parent is specified._deep_clone (
Union
[bool
,WeakValueDictionary
]) – A boolean or a weak value dictionary to control deep cloning of submodules. If True, submodules will be cloned recursively. If a weak value dictionary is passed, it will be used to cache cloned submodules. This flag is used by init/apply/bind to avoid scope leakage.**updates – Attribute updates.
self (
TypeVar
(M
, bound= Module)) –
- Return type
TypeVar
(M
, bound= Module)- Returns
A clone of the this Module with the updated attributes and parent.