How to add specific vector to each node in my heterograph

Hello,

I’m struggling with the data format of heterogeneous graph. In fact, i want to add specific vector to my node instances of node types instead of generate either randomly vectors or fulfilling with ones vectors.
Can anyone have idea about this ?
Thank
Gaoussou

Try dgl.heterograph to create your graph.

Hi @gsanou, have you solved the problem?

If you mean create heterogeneous graph structure specific vector, try dgl.heterograph

If you mean add features to a heterograph ,you can use ndata property, a sample looks like:
g.nodes['treats'].data['he'] = th.ones(3, 1)

i figured out with. Thank you

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.