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
67e34d92
Commit
67e34d92
authored
May 25, 2022
by
Gustaf Ahdritz
Browse files
Avoid calling the checkpointing function with grad disabled
parent
c290ff87
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
openfold/model/evoformer.py
openfold/model/evoformer.py
+5
-1
No files found.
openfold/model/evoformer.py
View file @
67e34d92
...
@@ -571,10 +571,14 @@ class EvoformerStack(nn.Module):
...
@@ -571,10 +571,14 @@ class EvoformerStack(nn.Module):
blocks
=
[
partial
(
block_with_cache_clear
,
b
)
for
b
in
blocks
]
blocks
=
[
partial
(
block_with_cache_clear
,
b
)
for
b
in
blocks
]
blocks_per_ckpt
=
self
.
blocks_per_ckpt
if
(
not
torch
.
is_grad_enabled
()):
blocks_per_ckpt
=
None
m
,
z
=
checkpoint_blocks
(
m
,
z
=
checkpoint_blocks
(
blocks
,
blocks
,
args
=
(
m
,
z
),
args
=
(
m
,
z
),
blocks_per_ckpt
=
self
.
blocks_per_ckpt
if
self
.
training
else
None
,
blocks_per_ckpt
=
blocks_per_ckpt
,
)
)
s
=
self
.
linear
(
m
[...,
0
,
:,
:])
s
=
self
.
linear
(
m
[...,
0
,
:,
:])
...
...
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