Skip to content

Commit

Permalink
Merge branch 'torch' of https://github.com/apax-hub/apax into torch
Browse files Browse the repository at this point in the history
  • Loading branch information
M-R-Schaefer committed Apr 8, 2024
2 parents 0552d4d + 9f3f3c0 commit 7fe06c1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apax/nn/torch/model/gmnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,14 @@ def forward(
requires_grad.append(eps)
else:
perturbation = None

energy = self.energy_model(R, Z, neighbor, box, offsets, perturbation)


grads = autograd.grad(energy, requires_grad,
grad_outputs=torch.ones_like(energy),
create_graph=True)

neg_forces = grads[0]
forces = -neg_forces

Expand Down

0 comments on commit 7fe06c1

Please sign in to comment.