Unverified Commit 7a95e55e authored by Gao, Xiang's avatar Gao, Xiang Committed by GitHub
Browse files

Use floor div in aev (#437)



* ../aten/src/ATen/native/BinaryOps.cpp:81: UserWarning: Integer division of tensors using div or / is deprecated, and in a future release div will perform true division as in Python 3. Use true_divide or floor_divide (// in Python) instead.

* Update aev.py
Co-authored-by: default avatarFarhad Ramezanghorbani <farhadrgh@users.noreply.github.com>
parent 1a128836
...@@ -238,7 +238,7 @@ def triple_by_molecule(atom_index1: Tensor, atom_index2: Tensor) -> Tuple[Tensor ...@@ -238,7 +238,7 @@ def triple_by_molecule(atom_index1: Tensor, atom_index2: Tensor) -> Tuple[Tensor
counts = unique_results[-1] counts = unique_results[-1]
# compute central_atom_index # compute central_atom_index
pair_sizes = (counts * (counts - 1) / 2).long() pair_sizes = counts * (counts - 1) // 2
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