Skip to content

Commit

Permalink
adding back .cpu() before .numpy() in get_feature_matrix.py
Browse files Browse the repository at this point in the history
Signed-off-by: Tsz Wai Ko <[email protected]>
  • Loading branch information
kenko911 authored Oct 3, 2024
1 parent 7d143fd commit cc13b15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/matgl/layers/_atom_ref.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def get_feature_matrix(self, graphs: list[dgl.DGLGraph]) -> torch.Tensor:
for i, graph in enumerate(graphs):
atomic_numbers = graph.ndata["node_type"]
features[i] = torch.bincount(atomic_numbers, minlength=self.max_z)
return features.numpy()
return features.cpu().numpy()

def fit(self, graphs: list[dgl.DGLGraph], properties: torch.Tensor) -> None:
"""Fit the elemental reference values for the properties.
Expand Down

0 comments on commit cc13b15

Please sign in to comment.