Closed
Description
As suggested in #2394 (comment), its currently not clear for users that clone
produces an unbounded copy of the module. To get hold of a submodule and its variables you currently have to use this pattern:
module, variables = load_module()
bounded_module = module.bind(variables)
submodule = bounded_module.some_submodule.clone()
submodule_variables = bounded_module.variables
The new proposed .unbind()
method provide more clarity on how to do this process:
module, variables = load_module()
submodule, submodule_variables = module.bind(variables).some_submodule.unbind()
Signature could be:
unbind(self, **clone_kwargs) -> Tuple[Module, FrozenVariableDict]
cc @jheek