Commit 4682c1d0 authored by zms1999's avatar zms1999
Browse files

add condition of skipping pop params

parent 9f7cbd15
......@@ -29,6 +29,8 @@ def stash_expert_params(e, params):
def pop_expert_params(e):
if not hasattr(e, 'expert_param_stash'):
return
if not e.expert_param_stash:
return
for n, p in e.named_parameters():
with torch.no_grad():
p.copy_(e.expert_param_stash[n])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment