Skip to content

Commit

Permalink
Use torch.linalg.norm instead of torch.norm (#515)
Browse files Browse the repository at this point in the history
torch.norm is deprecated and may be removed in a future PyTorch release.
  • Loading branch information
alongd authored Sep 26, 2020
1 parent 31bf913 commit ca6e325
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torchani/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ def vibrational_analysis(masses, hessian, mode_type='MDU', unit='cm^-1'):
# Note that the normal modes are the COLUMNS of the eigenvectors matrix
mw_normalized = eigenvectors.t()
md_unnormalized = mw_normalized * inv_sqrt_mass
norm_factors = 1 / torch.norm(md_unnormalized, dim=1) # units are sqrt(AMU)
norm_factors = 1 / torch.linalg.norm(md_unnormalized, dim=1) # units are sqrt(AMU)
md_normalized = md_unnormalized * norm_factors.unsqueeze(1)

rmasses = norm_factors**2 # units are AMU
Expand Down

0 comments on commit ca6e325

Please sign in to comment.