Commit f2208025 authored by rusty1s's avatar rusty1s
Browse files

0.3.0 fix

parent 0ea4cb8d
......@@ -4,6 +4,11 @@ from .new import new
def node_degree(index, n, out=None):
zero = torch.zeros(n) if out is None else out.resize_(n).fill_(0)
if out is None:
zero = torch.zeros(n)
else:
out.resize_(n) if torch.is_tensor(out) else out.data.resize_(n)
zero = out.fill_(0)
one = new(zero, index.size(0)).fill_(1)
return zero.scatter_add_(0, index, one)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment