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
02bf2e83
"examples/llm/utils/chat_processor.py" did not exist on "ab33729b4ee274ae8f07cc4dcdf727f9209d1102"
Commit
02bf2e83
authored
Dec 21, 2021
by
Sachin Kadyan
Browse files
Added test for make_all_atom_aatype
parent
bc7864b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
tests/test_data_transforms.py
tests/test_data_transforms.py
+12
-1
No files found.
tests/test_data_transforms.py
View file @
02bf2e83
...
...
@@ -9,7 +9,7 @@ import numpy
import
torch
import
unittest
from
data.data_transforms
import
make_seq_mask
,
add_distillation_flag
from
data.data_transforms
import
make_seq_mask
,
add_distillation_flag
,
make_all_atom_aatype
from
openfold.config
import
model_config
...
...
@@ -32,6 +32,17 @@ class TestDataTransforms(unittest.TestCase):
assert
'is_distillation'
in
protein
assert
protein
[
'is_distillation'
]
is
True
def
test_make_all_atom_aatype
(
self
):
seq
=
torch
.
tensor
([
range
(
20
)],
dtype
=
torch
.
int64
).
transpose
(
0
,
1
)
seq_one_hot
=
torch
.
FloatTensor
(
seq
.
shape
[
0
],
20
).
zero_
()
seq_one_hot
.
scatter_
(
1
,
seq
,
1
)
protein_aatype
=
torch
.
tensor
(
seq_one_hot
)
protein
=
{
'aatype'
:
protein_aatype
}
protein
=
make_all_atom_aatype
(
protein
)
print
(
protein
)
assert
'all_atom_aatype'
in
protein
assert
protein
[
'all_atom_aatype'
].
shape
==
protein
[
'aatype'
].
shape
if
__name__
==
'__main__'
:
unittest
.
main
()
...
...
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