Skip to content

Commit

Permalink
fix: UTs
Browse files Browse the repository at this point in the history
  • Loading branch information
anyangml committed Mar 5, 2024
1 parent a30bc35 commit d436444
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions deepmd/pt/model/atomic_model/linear_atomic_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,7 @@ def remap_atype(
), "The input `atype` cannot be handled by the type_map."
type_2_idx = {atp: idx for idx, atp in enumerate(ori_map)}
# this maps the atype in the new map to the original map
mapping = torch.tensor(
[type_2_idx[new_map[idx]] for idx in range(len(new_map))]
).to(atype.device)
mapping = torch.tensor([type_2_idx[new_map[idx]] for idx in range(len(new_map))], device=atype.device)
updated_atype = mapping[atype.long()]
return updated_atype

Expand Down

0 comments on commit d436444

Please sign in to comment.