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
torchani
Commits
077c12b8
Unverified
Commit
077c12b8
authored
Apr 11, 2019
by
Gao, Xiang
Committed by
GitHub
Apr 11, 2019
Browse files
Use the new torch.unique_consecutive to speedup (#209)
parent
276bc75b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
torchani/aev.py
torchani/aev.py
+1
-1
No files found.
torchani/aev.py
View file @
077c12b8
...
@@ -237,7 +237,7 @@ def triple_by_molecule(atom_index1, atom_index2):
...
@@ -237,7 +237,7 @@ def triple_by_molecule(atom_index1, atom_index2):
sorted_ai1
,
rev_indices
=
ai1
.
sort
()
sorted_ai1
,
rev_indices
=
ai1
.
sort
()
# sort and compute unique key
# sort and compute unique key
uniqued_central_atom_index
,
_
,
counts
=
torch
.
_
unique
2_temporary_will_remove_soon
(
sorted_ai1
,
sorted
=
True
,
return_inverse
=
False
,
return_counts
=
True
)
uniqued_central_atom_index
,
counts
=
torch
.
unique
_consecutive
(
sorted_ai1
,
return_counts
=
True
)
# do local combinations within unique key, assuming sorted
# do local combinations within unique key, assuming sorted
pair_sizes
=
counts
*
(
counts
-
1
)
//
2
pair_sizes
=
counts
*
(
counts
-
1
)
//
2
...
...
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