Unverified Commit 1c5ee5f1 authored by Rocco Meli's avatar Rocco Meli Committed by GitHub
Browse files

use torch.div instead of // (#615)

parent 3dfbaf45
...@@ -246,7 +246,7 @@ def triple_by_molecule(atom_index12: Tensor) -> Tuple[Tensor, Tensor, Tensor]: ...@@ -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) uniqued_central_atom_index, counts = torch.unique_consecutive(sorted_ai1, return_inverse=False, return_counts=True)
# compute central_atom_index # 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) pair_indices = torch.repeat_interleave(pair_sizes)
central_atom_index = uniqued_central_atom_index.index_select(0, pair_indices) central_atom_index = uniqued_central_atom_index.index_select(0, pair_indices)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment