meliketoy / graph-tutorial.pytorch

Pytorch Tutorial for Non-Euclidean Graph Representations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sparse tensor

bousejin opened this issue · comments

commented

Hi, Bumsoo. Thank you for your great tutorial. I am experimenting with your attention code and got this error:

attention = torch.where(adj > 0, e, zero_vec)
RuntimeError: _th_gt is not implemented for type torch.sparse.FloatTensor

Do you have any idea to get rid of this error?

Hi,

First of all, thank you for your compliment! :)

Would you try converting the tensor back to being dense by applying
adj.to_dense()?

commented

You're welcome. Thank you so much for your help. Nice solution!