Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
FastMoE
Commits
4682c1d0
Commit
4682c1d0
authored
Apr 30, 2022
by
zms1999
Browse files
add condition of skipping pop params
parent
9f7cbd15
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
fmoe/fastermoe/expert_utils.py
fmoe/fastermoe/expert_utils.py
+2
-0
No files found.
fmoe/fastermoe/expert_utils.py
View file @
4682c1d0
...
...
@@ -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
])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment