Skip to content

Commit

Permalink
Merge pull request #2 from jamaliki/patch-1
Browse files Browse the repository at this point in the history
Only make into tensor if not already
  • Loading branch information
jgreener64 authored Jan 17, 2024
2 parents 66c4f27 + 005bd8a commit 6533d81
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion progres/progres.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@ def read_coords(fp, fileformat="guess"):

def coords_to_graph(coords):
n_res = len(coords)
coords = torch.tensor(coords)
if not isinstance(coords, torch.Tensor):
coords = torch.tensor(coords)
if coords.size(1) != 3:
raise ValueError("coords must be, or must be convertible to, a tensor of shape (nres, 3)")
dmap = torch.cdist(coords.unsqueeze(0), coords.unsqueeze(0),
Expand Down

0 comments on commit 6533d81

Please sign in to comment.