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
a14e8360
Commit
a14e8360
authored
May 25, 2022
by
Gustaf Ahdritz
Browse files
Never checkpoint with grad disabled
parent
67e34d92
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
openfold/utils/checkpointing.py
openfold/utils/checkpointing.py
+1
-1
No files found.
openfold/utils/checkpointing.py
View file @
a14e8360
...
...
@@ -73,7 +73,7 @@ def checkpoint_blocks(
# Avoids mishaps when the blocks take just one argument
args
=
wrap
(
args
)
if
blocks_per_ckpt
is
None
:
if
blocks_per_ckpt
is
None
or
not
torch
.
is_grad_enabled
()
:
return
exec
(
blocks
,
args
)
elif
blocks_per_ckpt
<
1
or
blocks_per_ckpt
>
len
(
blocks
):
raise
ValueError
(
"blocks_per_ckpt must be between 1 and len(blocks)"
)
...
...
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