Closed tsihyoung closed 4 months ago
thanks @tsihyoung! i think this was superseded by #131? let me know if i missed something.
thanks @tsihyoung! i think this was superseded by #131? let me know if i missed something.
I think they are not the same. I replaced torch.cross
with torch.linalg.cross
, as torch.cross
without dim
arg is deprecated.
If you prefer to keep torch.cross
, then we need torch.cross(lattice[1], lattice[2], dim=-1)
to suppress the UserWarning
.
@tsihyoung thanks for pointing that out. i'll change it to torch.linalg.cross
in #133
Summary
Use
torch.linalg.cross
to suppress deprecated warning raised bytorch >= 2.2
.Also, since
torch.det
utilises LU decomposition to calculate the determinant, I prefer to use the more direct way (i.e., mixed product) to calculate volumes even iftorch.det
gets MPS support in the future.