The following code gives an error that the dimensions for the matrices in spmm do not match up
def sgc_precompute(features, adj, degree):
t = perf_counter()
for i in range(degree):
features = torch.spmm(adj, torch.transpose(features, 1,0))
precompute_time = perf_counter()-t
return torch.transpose(features, 1, 0), precompute_time
I’m confused because the following code works. Notice that the only change was that I explicitly set features
to torch.transpose(features, 1,0)
and then passed features as an argument to spmm, instead of just passing in torch.transpose(features, 1,0)
directly
def sgc_precompute(features, adj, degree):
t = perf_counter()
features = torch.transpose(features, 1, 0)
for i in range(degree):
features = torch.spmm(adj, features)
precompute_time = perf_counter()-t
return torch.transpose(features, 1, 0), precompute_time