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
1c5ee5f1
Unverified
Commit
1c5ee5f1
authored
Mar 25, 2022
by
Rocco Meli
Committed by
GitHub
Mar 25, 2022
Browse files
use torch.div instead of // (#615)
parent
3dfbaf45
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 @
1c5ee5f1
...
...
@@ -246,7 +246,7 @@ def triple_by_molecule(atom_index12: Tensor) -> Tuple[Tensor, Tensor, Tensor]:
uniqued_central_atom_index
,
counts
=
torch
.
unique_consecutive
(
sorted_ai1
,
return_inverse
=
False
,
return_counts
=
True
)
# compute central_atom_index
pair_sizes
=
counts
*
(
counts
-
1
)
//
2
pair_sizes
=
torch
.
div
(
counts
*
(
counts
-
1
)
,
2
,
rounding_mode
=
'trunc'
)
pair_indices
=
torch
.
repeat_interleave
(
pair_sizes
)
central_atom_index
=
uniqued_central_atom_index
.
index_select
(
0
,
pair_indices
)
...
...
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