Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace new_tensor #17

Merged
merged 1 commit into from
May 16, 2023
Merged

Replace new_tensor #17

merged 1 commit into from
May 16, 2023

Conversation

marvinfriede
Copy link
Member

Create tensors from floats with

torch.tensor(<float>, device=<tensor>.device, dtype=<tensor>.dtype) 

instead of using

<tensor>.new_tensor(<float>) 

The latter has side effects (copies additional data beside dtype and device) that become apparent in more advanced AD applications.

@codecov
Copy link

codecov bot commented May 16, 2023

Codecov Report

Merging #17 (fb0a3c6) into main (588fa74) will increase coverage by 0.06%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #17      +/-   ##
==========================================
+ Coverage   96.09%   96.16%   +0.06%     
==========================================
  Files          14       14              
  Lines         282      287       +5     
  Branches       36       36              
==========================================
+ Hits          271      276       +5     
  Misses          2        2              
  Partials        9        9              
Impacted Files Coverage Δ
src/tad_dftd3/model.py 100.00% <ø> (ø)
src/tad_dftd3/damping/atm.py 100.00% <100.00%> (ø)
src/tad_dftd3/damping/rational.py 100.00% <100.00%> (ø)
src/tad_dftd3/disp.py 97.56% <100.00%> (+0.19%) ⬆️
src/tad_dftd3/ncoord.py 95.45% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@awvwgk awvwgk merged commit 05ce444 into dftd3:main May 16, 2023
@marvinfriede marvinfriede deleted the remove-new-tensor branch May 16, 2023 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants