From ca71627f95619766b99f0762a8fcf3a9b6044f73 Mon Sep 17 00:00:00 2001 From: harrypotty18 Date: Tue, 29 Mar 2022 04:11:05 +0800 Subject: [PATCH] Update molecular_graph.py --- CIGIN_V2/molecular_graph.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CIGIN_V2/molecular_graph.py b/CIGIN_V2/molecular_graph.py index 8580397..9ab3df7 100644 --- a/CIGIN_V2/molecular_graph.py +++ b/CIGIN_V2/molecular_graph.py @@ -91,6 +91,6 @@ def get_graph_from_smile(molecule_smile): bond_features_ij = get_bond_features(bond_ij) edge_features.append(bond_features_ij) - G.ndata['x'] = np.array(node_features) - G.edata['w'] = np.array(edge_features) + G.ndata['x'] = torch.from_numpy(np.array(node_features)) + G.edata['w'] = torch.from_numpy(np.array(edge_features)) return G