Override fixes and general updates (#129)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Kalen Michael <kalenmike@gmail.com>
This commit is contained in:
parent
d76d7af566
commit
af6e3c536b
10 changed files with 64 additions and 50 deletions
|
|
@ -201,7 +201,7 @@ def copy_attr(a, b, include=(), exclude=()):
|
|||
setattr(a, k, v)
|
||||
|
||||
|
||||
def intersect_state_dicts(da, db, exclude=()):
|
||||
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 all(x not in k for x in exclude) and v.shape == db[k].shape}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue