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
OpenFold
Commits
993f926a
Commit
993f926a
authored
Jun 22, 2022
by
Gustaf Ahdritz
Browse files
Add no-grad block
parent
ce27a6ca
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
19 deletions
+19
-19
openfold/model/primitives.py
openfold/model/primitives.py
+19
-19
No files found.
openfold/model/primitives.py
View file @
993f926a
...
...
@@ -149,6 +149,7 @@ class Linear(nn.Linear):
with
torch
.
no_grad
():
self
.
bias
.
fill_
(
0
)
with
torch
.
no_grad
():
if
init_fn
is
not
None
:
init_fn
(
self
.
weight
,
self
.
bias
)
else
:
...
...
@@ -161,7 +162,6 @@ class Linear(nn.Linear):
elif
init
==
"gating"
:
gating_init_
(
self
.
weight
)
if
bias
:
with
torch
.
no_grad
():
self
.
bias
.
fill_
(
1.0
)
elif
init
==
"normal"
:
normal_init_
(
self
.
weight
)
...
...
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