Hi,
Thanks for your reply.
If you look at this repo at this line: https://github.com/bdqnghi/bi-tbcnn/blob/master/bi-tbcnn/bi-tbcnn/network.py#L155 18, which performs a bunch of complicated matrix operations on the tree structure.
These lines do the job:
vector_lookup = tf.concat([zero_vecs, nodes[:, 1:, :]], axis=1)

....
children = tf.concat([batch_indices, children], axis=3)
return tf.gather_nd(vector_lookup, children, name='children')

the shape of the vector lookup will be sth like: (15, 720, 30)
and the shape of the children will be sth like: (15, 720, 19, 2)
and my goal is to do thing similar to the return line
I’m trying to port this into Pytorch but seems quite tricky in some parts.