Skip to content

Commit 5e771a7

Browse files
tsihyoungZiyang HU
authored and
Ziyang HU
committed
Use torch.det to calculate volumes
`torch.cross` without `dim` is deprecated.
1 parent c8c1351 commit 5e771a7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

chgnet/model/model.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ def from_graphs(
807807
else:
808808
strain = None
809809
lattice = graph.lattice
810-
volumes.append(torch.dot(lattice[0], torch.cross(lattice[1], lattice[2])))
810+
volumes.append(torch.det(lattice))
811811
strains.append(strain)
812812

813813
# Bonds

0 commit comments

Comments
 (0)