I’m working on a graph neural network with dgl library. What makes me uncertain is that at one point, I calculate a pairwise attention using a simple MLP between adjacent node, and create a new node in the graph if a certain pair has scores higher than some threshold. This graph will be used in the next step to do graph convolution. I don’t think I can write this operation in closed form, and thus I’m not sure if pytorch can differentiate this either.