"...text-generation-inference.git" did not exist on "64def8e298efc50caf23cc051d38fd3182fc242d"
Unverified Commit 1a128836 authored by Gao, Xiang's avatar Gao, Xiang Committed by GitHub
Browse files

Clean up unused args (#436)



* Clean up unused args

* fix
Co-authored-by: default avatarFarhad Ramezanghorbani <farhadrgh@users.noreply.github.com>
parent 7a86940e
...@@ -170,8 +170,7 @@ def neighbor_pairs(padding_mask: Tensor, coordinates: Tensor, cell: Tensor, ...@@ -170,8 +170,7 @@ def neighbor_pairs(padding_mask: Tensor, coordinates: Tensor, cell: Tensor,
return molecule_index + atom_index1, molecule_index + atom_index2, shifts return molecule_index + atom_index1, molecule_index + atom_index2, shifts
def neighbor_pairs_nopbc(padding_mask: Tensor, coordinates: Tensor, cell: Tensor, def neighbor_pairs_nopbc(padding_mask: Tensor, coordinates: Tensor, cutoff: float) -> Tuple[Tensor, Tensor, Tensor]:
shifts: Tensor, cutoff: float) -> Tuple[Tensor, Tensor, Tensor]:
"""Compute pairs of atoms that are neighbors (doesn't use PBC) """Compute pairs of atoms that are neighbors (doesn't use PBC)
This function bypasses the calculation of shifts and duplication This function bypasses the calculation of shifts and duplication
...@@ -199,7 +198,7 @@ def neighbor_pairs_nopbc(padding_mask: Tensor, coordinates: Tensor, cell: Tensor ...@@ -199,7 +198,7 @@ def neighbor_pairs_nopbc(padding_mask: Tensor, coordinates: Tensor, cell: Tensor
atom_index1 = p1_all[pair_index] + molecule_index atom_index1 = p1_all[pair_index] + molecule_index
atom_index2 = p2_all[pair_index] + molecule_index atom_index2 = p2_all[pair_index] + molecule_index
# shifts # shifts
shifts = shifts.new_zeros((p1_all.shape[0], 3)).index_select(0, pair_index) shifts = p1_all.new_zeros((p1_all.shape[0], 3)).index_select(0, pair_index)
return atom_index1, atom_index2, shifts return atom_index1, atom_index2, shifts
...@@ -275,7 +274,7 @@ def compute_aev(species: Tensor, coordinates: Tensor, cell: Tensor, ...@@ -275,7 +274,7 @@ def compute_aev(species: Tensor, coordinates: Tensor, cell: Tensor,
num_species_pairs = angular_length // angular_sublength num_species_pairs = angular_length // angular_sublength
# PBC calculation is bypassed if there are no shifts # PBC calculation is bypassed if there are no shifts
if shifts.numel() == 0: if shifts.numel() == 0:
atom_index1, atom_index2, shifts = neighbor_pairs_nopbc(species == -1, coordinates, cell, shifts, Rcr) atom_index1, atom_index2, shifts = neighbor_pairs_nopbc(species == -1, coordinates, Rcr)
else: else:
atom_index1, atom_index2, shifts = neighbor_pairs(species == -1, coordinates, cell, shifts, Rcr) atom_index1, atom_index2, shifts = neighbor_pairs(species == -1, coordinates, cell, shifts, Rcr)
coordinates = coordinates.flatten(0, 1) coordinates = coordinates.flatten(0, 1)
......
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