Skip to content

Commit

Permalink
necessary when the graph is empty.
Browse files Browse the repository at this point in the history
  • Loading branch information
wcwitt committed Nov 28, 2022
1 parent f49b10a commit 5a69c24
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mace/calculators/lammps_mace.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ def forward(
torch.cross(cell[:, 1, :], cell[:, 2, :], dim=1),
).unsqueeze(-1)
stress = virials / volume.view(-1, 1, 1)
else:
virials = torch.zeros_like(displacement)

total_energy = scatter_sum(
src=node_energy, index=data["batch"], dim=-1, dim_size=num_graphs
Expand Down

0 comments on commit 5a69c24

Please sign in to comment.