materialsvirtuallab / matgl

Graph deep learning library for materials
BSD 3-Clause "New" or "Revised" License
232 stars 57 forks source link

UserWarrning in `_basis.py` #258

Closed Andrew-S-Rosen closed 1 month ago

Andrew-S-Rosen commented 1 month ago

Email (Optional)

No response

Version

1.1.1

Which OS(es) are you using?

What happened?

When running a model, the following UserWarning is raised in matgl.layers._basis.py:

.../site-packages/matgl/layers/_basis.py:121: 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).
  root = torch.tensor(roots[i])

Pretty self-explanatory; line 121 needs updating in _basis.py.

Code snippet

No response

Log output

No response

Code of Conduct

kenko911 commented 1 month ago

Hi @Andrew-S-Rosen, thanks for reporting this and I have fixed it in the latest update!