Unverified Commit 9d957400 authored by Gao, Xiang's avatar Gao, Xiang Committed by GitHub
Browse files

Remove workaround for TorchScript bug on torch.unique_consecutive (#471)

* Remove workaround for TorchScript bug on torch.unique_consecutive

On par with https://github.com/pytorch/pytorch/pull/39339



This breaks the compatibility with PyTorch 1.5.0, but hopefully will be compatible with 1.5.1.

* trigger ci

* trigger

* trigger
Co-authored-by: default avatarFarhad Ramezanghorbani <farhadrgh@users.noreply.github.com>
parent ac27ed3d
......@@ -230,9 +230,7 @@ def triple_by_molecule(atom_index12: Tensor) -> Tuple[Tensor, Tensor, Tensor]:
sorted_ai1, rev_indices = ai1.sort()
# sort and compute unique key
unique_results = torch.unique_consecutive(sorted_ai1, return_inverse=True, return_counts=True)
uniqued_central_atom_index = unique_results[0]
counts = unique_results[-1]
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
......
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