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
896f8935
Commit
896f8935
authored
Oct 20, 2021
by
Gustaf Ahdritz
Browse files
Remove .item() calls
parent
1dcff6aa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
README.md
README.md
+1
-1
openfold/data/data_transforms.py
openfold/data/data_transforms.py
+3
-3
openfold/data/input_pipeline.py
openfold/data/input_pipeline.py
+1
-1
No files found.
README.md
View file @
896f8935
...
...
@@ -50,7 +50,7 @@ run e.g.
```
bash
python3 run_pretrained_openfold.py
\
te
s
t.fasta
\
t
arg
et.fasta
\
data/uniref90/uniref90.fasta
\
data/mgnify/mgy_clusters_2018_12.fa
\
data/pdb70/pdb70
\
...
...
openfold/data/data_transforms.py
View file @
896f8935
...
...
@@ -1103,7 +1103,7 @@ def random_crop_to_size(
else
:
num_templates
=
protein
[
"aatype"
].
new_zeros
((
1
,))
num_res_crop_size
=
min
(
seq_length
.
item
(
),
crop_size
)
num_res_crop_size
=
min
(
int
(
seq_length
),
crop_size
)
# We want each ensemble to be cropped the same way
g
=
torch
.
Generator
(
device
=
protein
[
"seq_length"
].
device
)
...
...
@@ -1111,13 +1111,13 @@ def random_crop_to_size(
g
.
manual_seed
(
seed
)
def
_randint
(
lower
,
upper
):
return
torch
.
randint
(
return
int
(
torch
.
randint
(
lower
,
upper
+
1
,
(
1
,),
device
=
protein
[
"seq_length"
].
device
,
generator
=
g
,
)[
0
]
.
item
(
)
)[
0
])
if
subsample_templates
:
templates_crop_start
=
_randint
(
0
,
num_templates
)
...
...
openfold/data/input_pipeline.py
View file @
896f8935
...
...
@@ -156,7 +156,7 @@ def process_tensors_from_config(tensors, common_cfg, mode_cfg):
tensors
=
compose
(
nonensembled_transform_fns
(
common_cfg
,
mode_cfg
))(
tensors
)
num_ensemble
=
mode_cfg
.
num_ensemble
num_recycling
=
tensors
[
"no_recycling_iters"
]
.
item
(
)
num_recycling
=
int
(
tensors
[
"no_recycling_iters"
])
if
common_cfg
.
resample_msa_in_recycling
:
# Separate batch per ensembling & recycling step.
...
...
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