Skip to content

Commit

Permalink
Bm/remove print (#111)
Browse files Browse the repository at this point in the history
* Add order to the cleared configurations

* removes print debug logging statement

* detach new layers in multi

* chore: Fix issue with deepcopy in DeeplayModule
  • Loading branch information
BenjaminMidtvedt authored May 20, 2024
1 parent 3290c88 commit c519c76
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion deeplay/blocks/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def make_new_self():
args = [args.new() if isinstance(args, Layer) else args for args in args]
for key, value in kwargs.items():
if isinstance(value, Layer):
kwargs[key] = value.new()
kwargs[key] = value.new(detach=True)
return type(self)(*args, **kwargs)

blocks = Sequential([make_new_self() for _ in range(n)])
Expand Down
2 changes: 2 additions & 0 deletions deeplay/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,8 @@ def new(self, detach: bool = False) -> "DeeplayModule":
for module in self.modules():
if isinstance(module, DeeplayModule) and module._has_built:
memo[id(module)] = module
if self.root_module is not self:
memo[id(self.root_module)] = self.root_module

new = copy.deepcopy(self, memo)

Expand Down

0 comments on commit c519c76

Please sign in to comment.