Your self.weight is still transformed to long(), so you might need to remove it as well.
I’m not familiar with your use case, but LongTensors won’t get any gradients, so you would have to stick to floating point types. Based on your use case you might want to post-process the adj matrix, if you want to use only ones and zeros in it.