intersect_dicts() in hubconf.py fix (#5542)
This commit is contained in:
1 parent
fa2344cdd8
commit
e189fa15ea
4 files changed
+10
-12
No files matched your search
@@ -153,11 +153,6 @@ def de_parallel(model):
|
||||
return model.module if is_parallel(model) else model
|
||||
|
||||
|
||||
def intersect_dicts(da, db, exclude=()):
|
||||
# Dictionary intersection of matching keys and shapes, omitting 'exclude' keys, using da values
|
||||
return {k: v for k, v in da.items() if k in db and not any(x in k for x in exclude) and v.shape == db[k].shape}
|
||||
|
||||
|
||||
def initialize_weights(model):
|
||||
for m in model.modules():
|
||||
t = type(m)
|
||||
|
||||
Reference in new issue
Block a user