pls i want to extract the features of nodes and edge labels from a DGLBlock object.
namely my graph is heterogeneous.
G = dgl.heterograph({
('user', 'rates', 'item') : M.nonzero(),
('item', 'rated_by', 'user') : M.transpose().nonzero()})
G.nodes['user'].data['x'] = users_features
G.nodes['item'].data['x'] = items_features
G.edges['rates'].data['label'] = weights
G.edges['rated_by'].data['label'] = weights
and the DGLBlock object is obtained from
train_loader = dgl.dataloading.DataLoader(G, eids, sampler, batch_size=batch_size, shuffle=True, drop_last=False, num_workers=4)
for input_nodes, output_nodes, blocks in tqdm(valid_loader):
.........................................
and thank you