Skip to content

Commit

Permalink
Use torch.det to calculate volumes (#130)
Browse files Browse the repository at this point in the history
`torch.cross` without `dim` is deprecated.
  • Loading branch information
tsihyoung authored Feb 27, 2024
1 parent c8c1351 commit 5a25b2c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chgnet/model/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ def from_graphs(
else:
strain = None
lattice = graph.lattice
volumes.append(torch.dot(lattice[0], torch.cross(lattice[1], lattice[2])))
volumes.append(torch.det(lattice))
strains.append(strain)

# Bonds
Expand Down

0 comments on commit 5a25b2c

Please sign in to comment.