deepmodeling / deepmd-kit

A deep learning package for many-body potential energy representation and molecular dynamics
https://docs.deepmodeling.com/projects/deepmd/
GNU Lesser General Public License v3.0
1.46k stars 504 forks source link

UserWarning: To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requires_grad_(True), rather than torch.tensor(sourceTensor). #3790

Open njzjz opened 4 months ago

njzjz commented 4 months ago
source/tests/pt/model/test_autodiff.py: 2 warnings
source/tests/pt/model/test_forward_lower.py: 1 warning
source/tests/pt/model/test_null_input.py: 2 warnings
source/tests/pt/model/test_permutation.py: 1 warning
source/tests/pt/model/test_rot.py: 2 warnings
source/tests/pt/model/test_smooth.py: 2 warnings
source/tests/pt/model/test_trans.py: 2 warnings
  /opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/torch/utils/_device.py:78: UserWarning: To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requires_grad_(True), rather than torch.tensor(sourceTensor).
    return func(*args, **kwargs)