ott.neural.networks.potentials.BasePotential.clone

ott.neural.networks.potentials.BasePotential.clone#

BasePotential.clone(*, parent=None, _deep_clone=False, _reset_names=False, **updates)#

Creates a clone of this Module, with optionally updated arguments.

NOTE: end users are encouraged to use the copy method. clone is used

primarily for internal routines, and copy offers simpler arguments and better defaults.

Parameters:
  • parent (Union[Scope, Module, _Sentinel, 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.

  • _reset_names (bool) – If True, name=None is also passed to submodules when cloning. Resetting names in submodules is necessary when calling .unbind.

  • **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.