Skip to content

Commit fd6e001

Browse files
committed
prevent wrapping of a network that already contains another wrapped module
1 parent 7696bc6 commit fd6e001

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

GAF_microbatch_pytorch/GAF.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ def __init__(
185185
super().__init__()
186186

187187
self.net = net
188+
assert not any([m for m in net.modules() if isinstance(m, GAFWrapper)]), 'GAF wrapper cannot contain another network that is already wrapped'
188189

189190
self.exclude_from_filtering = set(exclude_from_filtering)
190191

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "GAF-microbatch-pytorch"
3-
version = "0.0.3"
3+
version = "0.0.4"
44
description = "Gradient Agreement Filtering"
55
authors = [
66
{ name = "Phil Wang", email = "lucidrains@gmail.com" }

0 commit comments

Comments
 (0)