This is how the working of the code is to be:


An adjacency matrix A of size nXn is passed into the constructor and X is the degree matrix of A (of size nX1)


Also, the values L, n and z_dim are initialized and tensor h0 copies the value from  X. Also, another tensor h (not h0; sorry for the similar confusing names) of size (L-1)X n X z_dim is initialized in


for v in range(self.n):
            self.h[0][v] = F.relu(self.h0[v]*W0)



The trainable parameter is W0 which is to be trained is of the dimension 10X8


Now, in the forward method, all the values of h are set here:


for l in range(1,self.L-1):
            
            h_n[l] = torch.mm(d_u, self.h[l-1].double())
            self.h[l] = rnn(self.h[l-1], h_n[l]).detach().float()
            self.h[l] = F.normalize(self.h[l], p=2, dim=1)
                        
            H = torch.max(H, self.h[l])

Note that when l=1, h[l-1] = h[0] which is set as:
for v in range(self.n):
            self.h[0][v] = F.relu(self.h0[v]*W0)

So ultimately, all values of h and H tensor are dependent on W0 weight which has to be trained. The forward method will return H tensor which will be compared with H1 (another pre-defined tensor) and difference between the two is to be minimised.
Please ask if there’s any clarification needed. Thanks for your time and help.