New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix key output of networkx edge getter: #3646
Fix key output of networkx edge getter: #3646
Conversation
Removed the key output, which resulted in a three dimensional tensor, when using MultiDiGraphs. Three dimensional edge tuples could not be converted into the required [2,-1] COO format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like CI is failing. Can you ensure that all tests in test_convert.py
still work?
I forget to check non multi-graphs: |
Check: networkx graphtype
Codecov Report
@@ Coverage Diff @@
## master #3646 +/- ##
==========================================
- Coverage 81.50% 81.47% -0.03%
==========================================
Files 294 294
Lines 14757 14734 -23
==========================================
- Hits 12028 12005 -23
Misses 2729 2729
Continue to review full report at Codecov.
|
Line too Long
remove blank space
Super. Thank you :) |
Removed the key output, which resulted in a three-dimensional tensor, when using MultiDiGraphs.
Three-dimensional edge tuples could not be converted into the required [2,-1] COO format.
Example:
Right:
print(list(G.edges(keys=False)))
[(2, 1), (5, 4), (5, 4), (5, 4), (6, 1), (7, 1)]
Wrong:
print(list(G.edges))
[(2, 1, 0), (5, 4, 0), (5, 4, 1), (5, 4, 2), (6, 1, 0), (7, 1, 0)]
Wrong:
print(torch.LongTensor(list(G.edges)))
tensor([[2, 1, 0],
[5, 4, 0],
[5, 4, 1],
[5, 4, 2],
[6, 1, 0],
[7, 1, 0]])
Right:
print(torch.LongTensor(list(G.edges(keys=False))).t().contiguous())
tensor([[2, 5, 5, 5, 6, 7],
[1, 4, 4, 4, 1, 1]])`