Skip to content

Commit

Permalink
Add order to the cleared configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminMidtvedt committed May 14, 2024
1 parent 6383c9a commit 94faee5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
8 changes: 7 additions & 1 deletion deeplay/blocks/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,14 @@ def multi(self, n=1) -> Self:
tags = self.tags
for key, vlist in self._user_config.items():
if key[:-1] in tags and vlist:
if any(isinstance(v.value, DeeplayModule) for v in vlist):

if (
any(isinstance(v.value, DeeplayModule) for v in vlist)
or key[-1] == "order"
):
vlist.clear()
else:
print(type(vlist[0].value))

def make_new_self():
args, kwargs = self.get_init_args()
Expand Down
Empty file.
7 changes: 6 additions & 1 deletion deeplay/tests/models/backbones/test_resnet18.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@ def test_init(self):
model = BackboneResnet18(in_channels=3)
model.build()

def test_re_init(self):
model = BackboneResnet18(in_channels=3)
model.__construct__()
model.build()

def test_num_params(self):
model = BackboneResnet18(in_channels=1)
model.build()
num_params = sum(p.numel() for p in model.parameters())

self.assertEqual(num_params, 11174976)

def test_style_resnet18_input(self):
Expand Down

0 comments on commit 94faee5

Please sign in to comment.