Unverified Commit 21c794a8 authored by Ignacio Pickering's avatar Ignacio Pickering Committed by GitHub
Browse files

slight improvement in performance of AEV (#419)

parent 51d76c98
...@@ -139,7 +139,9 @@ def neighbor_pairs(padding_mask: Tensor, coordinates: Tensor, cell: Tensor, ...@@ -139,7 +139,9 @@ def neighbor_pairs(padding_mask: Tensor, coordinates: Tensor, cell: Tensor,
all_atoms = torch.arange(num_atoms, device=cell.device) all_atoms = torch.arange(num_atoms, device=cell.device)
# Step 2: center cell # Step 2: center cell
p1_center, p2_center = torch.combinations(all_atoms).unbind(-1) # torch.triu_indices is faster than combinations
p1_center, p2_center = torch.triu_indices(num_atoms, num_atoms, 1,
device=cell.device).unbind(0)
shifts_center = shifts.new_zeros((p1_center.shape[0], 3)) shifts_center = shifts.new_zeros((p1_center.shape[0], 3))
# Step 3: cells with shifts # Step 3: cells with shifts
......
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